package com.sooka.system.medicine.plant.domain;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sooka.common.annotation.Excel;
import com.sooka.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 种植采集数对象 t_guiji_medicine_plant
 *
 * @author lei
 * @date 2022-08-22
 */
public class TGuijiMedicinePlant extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 传感器编号 */
    private String id;

    /** 推送时间 */
    @Excel(name = "推送时间")
    private String cdTime;

    /** 批次号 */
    @Excel(name = "批次号")
    private String cdBatch;

    /** 操作状态 */
    @Excel(name = "操作状态")
    private String cdOperation;

    /** 数据来源 */
    @Excel(name = "数据来源")
    private String cdSource;

    /** 种植品种 */
    @Excel(name = "种植品种")
    private String plantName;

    /** 种植区域 */
    @Excel(name = "种植区域")
    private String plantAddress;

    /** 种植面积 */
    @Excel(name = "种植面积")
    private String plantHectare;

    /** 年产量 */
    @Excel(name = "年产量")
    private String produceTons;

    /** 年产值 */
    @Excel(name = "年产值")
    private String produceValue;

    /** 统计年份 */
    @Excel(name = "统计年份")
    private String plantYear;

    public void setId(String id)
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }
    public void setCdTime(String cdTime)
    {
        this.cdTime = cdTime;
    }

    public String getCdTime()
    {
        return cdTime;
    }
    public void setCdBatch(String cdBatch)
    {
        this.cdBatch = cdBatch;
    }

    public String getCdBatch()
    {
        return cdBatch;
    }
    public void setCdOperation(String cdOperation)
    {
        this.cdOperation = cdOperation;
    }

    public String getCdOperation()
    {
        return cdOperation;
    }
    public void setCdSource(String cdSource)
    {
        this.cdSource = cdSource;
    }

    public String getCdSource()
    {
        return cdSource;
    }
    public void setPlantName(String plantName)
    {
        this.plantName = plantName;
    }

    public String getPlantName()
    {
        return plantName;
    }
    public void setPlantAddress(String plantAddress)
    {
        this.plantAddress = plantAddress;
    }

    public String getPlantAddress()
    {
        return plantAddress;
    }
    public void setPlantHectare(String plantHectare)
    {
        this.plantHectare = plantHectare;
    }

    public String getPlantHectare()
    {
        return plantHectare;
    }
    public void setProduceTons(String produceTons)
    {
        this.produceTons = produceTons;
    }

    public String getProduceTons()
    {
        return produceTons;
    }
    public void setProduceValue(String produceValue)
    {
        this.produceValue = produceValue;
    }

    public String getProduceValue()
    {
        return produceValue;
    }
    public void setPlantYear(String plantYear)
    {
        this.plantYear = plantYear;
    }

    public String getPlantYear()
    {
        if(JSON.isValidObject(plantYear)){
            JSONObject jsonObject = JSON.parseObject(plantYear);
            return jsonObject.getString("value");
        }else {
            return plantYear;
        }
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("createTime", getCreateTime())
            .append("cdTime", getCdTime())
            .append("cdBatch", getCdBatch())
            .append("cdOperation", getCdOperation())
            .append("cdSource", getCdSource())
            .append("plantName", getPlantName())
            .append("plantAddress", getPlantAddress())
            .append("plantHectare", getPlantHectare())
            .append("produceTons", getProduceTons())
            .append("produceValue", getProduceValue())
            .append("plantYear", getPlantYear())
            .toString();
    }
}
