package com.steerinfo.ems.ifmesemswatermonitor.model;

import com.alibaba.fastjson.JSONObject;
import com.steerinfo.ems.Utils.DateUtils;
import com.steerinfo.framework.model.IBasePO;
import io.swagger.annotations.ApiModelProperty;

public class IfMesEmsWatermonitor implements IBasePO<String> {
    /**
     * 记录ID(WTBH,VARCHAR,255)
     */
    @ApiModelProperty(value="记录ID",required=true)
    private String recordid;

    /**
     * 检验ID(WTBH,VARCHAR,255)
     */
    @ApiModelProperty(value="检验ID",required=true)
    private String wtbh;

    /**
     * 物料编码(MATERIALNO,VARCHAR,100)
     */
    @ApiModelProperty(value="物料编码",required=false)
    private String materialno;

    /**
     * 物料名称(MATERIALNAME,VARCHAR,100)
     */
    @ApiModelProperty(value="物料名称",required=false)
    private String materialname;

    /**
     * 检测项编号(ITEMCODE,VARCHAR,20)
     */
    @ApiModelProperty(value="检测项编号",required=false)
    private String itemcode;

    /**
     * 检测项名称(ITEM,VARCHAR,255)
     */
    @ApiModelProperty(value="检测项名称",required=false)
    private String item;

    /**
     * 检测项值(TESTRESULT,VARCHAR,255)
     */
    @ApiModelProperty(value="检测项值",required=false)
    private String testresult;

    /**
     * 检验项判定(ITEMJUDGERESULT,VARCHAR,255)
     */
    @ApiModelProperty(value="检验项判定",required=false)
    private String itemjudgeresult;

    /**
     * 判定结果(JUDGERESULT,VARCHAR,255)
     */
    @ApiModelProperty(value="判定结果",required=false)
    private String judgeresult;

    /**
     * 化验类别(SAMPLETYPE,VARCHAR,255)
     */
    @ApiModelProperty(value="化验类别",required=false)
    private String sampletype;

    /**
     * 检测时间(INPUTTIME,VARCHAR,255)
     */
    @ApiModelProperty(value="检测时间",required=false)
    private String inputtime;

    /**
     * 判定时间(JUDGETIME,VARCHAR,255)
     */
    @ApiModelProperty(value="判定时间",required=false)
    private String judgetime;

    /**
     * 检验人(RECORDER,VARCHAR,255)
     */
    @ApiModelProperty(value="检验人",required=false)
    private String recorder;

    /**
     * 样品编号(SAMPLENO,VARCHAR,40)
     */
    @ApiModelProperty(value="样品编号",required=false)
    private String sampleno;

    /**
     * 取样人(SAMPLEPERSON,VARCHAR,40)
     */
    @ApiModelProperty(value="取样人",required=false)
    private String sampleperson;

    /**
     * 取样时间(SAMPLETIME,VARCHAR,20)
     */
    @ApiModelProperty(value="取样时间",required=false)
    private String sampletime;

    /**
     * 送样人(SENDER,VARCHAR,20)
     */
    @ApiModelProperty(value="送样人",required=false)
    private String sender;

    /**
     * 送样时间(SENDTIME,VARCHAR,20)
     */
    @ApiModelProperty(value="送样时间",required=false)
    private String sendtime;

    /**
     * 备注(MEMO,VARCHAR,255)
     */
    @ApiModelProperty(value="备注",required=false)
    private String memo;

    /**
     * 物料来源(MATERIALSOURCE,VARCHAR,100)
     */
    @ApiModelProperty(value="物料来源",required=false)
    private String materialsource;

    private static final long serialVersionUID = 1L;

    @Override
    public String getId() {
        return this.recordid;
    }

    @Override
    public void setId(String recordid) {
        this.recordid = recordid == null ? null : recordid.trim();
    }

    public String getWtbh() {
        return wtbh;
    }

    public void setWtbh(String wtbh) {
        this.wtbh = wtbh == null ? null : wtbh.trim();
    }

    public String getMaterialno() {
        return materialno;
    }

    public void setMaterialno(String materialno) {
        this.materialno = materialno == null ? null : materialno.trim();
    }

    public String getMaterialname() {
        return materialname;
    }

    public void setMaterialname(String materialname) {
        this.materialname = materialname == null ? null : materialname.trim();
    }

    public String getItemcode() {
        return itemcode;
    }

    public void setItemcode(String itemcode) {
        this.itemcode = itemcode == null ? null : itemcode.trim();
    }

    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item == null ? null : item.trim();
    }

    public String getTestresult() {
        return testresult;
    }

    public void setTestresult(String testresult) {
        this.testresult = testresult == null ? null : testresult.trim();
    }

    public String getItemjudgeresult() {
        return itemjudgeresult;
    }

    public void setItemjudgeresult(String itemjudgeresult) {
        this.itemjudgeresult = itemjudgeresult == null ? null : itemjudgeresult.trim();
    }

    public String getJudgeresult() {
        return judgeresult;
    }

    public void setJudgeresult(String judgeresult) {
        this.judgeresult = judgeresult == null ? null : judgeresult.trim();
    }

    public String getSampletype() {
        return sampletype;
    }

    public void setSampletype(String sampletype) {
        this.sampletype = sampletype == null ? null : sampletype.trim();
    }

    public String getInputtime() {
        return inputtime;
    }

    public void setInputtime(String inputtime) {
        this.inputtime = inputtime == null ? null : inputtime.trim();
    }

    public String getJudgetime() {
        return judgetime;
    }

    public void setJudgetime(String judgetime) {
        this.judgetime = judgetime == null ? null : judgetime.trim();
    }

    public String getRecorder() {
        return recorder;
    }

    public void setRecorder(String recorder) {
        this.recorder = recorder == null ? null : recorder.trim();
    }

    public String getSampleno() {
        return sampleno;
    }

    public void setSampleno(String sampleno) {
        this.sampleno = sampleno == null ? null : sampleno.trim();
    }

    public String getSampleperson() {
        return sampleperson;
    }

    public void setSampleperson(String sampleperson) {
        this.sampleperson = sampleperson == null ? null : sampleperson.trim();
    }

    public String getSampletime() {
        return sampletime;
    }

    public void setSampletime(String sampletime) {
        this.sampletime = sampletime == null ? null : sampletime.trim();
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender == null ? null : sender.trim();
    }

    public String getSendtime() {
        return sendtime;
    }

    public void setSendtime(String sendtime) {
        this.sendtime = sendtime == null ? null : sendtime.trim();
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    public String getMaterialsource() {
        return materialsource;
    }

    public void setMaterialsource(String materialsource) {
        this.materialsource = materialsource == null ? null : materialsource.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", wtbh=").append(wtbh);
        sb.append(", materialno=").append(materialno);
        sb.append(", materialname=").append(materialname);
        sb.append(", itemcode=").append(itemcode);
        sb.append(", item=").append(item);
        sb.append(", testresult=").append(testresult);
        sb.append(", itemjudgeresult=").append(itemjudgeresult);
        sb.append(", judgeresult=").append(judgeresult);
        sb.append(", sampletype=").append(sampletype);
        sb.append(", inputtime=").append(inputtime);
        sb.append(", judgetime=").append(judgetime);
        sb.append(", recorder=").append(recorder);
        sb.append(", sampleno=").append(sampleno);
        sb.append(", sampleperson=").append(sampleperson);
        sb.append(", sampletime=").append(sampletime);
        sb.append(", sender=").append(sender);
        sb.append(", sendtime=").append(sendtime);
        sb.append(", memo=").append(memo);
        sb.append(", materialsource=").append(materialsource);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    /**
     * JSONObject对象转IfMesEmsWatermonitor对象
     *
     * @param jo   JSONObject对象
     * @return
     */
    public void jsonobjectToIfMesEmsWatermonitor(JSONObject jo){
        try {
            this.wtbh = jo.getString("wtbh");
            this.materialno = jo.getString("materialno");
            this.materialname = jo.getString("materialname");
            this.itemcode = jo.getString("itemcode");
            this.item = jo.getString("item");
            this.testresult = jo.getString("testresult");
            this.itemjudgeresult = jo.getString("itemjudgeresult");
            this.judgeresult = jo.getString("judgeresult");
            this.sampletype = jo.getString("sampletype");
            this.inputtime = DateUtils.stampToDate(jo.getString("inputtime"));
            this.judgetime = DateUtils.stampToDate(jo.getString("judgetime"));
            this.recorder = jo.getString("recorder");
            this.sampleno = jo.getString("sampleno");
            this.sampleperson = jo.getString("sampleperson");
            this.sampletime = DateUtils.stampToDate(jo.getString("sampletime"));
            this.sender = jo.getString("sender");
            this.sendtime = DateUtils.stampToDate(jo.getString("sendtime"));
            this.memo = jo.getString("memo");
            this.materialsource = jo.getString("materialsource");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}