package cn.ezhizao.project.business.domain;

import java.util.Date;
import java.util.List;

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

/**
 * 外协单从对象 biz_outsourced_order_detail
 *
 * @author 庄德政
 * date    2024-04-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "biz_outsourced_order_detail")
public class BizOutsourcedOrderDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

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

    /** 单据号 */
    @Excel(name = "单据号")
    @ApiModelProperty(value = "单据号")
    private String formCode;

    @Excel(name = "主表id")
    @ApiModelProperty(value = "主表id")
    private Long masterId;


    private String  productCode;

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

    /** 外协商id */
    @ApiModelProperty(value = "表单日期")
    private Long supplierId;

    /** 外协商名称 */
    @Excel(name = "外协商名称")
    @ApiModelProperty(value = "外协商名称")
    private String supplierName;

    private String supplierCode;

    /** 0：自提；1：物流 */
    @Excel(name = "0：自提；1：物流")
    @ApiModelProperty(value = "0：自提；1：物流")
    private String deliveryMethod;

    /** 带箱方式：0：原箱；1：新箱 */
    @Excel(name = "带箱方式：0：原箱；1：新箱")
    @ApiModelProperty(value = "带箱方式：0：原箱；1：新箱")
    private String packagingMethod;

    /** 批次id */
    @ApiModelProperty(value = "带箱方式：0：原箱；1：新箱")
    private Long lotId;

    /** 批次号 */
    @Excel(name = "批次号")
    @ApiModelProperty(value = "批次号")
    private String lotCode;

    /** 报工主表id */
    @ApiModelProperty(value = "带箱方式：0：原箱；1：新箱")
    private Long dayworkId;

    /** 产品id */
    @ApiModelProperty(value = "带箱方式：0：原箱；1：新箱")
    private Long productId;

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

    /** 工艺id（通过工艺id，获取版本号） */
    @ApiModelProperty(value = "产品描述")
    private Long technologicalProcessId;

    /** 工艺版本A,B,C */
    @Excel(name = "工艺版本A,B,C")
    @ApiModelProperty(value = "工艺版本A,B,C")
    private String technologyVersion;

    /** 原箱号，以英文“,”分割 */
    @Excel(name = "原箱号，以英文“,”分割")
    @ApiModelProperty(value = "原箱号，以英文“,”分割")
    private String originalCarrier;

    /** 原箱数 */
    @Excel(name = "原箱数")
    @ApiModelProperty(value = "原箱数")
    private Integer originalCarrierCount;

    /** 新箱号，以英文“,”分割 */
    @Excel(name = "新箱号，以英文“,”分割")
    @ApiModelProperty(value = "新箱号，以英文“,”分割")
    private String newCarrier;

    @ApiModelProperty("新箱号")
    private String newCarrierName;

    /** 新箱数 */
    @Excel(name = "新箱数")
    @ApiModelProperty(value = "新箱数")
    private Integer newCarrierCount;

    @TableField(exist = false)
    private List<BizCarrier>  newCarriers;

    @TableField(exist = false)
    private List<Long>  carrierIds;

    /** 外协工序名称字符串，以英文逗号分割 **/
    private String  processNames;
    @TableField(exist = false)
    private Integer carrierNum;

    /** 对应的产品对应的工序明细 **/
    @TableField(exist = false)
    private List<BizOutsourcedOrderDetailProcess> processes;
    @TableField(exist = false)
    private List<BizOutsourcedOrderDetailProcess> finishedProcesses;
    /** 已经被选中的外协明细id集合 **/
    @TableField(exist = false)
    private List<Long> existingOutsourceDetailIds;
    /** 未完成的外协明细id集合 **/
    @TableField(exist = false)
    private List<Long> notFinishedDetailIds;
    /** 未完成的外协明细id集合 **/
    @TableField(exist = false)
    private List<Long> alreadyAddedDetailIds;
    @TableField(exist = false)
    private Integer receiptNum;
    private String productionCarrier;
    private Long productionDeptId;
    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String endTime;
    @TableField(exist = false)
    private Integer auditNum;
    @TableField(exist = false)
    private Boolean flag;
    @TableField(exist = false)
    private List<BizDayworkCarrier> dayworkCarrierList;
    @TableField(exist = false)
    private List<BizCarrier> carriers;
    @TableField(exist = false)
    private String productionDeptName;
    private String remark;
    @TableField(exist = false)
    private List<BizReturnReceiptDetail> returnReceiptDetailList;

    //发出总数量 只在打印时用到
    @TableField(exist = false)
    private Integer sum;
    // 批次类型 正常/单批单改/废品回用
    @TableField(exist = false)
    private Integer isAmend;
    @TableField(exist = false)
    private Integer isWasteRecycling;
    @TableField(exist = false)
    private Integer isSuperaddition;
    @TableField(exist = false)
    private Integer isWaste;
    @TableField(exist = false)
    private String statusValue;
    @TableField(exist = false)
    private List<Long> flags;
    @TableField(exist = false)
    private List<BizOutsourcedOrderDetail> batches;
    @TableField(exist = false)
    private List<BizProductionPlanDetail> planDetails;

    @ApiModelProperty(value = "投料/计划单号")
    private String productionPlanNo;
    @ApiModelProperty(value = "序号")
    private Integer lineNumber;
    /** 计划单明细id */
    @ApiModelProperty(value = "${comment}")
    private Long productionPlanDetailId;

    @ApiModelProperty("炉号信息")
    @TableField(exist = false)
    private BizFurnaceNoInfo furnaceNoInfo;

    @ApiModelProperty("炉号")
    @TableField(exist = false)
    private String furnaceNumber;
    @ApiModelProperty("结算方式")
    private String settlementType;
    @TableField(exist = false)
    private Long deptId;
    @TableField(exist = false)
    private Long dayworkItemId;
    @TableField(exist = false)
    private Long technologicalProcessDetailId;
    @TableField(exist = false)
    private Integer isSortPackaging;
    @TableField(exist = false)
    private Integer inspectionStatus;
    @TableField(exist = false)
    private String returnFormCode;
    @TableField(exist = false)
    private String processAlias;
    @TableField(exist = false)
    private Long processId;
    @TableField(exist = false)
    private Long outsourceDeptId;
    @TableField(exist = false)
    private String outsourceDeptName;
    @TableField(exist = false)
    private Integer isPackage;
    @TableField(exist = false)
    private Boolean hasNextInfo;
    @TableField(exist = false)
    private String carrierNames;
    @TableField(exist = false)
    private Boolean hasIsNoneCarrier;
    @TableField(exist = false)
    @ApiModelProperty("加工类型")
    private String planType;


    public BizOutsourcedOrderDetail() {
        super();
    }

    public BizOutsourcedOrderDetail(BizOutsourcedOrderDetail copy) {
        this.tenantId = copy.tenantId;
        this.formCode = copy.formCode;
        this.masterId = copy.masterId;
        this.productCode = copy.productCode;
        this.formDate = copy.formDate;
        this.supplierId = copy.supplierId;
        this.supplierName = copy.supplierName;
        this.supplierCode = copy.supplierCode;
        this.deliveryMethod = copy.deliveryMethod;
        this.packagingMethod = copy.packagingMethod;
        this.lotId = copy.lotId;
        this.lotCode = copy.lotCode;
        this.dayworkId = copy.dayworkId;
        this.productId = copy.productId;
        this.productNum = copy.productNum;
        this.productDescription = copy.productDescription;
        this.technologicalProcessId = copy.technologicalProcessId;
        this.technologyVersion = copy.technologyVersion;
        this.originalCarrier = copy.originalCarrier;
        this.originalCarrierCount = copy.originalCarrierCount;
        this.newCarrier = copy.newCarrier;
        this.newCarrierName = copy.newCarrierName;
        this.newCarrierCount = copy.newCarrierCount;
        this.carrierNum = copy.carrierNum;
        this.receiptNum = copy.receiptNum;
        this.productionCarrier = copy.productionCarrier;
        this.productionDeptId = copy.productionDeptId;
        this.startTime = copy.startTime;
        this.endTime = copy.endTime;
        this.auditNum = copy.auditNum;
        this.flag = copy.flag;
        this.productionDeptName = copy.productionDeptName;
        this.remark = copy.remark;
        this.sum = copy.sum;
        this.isAmend = copy.isAmend;
        this.isWasteRecycling = copy.isWasteRecycling;
        this.isWaste = copy.isWaste;
        this.statusValue = copy.statusValue;
        this.productionPlanNo = copy.productionPlanNo;
        this.lineNumber = copy.lineNumber;
        this.productionPlanDetailId = copy.productionPlanDetailId;
        this.furnaceNoInfo = copy.furnaceNoInfo;
        this.settlementType = copy.settlementType;
    }

}
