package cn.ezhizao.project.business.domain;

import java.math.BigDecimal;
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_process
 *
 * @author 庄德政
 * date    2024-04-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "biz_outsourced_order_detail_process")
public class BizOutsourcedOrderDetailProcess extends BaseEntity
{
    private static final long serialVersionUID = 1L;

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

    /** 明细id */
    @Excel(name = "明细id")
    @ApiModelProperty(value = "明细id")
    private Long detailId;

    /** 主表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;

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

    /** 结算方式 */
    @Excel(name = "结算方式")
    @ApiModelProperty(value = "0：无结算方式；1：按支结算；2：按炉结算")
    private String settlementType;

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

    /** 批次id */
    @ApiModelProperty(value = "批次id")
    private Long lotId;

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

    /** 报工主表id */
    @ApiModelProperty(value = "报工主表id")
    private Long dayworkId;

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

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

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

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

    /** 工序id */
    @ApiModelProperty(value = "工序id")
    private Long processId;

    /** 工序简称 */
    @Excel(name = "工序简称")
    @ApiModelProperty(value = "工序简称")
    private String processAlias;

    /** 工序序号 */
    @Excel(name = "工序序号")
    @ApiModelProperty(value = "=seq1(2位)+seq2(1位)+0(第4位用于单批单改)")
    private String processStepNumber;

    /** 批次产品数 */
    @ApiModelProperty(value = "批次产品数")
    private Integer productNum;
    /** 料损 */
    @ApiModelProperty(value = "料损")
    private BigDecimal loss;


    /** 投产数 */
    @ApiModelProperty(value = "投产数")
    private Integer productionNum;

    /** 合格数 */
    @ApiModelProperty(value = "合格数")
    private Integer qualifiedNum;

    @TableField(exist = false)
    private BigDecimal lossLimit;
    @TableField(exist = false)
    private Integer auditNum;
    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String endTime;
    private String processCode;
    private Long technologicalProcessDetailId;
    private Integer status;
    @TableField(exist = false)
    private String newCarrier;
    @TableField(exist = false)
    private String originalCarrier;
    @TableField(exist = false)
    private Integer receiptNum;
    @TableField(exist = false)
    private List<BizReturnReceiptDetail> returnReceiptDetails;
    @TableField(exist = false)
    private Integer returnStatus;
    @TableField(exist = false)
    private List<Long> hasReturnDetailId;
    @TableField(exist = false)
    private String newCarrierName;
    @TableField(exist = false)
    private Integer isFirstProcess;

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