package com.hw.mes.domain;

import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;

/**
 * 生产派工对象 mes_product_plan
 *
 * @author xins
 * @date 2024-02-21
 */
public class MesProductPlan extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键标识 */
    private Long planId;

    /** 生产工单ID */
    @Excel(name = "生产工单ID")
    private Long productOrderId;

    /**
     * 生产工单编号
     */
    @Excel(name = "生产工单编号")
    private String orderCode;

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

    /** 派工单号;主要为顺序生产时，获取上一工序的派工单是否完成，每次派工生成的派工单号相同，不同次派工的派工单号不能相同 */
    @Excel(name = "派工单号")
    private String dispatchCode;

    /** 物料ID */
    @Excel(name = "物料ID")
    private Long materialId;

    /** 物料bomID，关联mes_material_bom的material_bom_id */
    @Excel(name = "物料bomID")
    private Long materialBomId;

    /** 物料bom名称 */
    @Excel(name = "物料bom名称")
    private String materialBomName;

    /** 工序ID */
    @Excel(name = "工序ID")
    private Long processId;

    /** 工序名称 */
    @Excel(name = "工序名称")
    private String processName;

    /** 顺序;派工类型是工艺路线的需要有顺序 */
    @Excel(name = "顺序")
    private Long processOrder;

    /** 上一工序ID */
    @Excel(name = "上一工序ID")
    private Long lastProcessId;

    /** 上工序名称 */
    @Excel(name = "上工序名称")
    private String lastProcessName;

    /** 工位ID，关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上，会拆分1到多条生产计划 */
    @Excel(name = "工位ID")
    private Long stationId;

    /** 工位名称 */
    @Excel(name = "工位名称")
    private String stationName;

    /** 用户ID*/
    @Excel(name = "用户ID")
    private Long userId;

    /** 单位生产时间(单位：s) */
    @Excel(name = "单位生产时间(单位：s)")
    private Long productionTime;

    /** 计划数量 */
    @Excel(name = "计划数量")
    private BigDecimal planAmount;

    /** 完成数量 */
    @Excel(name = "完成数量")
    private BigDecimal completeAmount;

    /** 计划开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planBeginTime;

    /** 计划结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planEndTime;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date realBeginTime;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date realEndTime;

    /** 附件信息，关联附件信息主键;多个用,隔开；页面可选择附件信息，也可直接上传 */
    @Excel(name = "附件信息")
    private String attachId;

    /** 计划状态：0-未派工；1-已派工；2-已开始 */
    @Excel(name = "计划状态")
    private String planStatus;

    /** 是否标识：1-是；0-否 */
    @Excel(name = "是否标识")
    private String isFlag;

    /** sop附件ID，关联附件信息主键 */
    @Excel(name = "sop附件ID")
    private String sopId;

    /**
     * 计划交付日期
     */
    private Date planDeliveryDate;

    /**
     * 物料编号
     */
    private String materialCode;

    /**
     * 物料名称
     */
    private String materialName;



    /** 生产计划明细信息 */
    private List<MesProductPlanDetail> mesProductPlanDetailList;

    /** 工单已派工数量 */
    private BigDecimal dispatchedAmount;

    /**
     * 销售订单ID,关联mes_sale_order的order_id;一个销售订单可以有多个生产工单
     */
    private Long saleOrderId;

    /**
     * 销售订单编号
     */
    private String saleorderCode;

    public Long getSaleOrderId() {
        return saleOrderId;
    }

    public void setSaleOrderId(Long saleOrderId) {
        this.saleOrderId = saleOrderId;
    }

    public String getSaleorderCode() {
        return saleorderCode;
    }

    public void setSaleorderCode(String saleorderCode) {
        this.saleorderCode = saleorderCode;
    }

    public String getSopId() {
        return sopId;
    }

    public void setSopId(String sopId) {
        this.sopId = sopId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getMaterialBomName() {
        return materialBomName;
    }

    public void setMaterialBomName(String materialBomName) {
        this.materialBomName = materialBomName;
    }

    public String getLastProcessName() {
        return lastProcessName;
    }

    public void setLastProcessName(String lastProcessName) {
        this.lastProcessName = lastProcessName;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public BigDecimal getDispatchedAmount() {
        return dispatchedAmount;
    }

    public void setDispatchedAmount(BigDecimal dispatchedAmount) {
        this.dispatchedAmount = dispatchedAmount;
    }

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

    public Long getPlanId()
    {
        return planId;
    }
    public void setProductOrderId(Long productOrderId)
    {
        this.productOrderId = productOrderId;
    }

    public Long getProductOrderId()
    {
        return productOrderId;
    }
    public void setPlanCode(String planCode)
    {
        this.planCode = planCode;
    }

    public String getPlanCode()
    {
        return planCode;
    }
    public void setDispatchCode(String dispatchCode)
    {
        this.dispatchCode = dispatchCode;
    }

    public String getDispatchCode()
    {
        return dispatchCode;
    }
    public void setMaterialId(Long materialId)
    {
        this.materialId = materialId;
    }

    public Long getMaterialId()
    {
        return materialId;
    }
    public void setMaterialBomId(Long materialBomId)
    {
        this.materialBomId = materialBomId;
    }

    public Long getMaterialBomId()
    {
        return materialBomId;
    }
    public void setProcessId(Long processId)
    {
        this.processId = processId;
    }

    public Long getProcessId()
    {
        return processId;
    }
    public void setProcessOrder(Long processOrder)
    {
        this.processOrder = processOrder;
    }

    public Long getProcessOrder()
    {
        return processOrder;
    }
    public void setLastProcessId(Long lastProcessId)
    {
        this.lastProcessId = lastProcessId;
    }

    public Long getLastProcessId()
    {
        return lastProcessId;
    }
    public void setStationId(Long stationId)
    {
        this.stationId = stationId;
    }

    public Long getStationId()
    {
        return stationId;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setProductionTime(Long productionTime)
    {
        this.productionTime = productionTime;
    }

    public Long getProductionTime()
    {
        return productionTime;
    }
    public void setPlanAmount(BigDecimal planAmount)
    {
        this.planAmount = planAmount;
    }

    public BigDecimal getPlanAmount()
    {
        return planAmount;
    }
    public void setCompleteAmount(BigDecimal completeAmount)
    {
        this.completeAmount = completeAmount;
    }

    public BigDecimal getCompleteAmount()
    {
        return completeAmount;
    }
    public void setPlanBeginTime(Date planBeginTime)
    {
        this.planBeginTime = planBeginTime;
    }

    public Date getPlanBeginTime()
    {
        return planBeginTime;
    }
    public void setPlanEndTime(Date planEndTime)
    {
        this.planEndTime = planEndTime;
    }

    public Date getPlanEndTime()
    {
        return planEndTime;
    }
    public void setRealBeginTime(Date realBeginTime)
    {
        this.realBeginTime = realBeginTime;
    }

    public Date getRealBeginTime()
    {
        return realBeginTime;
    }
    public void setRealEndTime(Date realEndTime)
    {
        this.realEndTime = realEndTime;
    }

    public Date getRealEndTime()
    {
        return realEndTime;
    }
    public void setAttachId(String attachId)
    {
        this.attachId = attachId;
    }

    public String getAttachId()
    {
        return attachId;
    }
    public void setPlanStatus(String planStatus)
    {
        this.planStatus = planStatus;
    }

    public String getPlanStatus()
    {
        return planStatus;
    }
    public void setIsFlag(String isFlag)
    {
        this.isFlag = isFlag;
    }

    public String getIsFlag()
    {
        return isFlag;
    }

    public List<MesProductPlanDetail> getMesProductPlanDetailList()
    {
        return mesProductPlanDetailList;
    }

    public void setMesProductPlanDetailList(List<MesProductPlanDetail> mesProductPlanDetailList)
    {
        this.mesProductPlanDetailList = mesProductPlanDetailList;
    }

    public Date getPlanDeliveryDate() {
        return planDeliveryDate;
    }

    public void setPlanDeliveryDate(Date planDeliveryDate) {
        this.planDeliveryDate = planDeliveryDate;
    }

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("planId", getPlanId())
            .append("productOrderId", getProductOrderId())
            .append("planCode", getPlanCode())
            .append("dispatchCode", getDispatchCode())
            .append("materialId", getMaterialId())
            .append("materialBomId", getMaterialBomId())
            .append("processId", getProcessId())
            .append("processOrder", getProcessOrder())
            .append("lastProcessId", getLastProcessId())
            .append("stationId", getStationId())
            .append("userId", getUserId())
            .append("productionTime", getProductionTime())
            .append("planAmount", getPlanAmount())
            .append("completeAmount", getCompleteAmount())
            .append("planBeginTime", getPlanBeginTime())
            .append("planEndTime", getPlanEndTime())
            .append("realBeginTime", getRealBeginTime())
            .append("realEndTime", getRealEndTime())
            .append("attachId", getAttachId())
            .append("planStatus", getPlanStatus())
            .append("isFlag", getIsFlag())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("mesProductPlanDetailList", getMesProductPlanDetailList())
            .toString();
    }
}
