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;

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

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

    /** 表单日期 */
    @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;

    /** 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 String productCode;

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

    /** 产品数量 */
    @ApiModelProperty(value = "产品数量")
    private Integer productNum;

    /** 工艺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;

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

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

    /** 已经被选中的外协明细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 List<BizOutsourcedOrderDetailProcess> processes;
    @TableField(exist = false)
    private Integer receiptNum;
    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String endTime;

    @TableField(exist = false)
    private List<BizOutsourcedOrderDetailProcess> outsourcedOrderDetailProcessList;
    @TableField(exist = false)
    private List<BizReturnReceiptDetail> returnReceiptDetailList;

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

    @ApiModelProperty("新箱号")
    private String newCarrierName;
    @TableField(exist = false)
    private Long detailId;

    @TableField(exist = false)
    private String furnaceNumber;
    @TableField(exist = false)
    private Integer isInnerOutsource;
    @TableField(exist = false)
    @ApiModelProperty("是否解绑")
    private Integer unbind;
    @TableField(exist = false)
    private String currentCarriers;
    /** 计划单明细id */
    @ApiModelProperty(value = "${comment}")
    private Long productionPlanDetailId;
}
