package cn.estsh.i3plus.pojo.mes.pcn.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.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Author: Wynne.Lu
 * @CreateDate: 2019/10/18 1:26 下午
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PACKAGE", indexes = {@Index(columnList = "PACKAGE_NO")
}, uniqueConstraints = {
        @UniqueConstraint(columnNames = {"ORGANIZE_CODE", "PACKAGE_NO"})
    }
)
@Api("包装规格")
public class MesPackage extends BaseBean implements Serializable {
    private static final long serialVersionUID = 2292859018089339608L;
    @Column(name = "PACKAGE_NO", nullable = false)
    @ApiParam("包装编号")
    private String packageNo;

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

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

    @Column(name = "QTY")
    @ApiParam("数量")
    private Double qty;

    @Column(name = "PACK_SPEC_QTY")
    @ApiParam("包装规格数量")
    private Double packSpecQty;

    @Column(name = "UNIT")
    @ApiParam("单位")
    private String unit;

    @Column(name = "LOT_NO")
    @ApiParam("批号")
    private String lotNo;

    @Column(name = "FIX_LOT_NO")
    @ApiParam("特殊批号")
    private String fixLotNo;

    @Column(name = "PACK_SPEC")
    @ApiParam("包装规格")
    private String packSpec;

    @Column(name = "IS_SEALED")
    @ApiParam("是否封箱")
    private Integer isSealed;

    @Column(name = "PRINT_STATUS")
    @ApiParam("打印状态10：未打印 20：已打印")
    private Integer printStatus;

    @Column(name = "PACK_LEVEL")
    @ApiParam("包装层级 1-第一层，2-第二层，3-第三层，4-第四层")
    private Integer packLevel;

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

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode;

    @Column(name = "MEMO")
    @ApiParam("备注")
    private String memo;

    @Column(name = "CUST_CODE")
    @ApiParam("客户代码")
    private String custCode;

    @Transient
    @ApiParam("封箱状态")
    private String sealStatus;

    @Transient
    @ApiParam("打印状态文字")
    private String printStrStatus;

    @Transient
    @ApiParam("打印缓存id")
    private String printId;

    public MesPackage() {
    }

    public MesPackage(String packageNo, String partNo, String partNameRdd, Double qty, Double packSpecQty) {
        this.packageNo = packageNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.qty = qty;
        this.packSpecQty = packSpecQty;
    }
}
