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;

/**
 * @Author: xiangming.liao
 * @CreateDate: 2021/02/03 9:35
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_PROJECT_TOUR_DETAIL", indexes = {
        @Index(columnList = "ORDER_NO")
})
@Api("工程巡回确认明细")
public class MesProjectTourDetail extends BaseBean implements Serializable {
    private static final long serialVersionUID = 8391209090086630689L;

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

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

    /**
     * 枚举选择：10=部品、20=工程、30=安全、40=设备、50=其他
     */
    @Column(name = "PROD_CFG_TYPE_CLASSIFY")
    @ApiParam("项目分类")
    private Integer prodCfgTypeClassify;

    @Column(name = "PROD_CFG_TYPE_CODE")
    @ApiParam("项目代码")
    private String prodCfgTypeCode;

    @Column(name = "PROD_CFG_TYPE_NAME")
    @ApiParam("项目名称")
    private String prodCfgTypeName;

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

    @Column(name="ORDER_NO")
    @ApiParam(value ="单据编号")
    private String orderNo;

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

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

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

    @Column(name = "BAD_MAINTAIN_MEASURE")
    @ApiParam("不良维护措施")
    private String badMaintainMeasure;
    /**
     * 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;

    @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 prodCfgTypeClassifyName;

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