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

import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
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.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author wangjie
 * @version 1.0
 * @date 2021/1/12 15:58
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_REWORK_ORDER_BIND_SN_TRAVEL", indexes = {
        @Index(columnList = "PRODUCT_SN")
})
@Api("产品条码绑定返工工单履历表")
public class MesReworkOrderBindSnTravel extends BaseBean implements Serializable {

    private static final long serialVersionUID = 8704066321134347283L;

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

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

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

    @Column(name = "WORK_CENTER_NAME")
    @ApiParam("产线名称")
    private String workCenterName;

    /** 绑定状态 10表示绑定 20表示未绑定*/
    @Column(name = "BIND_STATUS")
    @ApiParam("绑定状态")
    @AnnoOutputColumn(refClass = MesExtEnumUtil.BIND_STATUS.class, refForeignKey = "value", value = "description")
    private Integer bindStatus;

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