package com.hw.mes.domain;

import java.math.BigDecimal;
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_order
 *
 * @author Yinq
 * @date 2024-02-20
 */
public class MesProductOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

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

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

    /**
     * 销售订单ID,关联mes_sale_order的order_id;一个销售订单可以有多个生产工单
     */
    @Excel(name = "销售订单ID")
    private Long saleOrderId;

    /**
     * 销售订单编号
     */
    @Excel(name = "销售订单编号")
    private String saleorderCode;

    /**
     * 销售订单行号
     */
    @Excel(name = "销售订单行号")
    private String saleorderLinenumber;

    /**
     * 项目编号
     */
    @Excel(name = "项目编号")
    private String projectNo;

    /**
     * 物料ID,关联mes_base_material_info的material_id;成品信息
     */
    @Excel(name = "物料ID")
    private Long materialId;

    /**
     * 物料bomID，关联mes_material_bom的material_bom_id;默认选择最新的正常状态的bom，可修改
     */
    @Excel(name = "物料bomID")
    private Long materialBomId;

    /**
     * BOM说明
     */
    @Excel(name = "BOM说明")
    private String materialBomDesc;

    /**
     * 派工类型(1产线 2工艺路线)
     */
    @Excel(name = "派工类型")
    private String dispatchType;

    /**
     * 派工ID（派工类型为产线关联产线主键，派工类型为工艺路线关联工艺路线主键）
     */
    @Excel(name = "派工ID")
    private Long dispatchId;


    /**
     * 销售数量;销售订单的销售数量
     */
    @Excel(name = "销售数量")
    private BigDecimal saleAmount;

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

    /**
     * 已派工数量;派工类型是工艺路线的每个工位派工数量相同，派工类型是产线的派工数量是所有工位累加的
     */
    @Excel(name = "已派工数量")
    private BigDecimal dispatchAmount;

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

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date releaseTime;

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

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

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

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

    /**
     * 计划交货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "计划交货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planDeliveryDate;

    /**
     * 工单状态：0-待发布；1-已发布；2-已完成；3-已开始；4-暂停；8-已撤回；9-已删除
     */
    @Excel(name = "工单状态")
    private String orderStatus;

    /**
     * 库存锁定标识：1-是；0-否
     */
    @Excel(name = "库存锁定标识")
    private String stockLockFlag;

    /**
     * 是否销售订单创建生产工单（1=是;0=否）
     */
    private String saleOrderFlag;

    /**
     * 工艺路线名称
     */
    @Excel(name = "工艺路线名称")
    private String dispatchName;

    /**
     * 物料编号
     */
    @Excel(name = "物料编号")
    private String materialCode;

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

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

    public Long getProductionTime() {
        return productionTime;
    }

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

    public String getMaterialBomDesc() {
        return materialBomDesc;
    }

    public void setMaterialBomDesc(String materialBomDesc) {
        this.materialBomDesc = materialBomDesc;
    }

    public String getDispatchName() {
        return dispatchName;
    }

    public void setDispatchName(String dispatchName) {
        this.dispatchName = dispatchName;
    }



    public Date getPlanDeliveryDate() {
        return planDeliveryDate;
    }

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

    public String getSaleOrderFlag() {
        return saleOrderFlag;
    }

    public void setSaleOrderFlag(String saleOrderFlag) {
        this.saleOrderFlag = saleOrderFlag;
    }

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

    public Long getProductOrderId() {
        return productOrderId;
    }

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

    public String getOrderCode() {
        return orderCode;
    }

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

    public Long getSaleOrderId() {
        return saleOrderId;
    }

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

    public String getSaleorderCode() {
        return saleorderCode;
    }

    public void setSaleorderLinenumber(String saleorderLinenumber) {
        this.saleorderLinenumber = saleorderLinenumber;
    }

    public String getSaleorderLinenumber() {
        return saleorderLinenumber;
    }

    public void setProjectNo(String projectNo) {
        this.projectNo = projectNo;
    }

    public String getProjectNo() {
        return projectNo;
    }

    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 setDispatchType(String dispatchType) {
        this.dispatchType = dispatchType;
    }

    public String getDispatchType() {
        return dispatchType;
    }

    public void setDispatchId(Long dispatchId) {
        this.dispatchId = dispatchId;
    }

    public Long getDispatchId() {
        return dispatchId;
    }

    public void setSaleAmount(BigDecimal saleAmount) {
        this.saleAmount = saleAmount;
    }

    public BigDecimal getSaleAmount() {
        return saleAmount;
    }

    public void setPlanAmount(BigDecimal planAmount) {
        this.planAmount = planAmount;
    }

    public BigDecimal getPlanAmount() {
        return planAmount;
    }

    public void setDispatchAmount(BigDecimal dispatchAmount) {
        this.dispatchAmount = dispatchAmount;
    }

    public BigDecimal getDispatchAmount() {
        return dispatchAmount;
    }

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

    public BigDecimal getCompleteAmount() {
        return completeAmount;
    }

    public void setReleaseTime(Date releaseTime) {
        this.releaseTime = releaseTime;
    }

    public Date getReleaseTime() {
        return releaseTime;
    }

    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 setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setStockLockFlag(String stockLockFlag) {
        this.stockLockFlag = stockLockFlag;
    }

    public String getStockLockFlag() {
        return stockLockFlag;
    }

    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("productOrderId", getProductOrderId())
                .append("orderCode", getOrderCode())
                .append("saleOrderId", getSaleOrderId())
                .append("saleorderCode", getSaleorderCode())
                .append("saleorderLinenumber", getSaleorderLinenumber())
                .append("projectNo", getProjectNo())
                .append("materialId", getMaterialId())
                .append("materialBomId", getMaterialBomId())
                .append("dispatchType", getDispatchType())
                .append("dispatchId", getDispatchId())
                .append("saleAmount", getSaleAmount())
                .append("planAmount", getPlanAmount())
                .append("dispatchAmount", getDispatchAmount())
                .append("completeAmount", getCompleteAmount())
                .append("releaseTime", getReleaseTime())
                .append("planBeginTime", getPlanBeginTime())
                .append("planEndTime", getPlanEndTime())
                .append("realBeginTime", getRealBeginTime())
                .append("realEndTime", getRealEndTime())
                .append("orderStatus", getOrderStatus())
                .append("stockLockFlag", getStockLockFlag())
                .append("remark", getRemark())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
