package com.yunfeiyun.agmp.fms.domain;

import com.yunfeiyun.agmp.common.annotation.Excel;
import com.yunfeiyun.agmp.common.core.domain.BaseEntity;
import com.yunfeiyun.agmp.common.enums.CommonEnums;
import com.yunfeiyun.agmp.common.utils.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 种植计划对象 FmsPlan
 * 
 * @author 杨晓辉
 * @date 2023-05-18
 */
public class FmsPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 种植计划标识 */
    private String planId;

    /** 种植计划编号 */
    @Excel(name = "种植计划编号")
    private String planNo;

    /** 基地标识 */
    @NotBlank(message = "基地标识不能为空")
    @Excel(name = "基地标识")
    private String landId;

    /** 地块标识 */
    @NotBlank(message = "地块标识不能为空")
    @Excel(name = "地块标识")
    private String blockId;

    /** 作物标识 */
    @NotBlank(message = "作物标识不能为空")
    @Excel(name = "作物标识")
    private String cropId;

    /** 种植计划面积 */
    @NotNull(message = "种植计划面积不能为空")
    @Excel(name = "种植计划面积")
    private BigDecimal planArea;

    /** 种植计划计划开始日期 */
    @NotBlank(message = "开始日期不能为空")
    @Excel(name = "种植计划计划开始日期")
    private String planPlanstartdate;

    /** 种植计划计划结束日期 */
    @NotBlank(message = "结束日期不能为空")
    @Excel(name = "种植计划计划结束日期")
    private String planPlanenddate;

    /** 种植计划开始时间 */
    @Excel(name = "种植计划开始时间")
    private String planStartdate;

    /** 种植计划结束时间 */
    @Excel(name = "种植计划结束时间")
    private String planEnddate;

    /** 种植计划当前状态 */
    @Excel(name = "种植计划当前状态")
    private String planStatus;

    /** 种植计划详情 */
    @Excel(name = "种植计划详情")
    private String planRemark;

    /** 种植计划创建人 */
    @Excel(name = "种植计划创建人")
    private String planCreator;

    /** 种植计划创建时间 */
    @Excel(name = "种植计划创建时间")
    private String planCreateddate;

    /** 种植计划修改人 */
    @Excel(name = "种植计划修改人")
    private String planModifier;

    /** 种植计划修改时间 */
    @Excel(name = "种植计划修改时间")
    private String planModifieddate;



    /** 作物周期阶段名称 */
    @Excel(name = "作物周期阶段名称")
    private String planPeriodname;

    /** 种植计划当前状态名称 */
    @Excel(name = "种植计划当前状态名称")
    private String planStatusContent;

    public String getPlanStatusContent() {
        if (!StringUtils.isEmpty(this.planStatus)) {
            if (CommonEnums.PLAN_STATUS_NOT_START.getCode().equals(this.planStatus)) {
                return CommonEnums.PLAN_STATUS_NOT_START.getMessage();
            } else if (CommonEnums.PLAN_STATUS_START.getCode().equals(this.planStatus)) {
                return CommonEnums.PLAN_STATUS_START.getMessage();
            }else if (CommonEnums.PLAN_STATUS_END.getCode().equals(this.planStatus)) {
                return CommonEnums.PLAN_STATUS_END.getMessage();
            } else {
                return "";
            }
        } else {
            return "";
        }
    }

    public String getPlanPeriodname() {
        return planPeriodname;
    }

    public void setPlanPeriodname(String planPeriodname) {
        this.planPeriodname = planPeriodname;
    }

    public void setPlanId(String planId)
    {
        this.planId = planId;
    }

    public String getPlanId()
    {
        return planId;
    }
    public void setPlanNo(String planNo)
    {
        this.planNo = planNo;
    }

    public String getPlanNo()
    {
        return planNo;
    }
    public void setLandId(String landId)
    {
        this.landId = landId;
    }

    public String getLandId()
    {
        return landId;
    }
    public void setBlockId(String blockId)
    {
        this.blockId = blockId;
    }

    public String getBlockId()
    {
        return blockId;
    }
    public void setCropId(String cropId)
    {
        this.cropId = cropId;
    }

    public String getCropId()
    {
        return cropId;
    }
    public void setPlanArea(BigDecimal planArea)
    {
        this.planArea = planArea;
    }

    public BigDecimal getPlanArea()
    {
        return planArea;
    }
    public void setPlanPlanstartdate(String planPlanstartdate)
    {
        this.planPlanstartdate = planPlanstartdate;
    }

    public String getPlanPlanstartdate()
    {
        return planPlanstartdate;
    }
    public void setPlanPlanenddate(String planPlanenddate)
    {
        this.planPlanenddate = planPlanenddate;
    }

    public String getPlanPlanenddate()
    {
        return planPlanenddate;
    }
    public void setPlanStartdate(String planStartdate)
    {
        this.planStartdate = planStartdate;
    }

    public String getPlanStartdate()
    {
        return planStartdate;
    }
    public void setPlanEnddate(String planEnddate)
    {
        this.planEnddate = planEnddate;
    }

    public String getPlanEnddate()
    {
        return planEnddate;
    }
    public void setPlanStatus(String planStatus)
    {
        this.planStatus = planStatus;
    }

    public String getPlanStatus()
    {
        return planStatus;
    }
    public void setPlanRemark(String planRemark)
    {
        this.planRemark = planRemark;
    }

    public String getPlanRemark()
    {
        return planRemark;
    }
    public void setPlanCreator(String planCreator)
    {
        this.planCreator = planCreator;
    }

    public String getPlanCreator()
    {
        return planCreator;
    }
    public void setPlanCreateddate(String planCreateddate)
    {
        this.planCreateddate = planCreateddate;
    }

    public String getPlanCreateddate()
    {
        return planCreateddate;
    }
    public void setPlanModifier(String planModifier)
    {
        this.planModifier = planModifier;
    }

    public String getPlanModifier()
    {
        return planModifier;
    }
    public void setPlanModifieddate(String planModifieddate)
    {
        this.planModifieddate = planModifieddate;
    }

    public String getPlanModifieddate()
    {
        return planModifieddate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("planId", getPlanId())
            .append("planNo", getPlanNo())
            .append("landId", getLandId())
            .append("blockId", getBlockId())
            .append("cropId", getCropId())
            .append("planArea", getPlanArea())
            .append("planPlanstartdate", getPlanPlanstartdate())
            .append("planPlanenddate", getPlanPlanenddate())
            .append("planStartdate", getPlanStartdate())
            .append("planEnddate", getPlanEnddate())
            .append("planStatus", getPlanStatus())
            .append("planRemark", getPlanRemark())
            .append("planCreator", getPlanCreator())
            .append("planCreateddate", getPlanCreateddate())
            .append("planModifier", getPlanModifier())
            .append("planModifieddate", getPlanModifieddate())
            .append("planPeriodname", getPlanPeriodname())
            .toString();
    }
}
