package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
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 javax.persistence.Transient;

/**
 * @Description : 移库单条码表
 * @Reference :
 * @Author : hansen.ke
 * @CreateDate : 2018-11-28 15:20
 * @Modify:
 *  2018-12-10 10:39:46 Test
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="WMS_DOC_MOVEMENT_SN", indexes = {
        @Index(columnList = "ORDER_NO"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "SN"),
        @Index(columnList = "ORGANIZE_CODE")
})
@Api("移库条码信息")
public class WmsDocMovementSn extends BaseBean {

    private static final long serialVersionUID = 5704546384179442907L;
    @Column(name="ORDER_NO")
    @ApiParam("订单号")
    public String orderNo;

    @Column(name="ITEM")
    @ApiParam("行号")
    public String item;

    @Column(name="PART_NO")
    @ApiParam("物料编码")
    public String partNo;

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

    @Column(name="QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "数量", example = "0")
    public Double qty;


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

    /**
     * 状态：操作状态  itemStatus
     */
    @Column(name="SN_STATUS")
    @ApiParam(value = "操作状态", example = "10")
    @AnnoOutputColumn(refClass = WmsEnumUtil.ORDER_SN_STATUS.class,refForeignKey = "value",value = "description")
    public Integer snStatus;

    @Column(name="SN")
    @ApiParam("条码")
    public String sn;

    @Column(name = "VENDOR_NO")
    @ApiParam(value = "供应商编码")
    public String vendorNo;

    @Column(name = "WORK_ORDER_CODE")
    @ApiParam(value = "工单码")
    private String workOrderCode;

    private String seqNo;

    @Column(name = "SN_TYPE")
    @ApiParam(value = "条码类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.WMS_STOCK_TYPE.class, refForeignKey = "value", value = "description")
    private Integer snType;

    @Column(name = "DEST_LOCATE_NO")
    @ApiParam(value = "目标库位代码")
    public String destLocateNo;


    @Transient
    @ApiParam("前端表格编辑使用")
    private Boolean isSet = false;


    @Transient
    @ApiParam("源库位代码")
    public String srcLocateNo;

    @Transient
    @ApiParam("生产日期")
    public String dateCode;

    @ApiParam(value = "散件移库输入移库数量")
    @Transient
    public Double inputMoveQty;

    @Transient
    @ApiParam("计划交货日期")
    private String planDate;

    @Transient
    @ApiParam("计划交货时间")
    private String planTime;

    @Transient
    @ApiParam("ERP库存地")
    private String erpWhNo;

    @Transient
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class,refForeignKey = "value",value = "description")
    public Integer itemStatus;

    @Transient
    @ApiParam("客户零件号")
    private String customerPartNo;

    @Transient
    @ApiParam("父层级packcode对应的可回用零件号")
    private String parentReturnPart;

    @Transient
    @ApiParam("打印模板")
    private String templateNo;

    @Transient
    @ApiParam("剩余箱数量")
    private Long countBox;

    @Transient
    private String dockcode;

    @Transient
    private String storagelocation;

    @Transient
    private String requerimentCode;

    @Transient
    @ApiParam(value = "客户编号")
    private String custNo;

    @Transient
    @ApiParam("汇总数量")
    private Double sumQty;

    @Transient
    @ApiParam(value = "送货批号")
    public String lotNo;

    @Transient
    @ApiParam("仓库")
    private String whNo;

    @Transient
    @ApiParam("源仓库")
    private String srcWhNo;

    @Transient
    @ApiParam(value = "ERP单号")
    private String erpSrcNo;

    @Transient
    @ApiParam(value = "版本")
    private Integer version;

    public WmsDocMovementSn(){}

    public WmsDocMovementSn(Long countBox,String partNo) {
        this.countBox = countBox;
        this.partNo = partNo;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String custNo,String partNameRdd,
                            String whNo,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.custNo = custNo;
        this.partNameRdd = partNameRdd;
        this.whNo = whNo;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String custNo,String partNameRdd,
                            String whNo,String erpSrcNo,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.custNo = custNo;
        this.partNameRdd = partNameRdd;
        this.whNo = whNo;
        this.erpSrcNo = erpSrcNo;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String custNo,String partNameRdd,
                            String whNo,String erpSrcNo,Integer version,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.custNo = custNo;
        this.partNameRdd = partNameRdd;
        this.whNo = whNo;
        this.erpSrcNo = erpSrcNo;
        this.version = version;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,
                            String whNo,String erpSrcNo,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.whNo = whNo;
        this.erpSrcNo = erpSrcNo;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String partNameRdd,
                            Integer version,String whNo,String custNo,
                            String erpSrcNo,String planDate,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.partNameRdd = partNameRdd;
        this.version = version;
        this.whNo = whNo;
        this.custNo = custNo;
        this.erpSrcNo = erpSrcNo;
        this.planDate = planDate;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String partNameRdd,
                            Integer version,String whNo,Integer snStatus,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.partNameRdd = partNameRdd;
        this.version = version;
        this.whNo = whNo;
        this.snStatus = snStatus;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String partNameRdd,
                            Integer version,String whNo,String assignSrcWhNo,Integer snStatus,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.partNameRdd = partNameRdd;
        this.version = version;
        this.whNo = whNo;
        this.srcWhNo = assignSrcWhNo;
        this.snStatus = snStatus;
        this.sumQty = sumQty;
    }

    public WmsDocMovementSn(String orderNo,String partNo,String lotNo,String createDatetime,String partNameRdd,
                            String erpSrcNo,String vendorNo,String whNo,String assignSrcWhNo,String planDate,Double sumQty) {
        this.orderNo = orderNo;
        this.partNo = partNo;
        this.lotNo = lotNo;
        this.createDatetime = createDatetime;
        this.partNameRdd = partNameRdd;
        this.erpSrcNo = erpSrcNo;
        this.vendorNo = vendorNo;
        this.whNo = whNo;
        this.srcWhNo = assignSrcWhNo;
        this.planDate = planDate;
        this.sumQty = sumQty;
    }
}
