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;

/**
 * @Description:
 * @Author: xiangming.liao
 * @Date: 2021/03/03 20:03
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_CONSISTENCY_AFFIRM_RECORD", indexes = {
        @Index(columnList = "WORK_ORDER_NO")
})
@Api("MES_一致性确认项目")
public class MesConsistencyAffirmRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = -7151640089437775205L;

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

    @Column(name = "PART_NO")
    @ApiParam(value = "物料编码")
    private String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam("物料名称")
    private String partNameRdd;

    @Column(name = "COMPLETE_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("报工数量")
    private Double completeQty;

    @Column(name = "ORDER_TIME")
    @ApiParam(value = "单据时间")
    private String orderTime;

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

    @Column(name = "ITEM_DESCRIPTION")
    @ApiParam(value = "项目描述")
    private String itemDescription;

    @Column(name = "MEMO")
    @ApiParam("备注")
    private String memo;

    /**
     * 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;

    /**
     * 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"
    )
    private String checkStartTime;
    @Transient
    @ApiParam(
            value = "点检结束日期查询用，查询截至日期",
            example = "2022-01-01 00:00:00"
    )
    private String checkEndTime;

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

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

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

}
