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/7/30 9:30 AM
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_PRODUCT_DATA_REVIEW_RECORD", indexes = {
        @Index(columnList = "WORK_ORDER_NO, SERIAL_NUMBER"),
        @Index(columnList = "GROUP_NO"),
        @Index(columnList = "LAST_REVIEW_RESULT")
})
@Api("采集数据复核记录")
public class MesProductDataReviewRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = 5448478487619154620L;

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

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

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

    @Column(name = "GROUP_NO")
    @ApiParam("匹配值")
    public String groupNo;

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

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

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

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工作单元代码")
    private String workCellCode;

    @Column(name = "REVIEW_RESULT")
    @ApiParam("工位复核结果")
    private Integer reviewResult;

    @Column(name = "LAST_REVIEW_RESULT")
    @ApiParam("最终结果")
    private Integer lastReviewResult;

    @Column(name = "REVIEW_TIMES")
    @ApiParam("复核次数")
    private Integer reviewTimes;

    @Lob
    @Column(name = "REVIEW_DATA")
    @ApiParam("工位复核结果数据")
    private String reviewData;

    @Lob
    @Column(name = "LAST_REVIEW_DATA")
    @ApiParam("工位复核结果数据")
    private String lastReviewData;

}
