package cn.ezhizao.project.business.domain;

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

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


/**
 * 报工对象 biz_daywork
 *
 * @author ezhizao
 * @date 2023-11-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "biz_daywork")
@Accessors(chain = true)
public class BizDaywork extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /** 租户（厂别）id */
    @ApiModelProperty(value = "${comment}")
    private Long tenantId;
    /** 批次号id */
    @ApiModelProperty(value = "${comment}")
    private Long lotId;
    /** 批次号 */
    @TableField(exist = false)
    @ApiModelProperty(value = "${comment}")
    private String lotCode;

    /** 单批数 */
//    private Integer oneLotQuantity;
    /** 计划单id */
    @ApiModelProperty(value = "${comment}")
    private Long productionPlanId;

    /** 子计划id */
    @ApiModelProperty(value = "${comment}")
    private Long productionPlanDetailSubDetailId;

    /** 计划单明细id */
    @ApiModelProperty(value = "${comment}")
    private Long productionPlanDetailId;

    /** 子计划工序对应的设备id */
//    @ApiModelProperty(value = "${comment}")
//    private Long productionPlanDetailSubDetailEquipmentId;

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

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

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

    /** 设备id */
//    @ApiModelProperty(value = "${comment}")
//    private Long equipmentDetailId;

    /** 设备编码 */
//    @Excel(name = "设备编码")
//    @ApiModelProperty(value = "设备编码")
//    private String equipmentDetailCode;

    /** 用户id */
    @ApiModelProperty(value = "设备编码")
    private Long userId;

    /** 员工编码 */
    @Excel(name = "员工编码")
    @ApiModelProperty(value = "员工编码")
    private String userName;

    /** 员工姓名 */
    @Excel(name = "员工姓名")
    @ApiModelProperty(value = "员工姓名")
    private String nickName;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
    /** 载具 */
    @TableField(exist = false)
    private String carrierName;
    /** 周转中控制状态 */
    @TableField(exist = false)
    private Integer currentStatus;

    private Integer status;

    @TableField(exist = false)
    @ApiModelProperty(value = "生产数量")
    private Integer productionQuantity;

    @TableField(exist = false)
    private List<BizDayworkCarrier> dayworkCarriers;
    /** 炉号 */
    @TableField(exist = false)
    private String furnaceNumber;

    /** 工艺工序顺序 */
    @TableField(exist = false)
    private List<BizProcess> processSequence;

    /** 是否是修改 */
    private Integer isAmend;

    @TableField(exist = false)
    private BizProcess currentProcess;

    @TableField(exist = false)
    private List<BizProcess> prevProcess;

    @TableField(exist = false)
    private List<BizDayworkItem> dayworkItemList;

    private Integer processQualifiedNum;
    /** 单批量 */
    @TableField(exist = false)
    private Integer oneLotQuantity;

    @TableField(exist = false)
    private String productDescription;

    @TableField(exist = false)
    private String productionPlanNo;
    @TableField(exist = false)
    private Long lineNumber;
    @TableField(exist = false)
    private String companyAlias;
    @TableField(exist = false)
    private String technologyVersion;

    private Long deptId;
    @TableField(exist = false)
    private Long totalWorkingHours;
    /**
     * 临时合格数
     */
    private Integer temporaryProcessQualifiedNum;
    /**
     * 是否是尾批
     */
    private Integer isLast;
    @TableField(exist = false)
    private Integer lastLotQuantity;
    /**
     * 工段名
     */
    @TableField(exist = false)
    private String deptName;

    @TableField(exist = false)
    private String processAlias;
    /**
     * 是否回退
     */
    @TableField(exist = false)
    private Long isFallback;
    /**
     * 是否废品回收
     */
    private Long isWasteRecycling;
    /**
     * 母批号
     */
    @TableField(exist = false)
    private String fromCode;
    @TableField(exist = false)
    private Integer isWaste;

    //当前工序
    @TableField(exist = false)
    private Long technologicalProcessDetailId;

    @TableField(exist = false)
    private BizLotWaste lotWaste;
    @TableField(exist = false)
    private BizProduct product;




    @TableField(exist = false)
    private String productShaftCategoryName;


    public BizDaywork() {}


    public BizDaywork(BizDaywork copy) {
        this.tenantId = copy.tenantId;
        this.lotId = copy.lotId;
        this.lotCode = copy.lotCode;
        this.productionPlanId = copy.productionPlanId;
        this.productionPlanDetailSubDetailId = copy.productionPlanDetailSubDetailId;
        this.productionPlanDetailId = copy.productionPlanDetailId;
        this.productId = copy.productId;
        this.technologicalProcessId = copy.technologicalProcessId;
        this.userId = copy.userId;
        this.userName = copy.userName;
        this.nickName = copy.nickName;
        this.startTime = copy.startTime;
        this.endTime = copy.endTime;
        this.carrierName = copy.carrierName;
        this.currentStatus = copy.currentStatus;
        this.status = copy.status;
        this.productionQuantity = copy.productionQuantity;
        this.dayworkCarriers = copy.dayworkCarriers;
        this.furnaceNumber = copy.furnaceNumber;
        this.processSequence = copy.processSequence;
        this.currentProcess = copy.currentProcess;
        this.prevProcess = copy.prevProcess;
        this.dayworkItemList = copy.dayworkItemList;
        this.processQualifiedNum = copy.processQualifiedNum;
        this.oneLotQuantity = copy.oneLotQuantity;
        this.productDescription = copy.productDescription;
        this.productionPlanNo = copy.productionPlanNo;
        this.lineNumber = copy.lineNumber;
        this.companyAlias = copy.companyAlias;
        this.technologyVersion = copy.technologyVersion;
        this.deptId = copy.deptId;
        this.totalWorkingHours = copy.totalWorkingHours;
        this.temporaryProcessQualifiedNum = copy.temporaryProcessQualifiedNum;
        this.isLast = copy.isLast;
        this.lastLotQuantity = copy.lastLotQuantity;
        this.deptName = copy.deptName;
        this.processAlias = copy.processAlias;
        this.isFallback = copy.isFallback;
        this.isWasteRecycling = copy.isWasteRecycling;
        this.fromCode = copy.fromCode;
        this.isWaste = copy.isWaste;
        this.technologicalProcessDetailId = copy.technologicalProcessDetailId;
        this.lotWaste = copy.lotWaste;
        this.product = copy.product;
        this.isAmend = copy.isAmend;
        this.productShaftCategoryName = copy.productShaftCategoryName;
    }
}
