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;

/**
 * @Description:
 * @Author: xinwang.yi
 * @Date: 2022/10/13 13:58
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_BUSI_ERROR_MESSAGE", indexes = {
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "WORK_CELL_CODE"),
        @Index(columnList = "PROCESS_CODE"),
        @Index(columnList = "SERIAL_NUMBER"),
})
@Api("MES_操作报错记录表")
public class MesBusiErrorMessage extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5896249520439434853L;

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

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

    @Column(name = "ITEM_PART_NO")
    @ApiParam("原材料物料编码")
    private String itemPartNo;

    @Column(name = "ITEM_PART_NAME")
    @ApiParam("原材料物料名称")
    private String itemPartName;

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

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

    @Column(name = "WORK_CELL_CODE")
    @ApiParam(value = "工位代码")
    public String workCellCode;

    @Column(name = "PROCESS_CODE")
    @ApiParam("工序代码")
    private String processCode;

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

    @Column(name = "PASSWORD")
    @ApiParam("操作密码")
    private String password;

    @Column(name = "ERROR_STEP_CODE")
    @ApiParam("报错工步代码")
    private String errorStepCode;

    @Column(name = "ERROR_STEP_NAME")
    @ApiParam("报错工步名称")
    private String errorStepName;

    @Lob
    @Column(name = "ERROR_MESSAGE")
    @ApiParam("报错信息")
    private String errorMessage;

    @Column(name = "SCAN_INFO")
    @ApiParam("输入内容")
    private String scanInfo;

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

}
