package cn.ezhizao.project.business.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
import cn.ezhizao.framework.web.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;

/**
 * 生产计划明细对象 biz_production_plan_detail
 *
 * @author ruoyi
 * @date 2023-11-13
 */
@Data
@TableName(value = "biz_production_plan_detail")
public class BizProductionPlanDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 租户（厂别）id */
    @ApiModelProperty(value = "${comment}")
    private Long tenantId;

    /** 交易代码 */
    @Excel(name = "交易代码")
    @ApiModelProperty(value = "交易代码")
    private String transactionCode;

    /** 计划单id */
    @ApiModelProperty(value = "计划单id")
    private Long productionPlanId;

    /** 投料/计划单号 */
    @Excel(name = "投料/计划单号")
    @ApiModelProperty(value = "投料/计划单号")
    private String productionPlanNo;

    /** 序号 */
    @Excel(name = "序号")
    @ApiModelProperty(value = "序号")
    private Integer lineNumber;

    /** 领料部门id */
    @ApiModelProperty(value = "领料部门id")
    private Long requisitionDepartmentId;

    /** 领料部门编码 */
    @Excel(name = "领料部门编码")
    @ApiModelProperty(value = "领料部门编码")
    private String requisitionDepartmentCode;

    /** 客户id */
    @ApiModelProperty(value = "领料部门编码")
    private Long companyId;

    /** 客户编码 */
    @Excel(name = "客户编码")
    @ApiModelProperty(value = "客户编码")
    private String companyCode;

    /** 客户简称 */
    @Excel(name = "客户简称")
    @ApiModelProperty(value = "客户简称")
    private String companyAlias;

    /** 产品id */
    @ApiModelProperty(value = "客户编码")
    private Long productId;

    /** 产品编码 */
    @Excel(name = "产品编码")
    @ApiModelProperty(value = "产品编码")
    private String productCode;

    /** 产品规格 */
    @Excel(name = "产品规格")
    @ApiModelProperty(value = "产品规格")
    private String specification;

    /** 产品图号 */
    @Excel(name = "产品图号")
    @ApiModelProperty(value = "产品图号")
    private String drawingNumber;

    /**
     * 工艺id
     */
    @ApiModelProperty(value = "${comment}")
    private Long technologicalProcessId;

    /**
     * 工艺版本
     */
    @ApiModelProperty(value = "${comment}")
    private String technologyVersion;



    /** 库位 */
    @Excel(name = "库位")
    @ApiModelProperty(value = "库位")
    private String storageLocation;

    /** 生产数量 */
    @Excel(name = "生产数量")
    @ApiModelProperty(value = "生产数量")
    private BigDecimal productionQuantity;

    /** 限额领料量/投料数量 */
    @Excel(name = "限额领料量/投料数量")
    @ApiModelProperty(value = "限额领料量/投料数量")
    private BigDecimal materialPickUpQuantity;

    /** 状态id（对应数据字典id） */
    @ApiModelProperty(value = "限额领料量/投料数量")
    private Long statusId;

    /** NA：经营初始，FM：经营申请，JH：计划审核，OP：调度下单，YA：领料锁定，CL：全部领完，IN：部分领料 */
    @Excel(name = "NA：经营初始，FM：经营申请，JH：计划审核，OP：调度下单，YA：领料锁定，CL：全部领完，IN：部分领料")
    @ApiModelProperty(value = "NA：经营初始，FM：经营申请，JH：计划审核，OP：调度下单，YA：领料锁定，CL：全部领完，IN：部分领料")
    private String statusCode;

    /** 批号状态id（对应数据字典id） */
    @ApiModelProperty(value = "NA：经营初始，FM：经营申请，JH：计划审核，OP：调度下单，YA：领料锁定，CL：全部领完，IN：部分领料")
    private Long lotCodeStatusId;

    /** 批号状态：NA：未生成批号，OK：已生成批号，CL：批号已完工 */
    @Excel(name = "批号状态：NA：未生成批号，OK：已生成批号，CL：批号已完工")
    @ApiModelProperty(value = "批号状态：NA：未生成批号，OK：已生成批号，CL：批号已完工")
    private String lotCodeStatusCode;

    /** 批次类型id（对应数据字典id） */
    @ApiModelProperty(value = "批号状态：NA：未生成批号，OK：已生成批号，CL：批号已完工")
    private Long lotTypeId;

    /** 批次类型：Y：正常,新增批次；G：改料,不增批次；B：补料 */
    @Excel(name = "批次类型：Y：正常,新增批次；G：改料,不增批次；B：补料")
    @ApiModelProperty(value = "批次类型：Y：正常,新增批次；G：改料,不增批次；B：补料")
    private String lotTypeCode;

    /** 生产类型id */
    @ApiModelProperty(value = "批次类型：Y：正常,新增批次；G：改料,不增批次；B：补料")
    private Long productionTypeId;

    /** 生产类型（Y：量产、X：样品、试制S） */
    @Excel(name = "生产类型", readConverterExp = "Y=：量产、X：样品、试制")
    @ApiModelProperty(value = "生产类型")
    private String productionTypeCode;

    /** 领料人id（对应的是sys_user的id） */
    @ApiModelProperty(value = "生产类型")
    private Long materialPickUpPersonId;

    /** 领料人编码 */
    @Excel(name = "领料人编码")
    @ApiModelProperty(value = "领料人编码")
    private String materialPickUpPersonCode;

    /** BOM用量 */
    @Excel(name = "BOM用量")
    @ApiModelProperty(value = "BOM用量")
    private BigDecimal bomQuantity;

    /** 调度员id（对应员工id） */
    @ApiModelProperty(value = "BOM用量")
    private Long dispatcherId;

    /** 调度员编号（对应员工编码） */
    @Excel(name = "调度员编号", readConverterExp = "对=应员工编码")
    @ApiModelProperty(value = "调度员编号")
    private String dispatcherCode;

    /** 炉号 */
    @Excel(name = "炉号")
    @ApiModelProperty(value = "炉号")
    private String furnaceNumber;

    /** 销售员id */
    @ApiModelProperty(value = "炉号")
    private Long salesmanId;

    /** 销售员编码 */
    @Excel(name = "销售员编码")
    @ApiModelProperty(value = "销售员编码")
    private String salesmanCode;

    /** 产品描述 */
    @Excel(name = "产品描述")
    @ApiModelProperty(value = "产品描述")
    private String productDescription;

    /** 轴类型id */
    @ApiModelProperty(value = "轴类型id")
    private Long shaftCategoryId;

    /** 轴类型=基本上=SCLASS */
    @Excel(name = "轴类型=基本上=SCLASS")
    @ApiModelProperty(value = "轴类型=基本上=SCLASS")
    private String shaftCategoryCode;

    /** 轴类型（名称） */
    @Excel(name = "轴类型", readConverterExp = "名=称")
    @ApiModelProperty(value = "轴类型")
    private String shaftCategoryName;

    /** 预完工日 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预完工日", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "预完工日")
    private Date expectedCompletionDate;

    /** 保管员id（对应sys_user的id） */
    @ApiModelProperty(value = "预完工日")
    private Long stockKeeperId;

    /** 保管员编码 */
    @Excel(name = "保管员编码")
    @ApiModelProperty(value = "保管员编码")
    private String stockKeeperCode;

    /** 投料日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "投料日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "投料日期")
    private Date feedDate;

    /** 领料日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "领料日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "领料日期")
    private Date materialPickUpDate;

    /** 总批数 */
    @Excel(name = "总批数")
    @ApiModelProperty(value = "总批数")
    private Integer totalLotNumber;

    /** 单批量 */
    @Excel(name = "单批量")
    @ApiModelProperty(value = "单批量")
    private Integer oneLotQuantity;

    /** 尾批量 */
    @Excel(name = "尾批量")
    @ApiModelProperty(value = "尾批量")
    private Integer lastLotQuantity;

    /** 主批号/投料单号/计划单号 */
    @Excel(name = "主批号/投料单号/计划单号")
    @ApiModelProperty(value = "主批号/投料单号/计划单号")
    private String lotCode;

    /** 订单编码 */
    @Excel(name = "订单编码")
    @ApiModelProperty(value = "订单编码")
    private String saleOrderCode;

    /** 是否外购生产 */
    @Excel(name = "是否外购生产")
    @ApiModelProperty(value = "是否外购生产")
    private String isPurchasedProduction;

    /** 尾批批号流水号 */
    @Excel(name = "尾批批号流水号")
    @ApiModelProperty(value = "尾批批号流水号")
    private String lastLotSerialNumber;

    /** 领料否？ */
    @Excel(name = "领料否？")
    @ApiModelProperty(value = "领料否？")
    private String isPeekedUp;

    /** 有批号否？ */
    @Excel(name = "有批号否？")
    @ApiModelProperty(value = "有批号否？")
    private String hadLotCode;
    /**
     * 下达日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下达日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "下达日期")
    private Date issueDate;

    /************************* 虚拟字段 ***********************/
    @TableField(exist = false)
    private Boolean pullP2PlanDetails;

    @TableField(exist = false)
    private String keywords;

    /** 累计投产量 */
    @TableField(exist = false)
    private Double pickUpQuantity;

    /** 累计投产批数 */
    @TableField(exist = false)
    private Double lotTotalNumber;

    /** 工段id */
    @TableField(exist = false)
    private Long deptId;

    /** dayWorkList */
    @TableField(exist = false)
    private List<BizDaywork> dayWorkList;

    /** 待投产批数 */
    @TableField(exist = false)
    private Integer dayWorkLot;
    /** 投产部门名称 */
    @TableField(exist = false)
    private String requisitionDepartmentName;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date issuanceDate;
    @TableField(exist = false)
    private Long resourceGroupId;

    @TableField(exist = false)
    private String oldTechnologyVersion;
    @TableField(exist = false)
    private Long oldTechnologicalProcessId;




}
