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

import cn.estsh.i3plus.pojo.mes.bean.MesProduceSnTravel;
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
 * @version 1.0
 * @date 2021/1/12 15:58
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PRODUCE_SN_TRAVEL_EXT", indexes = {
        @Index(columnList = "SYSTEM_SYNC_STATUS_EXT"),
        @Index(columnList = "ORGANIZE_CODE_EXT"),
        @Index(columnList = "CREATE_DATE_TIME_EXT"),
        @Index(columnList = "MODIFY_DATE_TIME_EXT")
})
@PrimaryKeyJoinColumn(name = "PID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Api("条码履历表拓展")
public class MesProduceSnTravelExt extends MesProduceSnTravel implements Serializable {

    private static final long serialVersionUID = -5779722357836321261L;

    @Column(name = "QUALITY_ASSURE_TEMPLATE")
    @ApiParam("质保书标签模板")
    private String qualityAssureTemplate;

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

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

    @Column(name = "LAST_WORK_ORDER_NO")
    @ApiParam("最终工单号")
    private String lastWorkOrderNo;

    //EP专用
    @Column(name = "PART_LOT_NO")
    @ApiParam("成品批次号")
    public String partLotNo;

    @Column(name = "SEQ_NO")
    @ApiParam("条码流水号")
    public String seqNo;

    @Column(name = "SN_WITHOUT_SEQ_NO")
    @ApiParam("条码流水号以外的条码信息")
    public String snWithoutSeqNo;

    @Column(name="ORGANIZE_CODE_EXT")
    @ApiParam(value ="组织代码")
    public String organizeCodeExt;

    @Column(name="IS_VALID_EXT")
    @ApiParam(value = "有效性")
    public Integer isValidExt;

    @Column(name="IS_DELETED_EXT")
    @ApiParam(value = "是否已删除")
    public Integer isDeletedExt;

    @Column(name="CREATE_USER_EXT")
    @ApiParam(value = "创建用户")
    public String createUserExt;

    @Column(name="CREATE_DATE_TIME_EXT")
    @ApiParam(value = "创建日期")
    public String createDatetimeExt;

    @Column(name="MODIFY_USER_EXT")
    @ApiParam(value = "修改人")
    public String modifyUserExt;

    @Column(name="MODIFY_DATE_TIME_EXT")
    @ApiParam(value = "修改日期")
    public String modifyDatetimeExt;

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

}
