package cn.estsh.i3plus.ext.mes.pcn.pojo.bean;

import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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.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_WORK_CELL_PRINT_QUEUE", indexes = {
        @Index(columnList = "SERIAL_NUMBER"),
        @Index(columnList = "PACKAGE_NO"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "WORK_CENTER_CODE,WORK_CELL_CODE,PRINT_STATUS"),
        @Index(columnList = "WORK_CENTER_CODE,WORK_CELL_CODE,MODIFY_DATE_TIME")
})
@Api("工位打印队列")
public class MesWorkCellPrintQueue extends BaseBean implements Serializable {

    private static final long serialVersionUID = -6739104726505534879L;

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

    @Column(name = "PACKAGE_NO")
    @ApiParam("包装编号")
    private String packageNo;

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

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

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

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("打印工位")
    private String workCellCode;

    @Column(name = "WORK_CENTER_CODE_SOURCE")
    @ApiParam("来源生产线")
    private String workCenterCodeSource;

    @Column(name = "WORK_CELL_CODE_SOURCE")
    @ApiParam("来源工位")
    private String workCellCodeSource;

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

    @Column(name = "PRINT_TYPE")
    @ApiParam("打印内容类型")
    private Integer printType;

    @Lob
    @Column(name = "PRINT_CONTENT")
    @ApiParam("打印内容")
    private String printContent;

    @Column(name = "PRINT_STATUS")
    @ApiParam("打印状态")
    private Integer printStatus;

    @Column(name = "PRINT_MODE")
    @ApiParam("打印方式")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.PRINT_MODE.class, refForeignKey = "value", value = "description")
    private Integer printMode;

}
