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: wangjie
 * @CreateDate: 2019/12/4 1:28 下午
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_OQC_CHECK_PACKAGE_DETAIL", indexes = {
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "OQC_NO"),
        @Index(columnList = "SERIAL_NUMBER"),
        @Index(columnList = "PACKAGE_NO"),
        @Index(columnList = "WORK_ORDER_NO, WORK_TIME"),
        @Index(columnList = "WORK_ORDER_NO, WORK_TIME, SHIFT_CODE"),
        @Index(columnList = "WORK_ORDER_NO, PART_NO"),
        @Index(columnList = "PACKAGE_NO, PART_NO"),
        @Index(columnList = "OUT_WC_TIME"),
        @Index(columnList = "WORK_ORDER_NO, OUT_WC_TIME")
})
@Api("出货检验单据条码关联表")
public class MesOqcCheckPackageDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = -8372144807733785843L;

    @Column(name = "OQC_NO")
    @ApiParam("检验单号")
    private String oqcNo;

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

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("生产线")
    private String workCenterCode;

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

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

    @Column(name = "WORK_TIME")
    @ApiParam("生产日期")
    private String workTime;

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

    @Column(name = "PRODUCT_SN")
    @ApiParam("产品条码")
    private String productSn;

    @Column(name = "SERIAL_NUMBER")
    @ApiParam("过程条码")
    private String serialNumber;

    @Column(name = "PACKAGE_NO")
    @ApiParam("包装编号")
    private String packageNo;

    @Column(name = "CHECK_RESULT")
    @ApiParam("检验结果")
    private Integer checkResult;

    @Column(name = "NOTE_CHECK_RESULT")
    @ApiParam("停止指示书检验结果")
    private Integer noteCheckResult;

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

    @Column(name = "OQC_TYPE")
    @ApiParam("检测方式")
    private Integer oqcType;

    @Column(name = "OUT_WC_TIME")
    @ApiParam("出产线时间")
    private String outWorkCenterTime;

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