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_PRODUCE_SN_REPAIR", indexes = {
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "SERIAL_NUMBER"),
        @Index(columnList = "PRODUCT_SN"),
        @Index(columnList = "SERIAL_NUMBER,WORK_ORDER_NO"),
        @Index(columnList = "WORK_ORDER_NO, WORK_TIME, SHIFT_CODE")
})
@Api("条码返工表")
public class MesProduceSnRepair extends BaseBean implements Serializable {

    private static final long serialVersionUID = -4386485113851720695L;

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

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

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

    @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 = "WORK_ORDER_NO")
    @ApiParam("返工工单号")
    private String workOrderNo;

    @Column(name = "INIT_WORK_ORDER_NO")
    @ApiParam("初始工单号")
    private String initWorkOrderNo;

    @Column(name = "SN_TYPE")
    @ApiParam("条码类型")
    private Integer snType;

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

    @Column(name = "LOT_NO")
    @ApiParam("生产批次")
    private String lotNo;

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

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

    @Column(name = "CT_NO")
    @ApiParam("容器编码")
    private String ctNo;

}
