package cn.estsh.i3plus.ext.mes.pojo.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Description:
 * @Author: xiangming.liao
 * @Date: 2021/02/04 17:44
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PERSON_CHECK_DETAIL", indexes = {
        @Index(columnList = "WORK_ORDER_NO")
})
@Api("MES_人员点检明细")
public class MesPersonCheckDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 5664157509485405925L;

    @Column(name = "WORK_ORDER_NO")
    @ApiParam("生产工单号")
    private String workOrderNo;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam(value = "工作单元代码")
    public String workCellCode;

    @Column(name = "PROCESS_CODE")
    @ApiParam("工序代码")
    private String processCode;

    @Column(name = "PROCESS_NAME")
    @ApiParam("工序名称")
    private String processName;

    @Column(name = "SHIFT_CODE")
    @ApiParam("班次")
    private String shiftCode;

    @Column(name = "TASK_USER")
    @ApiParam("作业人员")
    private String taskUser;

    @Column(name = "CHECK_INFO")
    @ApiParam("点检信息")
    private String checkInfo;

    /**
     * OK显示O，NG显示X
     */
    @Column(name = "CHECK_RESULT")
    @ApiParam("点检结果")
    private String checkResult;

    @Column(name="ORDER_STATUS")
    @ApiParam(value ="单据状态")
    private Integer orderStatus;

    /**
     * 根据编码规则产生
     */
    @Column(name="ORDER_NO")
    @ApiParam(value ="单据编号")
    private String orderNo;

    @Column(name = "ORDER_DATE")
    @ApiParam("单据日期")
    private String orderDate;

    @Column(name = "CHECK_USER")
    @ApiParam("点检人员")
    private String checkUser;

    @Column(name = "CHECK_TIME")
    @ApiParam("点检时间")
    private String checkTime;

    /**
     * 10=是，20=否
     */
    @Column(name = "SHIFT_GROUP_CHECK")
    @ApiParam("班组确认")
    private Integer shiftGroupCheck;

    @Column(name = "SHIFT_GROUP_CHECK_USER")
    @ApiParam("班组确认人")
    private String shiftGroupCheckUser;

    @Column(name = "SHIFT_GROUP_CHECK_TIME")
    @ApiParam("班组确认时间")
    private String shiftGroupCheckTime;

    /**
     * 10=是，20=否
     */
    @Column(name = "QUALITY_CHECK")
    @ApiParam("品质确认")
    private Integer qualityCheck;

    @Column(name = "QUALITY_CHECK_USER")
    @ApiParam("品质确认人")
    private String qualityCheckUser;

    @Column(name = "QUALITY_CHECK_TIME")
    @ApiParam("品质确认时间")
    private String qualityCheckTime;

    @Column(name = "WORK_LICENSE_CODE")
    @ApiParam("上岗证编码")
    private String workLicenseCode;

    @Column(name = "WORK_LICENSE_VALIDITY_DATE")
    @ApiParam("上岗证有效期")
    private String workLicenseValidityDate;

    @Column(name = "REMARK")
    @ApiParam("备注")
    private String remark;

    @Transient
    @ApiParam(
            value = "点检开始日期查询用，查询截至日期",
            example = "2021-01-01 00:00:00"
    )
    public String checkStartTime;
    @Transient
    @ApiParam(
            value = "点检结束日期查询用，查询截至日期",
            example = "2022-01-01 00:00:00"
    )
    public String checkEndTime;

    @Transient
    @ApiParam(value = "班组确认名称")
    public String shiftGroupCheckName;

    @Transient
    @ApiParam(value = "品质确认名称")
    public String qualityCheckName;

    @Transient
    @ApiParam("点检结果名称")
    private String checkResultName;
}
