package cn.estsh.i3plus.ext.mes.pcn.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/1/29 13:58
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_OQC_CHECK", indexes = {
        @Index(columnList = "ORDER_NO,SHIFT_CODE,WORK_TIME,SERIAL_NUMBER"),
        @Index(columnList = "ORDER_NO,SHIFT_CODE,WORK_TIME,ASSOCIATED_STATUS"),
        @Index(columnList = "WORK_TIME,PART_NO"),
        @Index(columnList = "OQC_NO"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "ORDER_NO")
})
@Api("MES_出货检验单主表")
public class MesOqcCheck extends BaseBean implements Serializable {
    private static final long serialVersionUID = -6692093721002833586L;
    @Column(name = "ORDER_NO")
    @ApiParam("工单号")
    private String orderNo;

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

    @Column(name = "PART_NAME")
    @ApiParam("物料名称")
    private String partName;

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

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

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

    @Column(name = "PLAN_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("计划数量")
    private Double planQty;

    @Column(name = "CHECK_LIMIT", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("已检测范围数量")//下线数量
    private Double checkLimit;

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

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

    @Column(name = "SPOT_CHECK_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("抽检数量")
    private Double spotCheckQty;

    @Column(name = "BATCH_LIMIT", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("批次范围")
    private Double batchLimit;

    @Column(name = "OQC_TYPE")
    @ApiParam("检验类型")
    private Integer oqcType;

    @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 = "ASSOCIATED_STATUS")
    @ApiParam("关联状态")
    private Integer associatedStatus;

    @Column(name = "CATEGORY_CODE3")
    @ApiParam("产品类别")
    private String categoryCode3;

    @Transient
    @ApiParam("包装编号")
    private String packageNo;

}
