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.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description:
 * @Reference:
 * @Author: wangjie
 * @CreateDate: 2019\11\15 10:12
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_OUT_PUT_STATISTICS_OQC", indexes = {
        @Index(columnList = "WORK_ORDER_NO,SHIFT_CODE,WORK_TIME"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "SHIFT_CODE"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "CHECK_RESULT"),
        @Index(columnList = "PID")
})
@NoArgsConstructor
@AllArgsConstructor
@Api("产量统计出货检验表")
public class MesOutPutStatisticsOqc extends BaseBean implements Serializable {

    private static final long serialVersionUID = -1005784684123711188L;

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

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

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

    @Column(name = "WORK_TIME")
    @ApiParam("作业时间")
    private String workTime;

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

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

    @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 = "CHECK_NO")
    @ApiParam("总检测单号")
    private String checkNo;

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

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

    @Column(name = "CONFIRM_TIME")
    @ApiParam("确认时间")
    private String confirmTime;

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

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

    @Column(name = "PID")
    @ApiParam("产量统计ID")
    public Long pid;

    //----BU二期-------
    @Column(name = "WORK_ORDER_TYPE")
    @ApiParam("工单类型")
    private Integer workOrderType;

}
