package com.sw.mes.fb.turnstore.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Data
@Entity
@Table(name = "fb_turnstore_tray")
@DynamicUpdate
@DynamicInsert
public class FbTurnstoreTray {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 托号
     */
    @Column(length = 50)
    private String trayNo;

    /**
     * 打托类型【0：默认，正常拖；1：是，非正常拖；】
     */
    @Column(length = 12)
    private String palletType;

    /**
     * 厂区
     */
    @Column(length = 50)
    private String factoryName;

    /**
     * 方棒产品等级
     */
    @Column(length = 40)
    private String productLevelSecond;

    /**
     * 单晶总数
     */
    @Column(length = 10)
    private Integer count;

    /**
     * 组托状态【满托；未满托】
     */
    @Column(length = 12)
    private String status;

    /**
     * 去向
     */
    @Column(length = 40)
    private String hasGone;

    /**
     * 0：待出库
     * 1：已入库
     * 2：待入库
     * 3：拒收
     * 4：取消（冲销）
     * 0：待出库 -->发起入库 --> 2：待入库    接收：1 已入库  3：拒收（方棒更新到加工中，方棒状态到检验进展）
     */
    @Column(length = 3)
    private Integer state;

    /**
     * 是否可取消标识【1：可取消，0：不可取消】
     */
    @Column(length = 3)
    private Integer flag;

    /**
     * 操作人
     */
    @Column(length = 80)
    private String user;

    /**
     * 更新人
     */
    @Column(length = 50)
    private String updateUser;

    /**
     * 操作时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date operationTime;

    /**
     * 备注
     */
    @Column(length = 50)
    private String remark;

    /**
     * 拼数
     */
    @Column(length = 32)
    private String sticksCount;

    /**
     * 打印时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date printTime;

    /**
     * 组托时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date time;

    /**
     * 是否出库到WMS 0否 1是
     */
    @Column(length = 10)
    private Integer isToWms;

    /**
     * 出库到WMS时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date toWmsTime;

    /**
     * 顺序号
     */
    @Column(length = 10)
    private Integer orderNum;

    /**
     * 打托工位
     */
    @Column(length = 100)
    private String station;

    /**
     * 规格
     */
    @Column(length = 100)
    private String specs;

    /**
     * 实验等级
     */
    @Column(length = 100)
    private String experGrade;

    /**
     * 确认时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date confirmTime;

    /**
     * 报工时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date reportingTime;

	/**
	 * 确认人
	 */
	@Column(length = 19)
	private String confirmUser;

    /**
     * 班次 新增
     */
    @Column(length = 40)
    private String classNo;

    /**
     * 班组　新增
     */
    @Column(length = 40)
    private String className;


    /**
     * 客户　新增
     */
    @Column(length = 100)
    private String customer;

    /**
     * 试验
     */
    @Column(length = 150)
    private String testZt;


    /**
     * 打印标志
     */
    @Column(length = 150)
    private String printBz;


    /**
     * 配棒规则识别码
     */
    @Column(length = 150)
    private String identifyingCode;

    /**
     * 配棒规则识别名称
     */
    @Column(length = 200)
    private String identifyingName;

    /**
     * 对照边距
     */
    @Column(length = 150)
    private String borderWidth;

    /**
     * 扣减规则
     */
    @Column(length = 150)
    private String deductRule;

    /**
     * 边宽范围
     */
    @Column(length = 150)
    private String borderWidthValue;

    /**
     * 边宽key
     */
    @Column(length = 150)
    private String borderWidthKey;

    /**
     * ERP上报状态，0 未上报，1 已上报
     */
    @Column(length = 3)
    private Integer reportedState = 0;

    /**
     * ERP订单编号
     */
    @Column(length = 30)
    private String erpOrder;

    @ApiModelProperty("erp上报时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date erpTime;

    /**
     * 组托规则Id
     */
    @Column(length = 100)
    private Integer ruleId;

    /**
     * mes入库单号
     */
    @Column
    private String warehouseEntryNumber;

    /**
     * wms审核结果
     */
    @Column(columnDefinition = "json")
    private String wmsAuditResult;
    
    
    @Column
    private String levelCode;
    /**
     * 直发或者外发【0直发，1外发】
     */
    Integer directOrOutgoing;

    public FbTurnstoreTray() {
    }

    public FbTurnstoreTray(Integer id) {
		this.id = id;
	}
}
