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 org.checkerframework.checker.units.qual.Acceleration;

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

/**
 * 报工记录对象 biz_daywork_item
 *
 * @author ezhizao
 * @date 2023-12-04
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "biz_daywork_item")
@Accessors(chain = true)
public class BizDayworkItem extends BaseEntity {
    private static final long serialVersionUID = 1L;

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

    /** daywork的id */
    @ApiModelProperty(value = "${comment}")
    @TableField(value = "daywork_id")
    private Long dayworkId;

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

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

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

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



    /** 批次号 */
    @ApiModelProperty(value = "${comment}")
    private Long lotId;

    /** 载具id */
    @ApiModelProperty(value = "${comment}")
    private Long vehicleId;

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

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

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

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

    /** 设备id */
    @ApiModelProperty(value = "合格数")
    private Long equipmentDetailId;

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

    /** 生产状态0:未开始, 1:生产中 ,2:已完成 */
    @Excel(name = "生产状态0:未开始, 1:生产中 ,2:已完成")
    @ApiModelProperty(value = "生产状态0:未开始, 1:生产中 ,2:已完成")
    private String status;

    /** 用户id */
    private Long userId;
    /** 接收人id */
    @ApiModelProperty(value = "生产状态0:未开始, 1:生产中 ,2:已完成")
    private Long recipientId;

    private Long deptId;

    private String deptName;

    @TableField(exist = false)
    private Long carrierId;
    /** 员工编码 */
    @Excel(name = "员工编码")
    @ApiModelProperty(value = "员工编码")
    private String userName;

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

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    /** 批次号 */
    @TableField(exist = false)
    @ApiModelProperty(value = "${comment}")
    private String lotCode;
    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "报公工时")
    private Long workingHours;

    private Integer rejectNum;

    private String reason;
    /** 前端传来的下一道工序Id */
    @TableField(exist = false)
    private Long processDemoId;

    /** 周转区 */
    private String turnoverArea;

    /** 周转类型 */
    private String turnoverType;

    @TableField(exist = false)
    private BizDaywork daywork;

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


    /** 来源Id */
    @ApiModelProperty(value = "来源Id")
    private Long formDayworkItemId;

    /**下到序 */
    @TableField(exist = false)
    private BizProcess nextProcess;
    /** 载具 */
    @TableField(exist = false)
    private String carrierName;

    /** 产品描述 */
    @TableField(exist = false)
    private String productDescription;

    @TableField(exist = false)
    private BizProcess process;

    /** 查询非周转页面状态 */
    @TableField(exist = false)
    private String userStatus;

    /** 周转区字典*/
    @TableField(exist = false)
    private String dictDataLabel;

    /** 控制周转显示 */
    @TableField(exist = false)
    private String type;
    /** 废品原因 */
//    @TableField(exist = false)
//    private List<BizDayworkItemReject> rejectList;

    /** 上一部门 */
    @TableField(exist = false)
    private String preDeptName;
    /** 废品数*/
//    @TableField(exist = false)
//    private Long rejectSum;

    private Integer prodNum;

    @TableField(exist = false)
    private String processAlias;

    private Long technologicalProcessDetailId;
    @TableField(exist = false)
    private Integer workHoursTimestamp;

    @TableField(exist = false)
    private List<BizDayworkItemReject> groupRejectList;
    /**
     * 临时合格数
     */
    @TableField(exist = false)
    private Integer temporaryProcessQualifiedNum;
    @TableField(exist = false)
    private String flag;
    @TableField(exist = false)
    private Long firstProcessId;

    @TableField(exist = false)
    private String processStepNumber;

    /** 是否是修改 */
    @TableField(exist = false)
    private Integer isAmend;
    /**
     * 是否废品回收
     */
    @TableField(exist = false)
    private Long isWasteRecycling;
    public BizDayworkItem() {}

    public BizDayworkItem(BizDayworkItem copy) {
        this.tenantId = copy.tenantId;
        this.dayworkId = copy.dayworkId;
        this.productionPlanId = copy.productionPlanId;
        this.productionPlanDetailId = copy.productionPlanDetailId;
        this.productionPlanDetailSubDetailId = copy.productionPlanDetailSubDetailId;
        this.productionPlanDetailSubDetailEquipmentId = copy.productionPlanDetailSubDetailEquipmentId;
        this.lotId = copy.lotId;
        this.vehicleId = copy.vehicleId;
        this.qualifiedNum = copy.qualifiedNum;
        this.technologicalProcessId = copy.technologicalProcessId;
        this.processId = copy.processId;
        this.equipmentDetailId = copy.equipmentDetailId;
        this.equipmentDetailCode = copy.equipmentDetailCode;
        this.status = copy.status;
        this.userId = copy.userId;
        this.recipientId = copy.recipientId;
        this.deptId = copy.deptId;
        this.deptName = copy.deptName;
        this.carrierId = copy.carrierId;
        this.userName = copy.userName;
        this.nickName = copy.nickName;
        this.startTime = copy.startTime;
        this.lotCode = copy.lotCode;
        this.endTime = copy.endTime;
        this.workingHours = copy.workingHours;
        this.rejectNum = copy.rejectNum;
        this.reason = copy.reason;
        this.processDemoId = copy.processDemoId;
        this.turnoverArea = copy.turnoverArea;
        this.turnoverType = copy.turnoverType;
        this.daywork = copy.daywork;
        this.processSequence = copy.processSequence;
        this.nextProcess = copy.nextProcess;
        this.carrierName = copy.carrierName;
        this.productDescription = copy.productDescription;
        this.process = copy.process;
        this.userStatus = copy.userStatus;
        this.dictDataLabel = copy.dictDataLabel;
        this.type = copy.type;
        this.preDeptName = copy.preDeptName;
        this.prodNum = copy.prodNum;
        this.processAlias = copy.processAlias;
        this.technologicalProcessDetailId = copy.technologicalProcessDetailId;
        this.workHoursTimestamp = copy.workHoursTimestamp;
        this.groupRejectList = copy.groupRejectList;
        this.temporaryProcessQualifiedNum = copy.temporaryProcessQualifiedNum;
        this.flag = copy.flag;
        this.firstProcessId = copy.firstProcessId;
        this.processStepNumber = copy.processStepNumber;
    }
}
