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.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @author yumingxing
 * @version 1.0
 * @date 2021/2/2 13:23
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_EQUIPMENT_CHECK_DETAIL", indexes = {
        @Index(columnList = "ORDER_JOB_NO"),
        @Index(columnList = "WORK_CENTER_CODE")
})
@Api("MES_设备点检")
public class MesEquipmentCheckDetail extends BaseBean implements Serializable {
    private static final long serialVersionUID = 4854127389456124072L;

    @Column(name = "SYSTEM_SYNC_STATUS")
    @ColumnDefault("2")
    @ApiParam(value = "系统同步标志")
    public Integer systemSyncStatus = 2;

    @Column(name = "SYNC_STATUS")
    @ColumnDefault("1")
    @ApiParam(value = "bu系统同步标志")
    public Integer syncStatus = 1;

    @Column(name = "ORDER_JOB_NO")
    @ApiParam("单据编号")
    private String orderJobNo;

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

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

    @Column(name = "WORK_CELL_NAME")
    @ApiParam("工位名称")
    private String workCellName;

    @Column(name = "EQU_NO")
    @ApiParam("设备编号")
    private String equNo;

    @Column(name = "EQU_MANAGE_NO")
    @ApiParam("设备管理号")
    private String equManageNo;

    @Column(name = "EQU_NAME")
    @ApiParam("设备名称")
    private String equName;

    @Column(name = "PROJECT_CONTENT")
    @ApiParam("项目内容")
    private String projectContent;

    @Lob
    @Column(name = "CHECK_METHOD")
    @ApiParam("点检方法")
    private String checkMethod;

    @Column(name = "CHECK_TYPE")
    @ApiParam("点检周期")
    private String checkType;

    @Column(name = "CHECK_Result")
    @ApiParam("点检结果")
    private Integer checkResult;

    @Column(name = "SPOT_CHECK_USER")
    @ApiParam("点检人员")
    private String spotCheckUser;

    @Column(name = "SPOT_CHECK_TIME")
    @ApiParam("点检时间")
    private String spotCheckTime;

    @Transient
    @ApiParam("点检日期")
    private String spotCheckDate;

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

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

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

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

    @Column(name = "IS_TEAM_CONFIRM")
    @ApiParam("是否班组确认")
    private Integer isTeamConfirm = 20;

    @Column(name = "IS_QUALITY_CONFIRM")
    @ApiParam("是否品质确认")
    private Integer isQualityConfirm = 20;

    @Column(name = "SHIFT_CODE")
    @ApiParam(value = "班次编号")
    public String shiftCode;

    @Column(name = "remark")
    @ApiParam(value = "备注")
    public String remark;

    @Column(name = "UP_LIMIT")
    @ApiParam("上限值")
    private String upLimit;

    @Column(name = "DOWN_LIMT")
    @ApiParam("下限值")
    private String downLimit;

    @Column(name = "RESULT_VALUE")
    @ApiParam("结果值")
    private String resultValue;

    @Column(name = "PROBE_NO")
    @ApiParam("探头号")
    private String probeNo;

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

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

    @Transient
    @ApiParam("点检类型名称")
    private String checkTypeName;

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

}
