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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
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 org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * @Description : 库存条码信息
 * @Reference :
 * @Author : dragon.xu
 * @CreateDate : 2018-11-17 14:50
 * @Modify:
 **/
@Data
@Entity
@Table(name = "WMS_STOCK_SN", indexes = {
        @Index(columnList = "PACKAGE_NO"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "REF_SRC"),
        @Index(columnList = "SN"),
        @Index(columnList = "SN_2D"),
        @Index(columnList = "WH_NO"),
        @Index(columnList = "ZONE_NO"),
        @Index(columnList = "LOCATE_NO"),
        @Index(columnList = "LOT_NO"),
        @Index(columnList = "FIX_LOT_NO"),
        @Index(columnList = "DATE_CODE"),
        @Index(columnList = "VENDOR_NO"),
        @Index(columnList = "ORGANIZE_CODE")
})
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value = "库存条码信息", description = "库存条码信息")
public class WmsStockSn extends BaseBean {

    private static final long serialVersionUID = 4869307400585363697L;
    @Column(name = "WH_NO")
    @ApiParam(value = "仓库代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WareHouse",
            searchColumnName = "code,name", listColumnName = "code,name", explicitColumnName = "code")
    private String whNo;

    @Column(name = "ZONE_NO")
    @ApiParam(value = "存储区编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsZones",
            searchColumnName = "zoneNo,zoneName", listColumnName = "zoneNo,zoneName", explicitColumnName = "zoneNo")
    private String zoneNo;

    @Column(name = "LOCATE_NO")
    @ApiParam(value = "库位代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsLocate",
            searchColumnName = "locateNo,locateName", listColumnName = "locateNo,locateName", explicitColumnName = "locateNo")
    private String locateNo;

    @Column(name = "PART_NO")
    @ApiParam(value = "物料编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partNo")
    private String partNo;

    @Column(name = "PART_NAME_RDD")
    @ApiParam(value = "物料名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partName")
    private String partNameRdd;

    @Column(name = "LOT_NO", nullable = false)
    @ApiParam("收货批次")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    public String lotNo = "";

    @Column(name = "DATE_CODE", nullable = false)
    @ApiParam(value = "供应商批次")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    public String dateCode = "";

    @Column(name = "FIX_LOT_NO", nullable = false)
    @ApiParam(value = "特殊批次")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String fixLotNo = "";

    @Column(name = "QUALITY_DATE")
    @ApiParam("保质期")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String qualityDate;

    @Column(name = "LEFT_CODE", nullable = false)
    @ApiParam(value = "生产批次")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String leftCode = "";

    @Column(name = "VENDOR_NO")
    @ApiParam(value = "供应商编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasVendor",
            searchColumnName = "vendorNo,vendorName", listColumnName = "vendorNo,vendorName", explicitColumnName = "vendorNo")
    public String vendorNo;

    @Column(name = "CUST_NO")
    @ApiParam(value = "客户编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasCustomer",
            searchColumnName = "custNo,custDesc", listColumnName = "custNo,custDesc", explicitColumnName = "custNo")
    private String custNo;

    @Column(name = "SHIPPING_FLAG")
    @ApiParam(value = "发往地")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String shippingFlag;

    @Column(name = "SN")
    @ApiParam(value = "条码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String sn;

    @Column(name = "SN_2D")
    @ApiParam(value = "二维码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String sn2d;

    @Column(name = "PACKAGE_NO")
    @ApiParam(value = "包装编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String packageNo;

    @Column(name = "UNIT")
    @ApiParam(value = "单位")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String unit;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)", nullable = false)
    @ColumnDefault("0")
    @ApiParam(value = "数量", example = "0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Double qty = 0d;

    /**
     * 质量状态:10=合格,20=不合格,30=隔离
     */
    @Column(name = "QC_STATUS")
    @ApiParam(value = "质检状态", example = "0")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_QC_STATUS.class)
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "STOCK_SN_QC_STATUS")
    private Integer qcStatus;
    /**
     * 条码状态：1=创建，10=质检中，20=待入库，30=入库，40=配料，50=出库，60=报废，70=在途
     */
    @Column(name = "SN_STATUS")
    @ApiParam(value = "条码状态", example = "0")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class)
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "STOCK_SN_STATUS")
    private Integer snStatus;
    /**
     * 1:已打印；2：未打印；3：退料生成条码
     */
    @Column(name = "PRINTED")
    @ApiParam(value = "是否打印", example = "0")
    @AnnoOutputColumn(refClass = WmsEnumUtil.PRINT_STATUS.class)
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "PRINT_STATUS")
    private Integer printed;

    @Column(name = "PDATE")
    @ApiParam(value = "打印时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.DATETIME, isRequire = 2)
    private Date pdate;
    /**
     * 1=ASN,10=PO,20=SO
     */
    @Column(name = "REF_TYPE")
    @ApiParam(value = "关联单据类型")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String refType;

    @Column(name = "REF_SRC")
    @ApiParam(value = "关联单号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String refSrc;

    @Column(name = "CUST_SN")
    @ApiParam(value = "客户条码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String custSn;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam(value = "工作中心代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String workCenterCode;

    @Column(name = "SN_TYPE")
    @ApiParam(value = "条码类型", example = "10")
    @AnnoOutputColumn(refClass = WmsEnumUtil.WMS_STOCK_TYPE.class, refForeignKey = "value", value = "description")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "WMS_STOCK_TYPE")
    private Integer snType = 10;

    @Column(name = "USE_COUNT")
    @ApiParam(value = "领用次数", example = "0")
    @ColumnDefault("0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Integer useCount;

    @Column(name = "SEQ_NO")
    @ApiParam(value = "序号", example = "0")
    @ColumnDefault("0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Integer seqNo;

//    @Version
//    @Column(name = "LOCK_VERSION")
//    @ApiParam(value = "乐观锁", example = "1")
//    public Integer lockVersion;

    @ApiParam(value = "仓库名称")
    @Transient
    public String whNameRdd;

    @ApiParam(value = "存储区名称")
    @Transient
    public String zoneNameRdd;

    @ApiParam(value = "时间")
    @Transient
    public String date;

    @ApiParam(value = "库位名称")
    @Transient
    public String locateNameRdd;

    @ApiParam(value = "物料类型描述")
    @Transient
    public String partTypeDesc;

    @ApiParam(value = "客户名称")
    @Transient
    public String custNameRdd;

    @ApiParam(value = "供应商名称")
    @Transient
    public String vendorNameRdd;

    @ApiParam(value = "二维码内容")
    @Transient
    public String barCode;

    @ApiParam(value = "散件质检输入不良数量")
    @Transient
    public Double inputNCQty;

    @ApiParam(value = "前端散件表格是否编辑")
    @Transient
    public Boolean isSet = false;

    @ApiParam(value = "加减库容标志")
    @Transient
    public Boolean isAdd;

    @ApiParam(value = "项目名称")
    @Transient
    public String prodCfgTypeName;

    @ApiParam(value = "标签编号")
    @Transient
    public String labelNo;

    @Column(name = "PACKAGE_PART_NO")
    @ApiParam(value = "包装零件号")
    private String packagePartNo;

    @Column(name = "QUEUE_GROUP_NO")
    @ApiParam(value = "jis料架号")
    private String queueGroupNo;

    @Transient
    @ApiParam(value = "工厂名称")
    public String organizeName;

    @Transient
    @ApiParam(value = "物料数量总和")
    public Double sumPartQty;

    @Transient
    @ApiParam(value = "条码数量总和")
    public Long snCount;

    @Transient
    @ApiParam(value = "物料编码集合")
    public List<String> partNoList;

    @Transient
    @ApiParam(value = "ERP库存地集合")
    public List<String> erpZoneNoList;

    @Transient
    @ApiParam(value = "ERP库存地")
    public String erpZoneNo;

    @Transient
    @ApiParam(value = "目标数量")
    public Double destQty;

    @Transient
    @ApiParam(value = "快照时间")
    private String snapshotTime;

    @Transient
    @ApiParam(value = "模板编号")
    private String templateNo;

    @Transient
    @ApiParam(value = "客户物料号")
    private String customerPartNo;

    @Transient
    @ApiParam(value = "箱号")
    private String boxNo;

    @Transient
    private Integer isSnapshot;

    @Transient
    @ApiParam("临保天数")
    private String qualityDay;

    @Transient
    @ApiParam("筛选（>=）或<")
    private String choose;

    @Transient
    @ApiParam("批次校验规则")
    private String lotCheckRule;

    @Column(name = "CONSIGNATION")
    @ApiParam("是否寄售 1-是 2-否")
    private Integer consignation;

    @Transient
    @ApiParam(value = "是否最早批次")
    public String isFifo;

    @Transient
    @ApiParam("打印模板名称")
    private String templateName;

    @Transient
    @ApiParam("是否同批次条码")
    private Integer isSameBatch;

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

    @Transient
    @ApiParam("保质期开始时间")
    private String qualityDateTimeStart;

    @Transient
    @ApiParam("保质期结束时间")
    private String qualityDateTimeEnd;

    @Transient
    @ApiParam(value = "预计完成时间")
    private String planCompleteTime;

    @Transient
    @ApiParam(value = "集装箱号")
    private String containerNo;

    @Transient
    @ApiParam(value = "箱数")
    private Integer boxQty;

    @Transient
    @ApiParam(value = "是否报工")
    private String isReport;

    @Transient
    @ApiParam(value = "是否需要报工")
    private Integer isReportPartNo;

    @Transient
    @ApiParam(value = "库存地代码")
    private String areaNo;

    @Transient
    @ApiParam(value = "物料规格")
    private String partSpec;

    @Transient
    @ApiParam(value = "箱数")
    private Long boxQtys;

    @Transient
    private String dockcode;

    @Transient
    private String storagelocation;

    @Transient
    private String requerimentCode;

    @Transient
    @ApiParam("大检测项类型")
    public String checkTypeCode;

    @Transient
    @ApiParam("样本数")
    private Integer sampleSize;

    @Transient
    @ApiParam("BATCH号")
    private String batchNo;

    @Transient
    @ApiParam(value = "产品条码")
    private String serialSn;

    @Transient
    @ApiParam("BH类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.FG_INSTOCK_SN_TYPE.class, refForeignKey = "value", value = "description")
    private Integer bhType;

    @Transient
    @ApiParam("处理状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.BH_WORK_STATUS.class, refForeignKey = "value", value = "description")
    private Integer workStatus;

    @Transient
    @ApiParam("是否合格")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description")
    public Integer isQualified;

    @Transient
    @ApiParam("返修状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.REWORK_STATUS.class, refForeignKey = "value", value = "description")
    public Integer reworkStatus;

    @Transient
    @ApiParam("返修结果")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description")
    public Integer reworkResult;

    @Transient
    @ApiParam("挑选状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.REWORK_STATUS.class, refForeignKey = "value", value = "description")
    public Integer pickStatus;

    @Transient
    @ApiParam("挑选状态")
    public Integer pickResult;

    @Transient
    @ApiParam("位置号-打印用")
    public String positionNo;

    @Transient
    @ApiParam("父位置号")
    public String parentPositionNo;


    @Transient
    @ApiParam(value = "材料类型")
    private String melType;

    @Transient
    @ApiParam(value = "项目号")
    private String projectNo;

    @Transient
    @ApiParam(value = "生产小组")
    private String productionGroup;

    @Transient
    @ApiParam(value = "客户零件号")
    private String custPartNo;

    @Transient
    @ApiParam(value = "物料类型")
    private String materialType;

    @Transient
    @ApiParam(value = "工单码")
    private String workOrderCode;

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

    @Transient
    @ApiParam(value = "检测结果ID")
    private Long summaryId;

    @Transient
    @ApiParam(value = "颜色")
    private String color;

    @Transient
    @ApiParam(value = "单据")
    private String orderNo;

    @Transient
    @ApiParam("物料库位")
    private String partLocateNo;

    @Transient
    @ApiParam("数量检查")
    private Integer checkQyt;

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

    @Transient
    @ApiParam("原数量")
    private Double srcQty;

    public WmsStockSn() {
    }

    public WmsStockSn(String partNo) {
        this.partNo = partNo;
    }

    public Integer getIsSnapshot() {
        return isSnapshot == null ? 0 : isSnapshot.intValue();
    }

    public Integer getSnType() {
        return snType == null ? 0 : snType.intValue();
    }

    public Double getQty() {
        return qty == null ? 0L : qty.doubleValue();
    }

    public Double getInputNCQty() {
        return inputNCQty == null ? 0L : this.inputNCQty.doubleValue();
    }

    public WmsStockSn(Long snCount, Double sumPartQty, String locateNo) {
        this.snCount = snCount;
        this.sumPartQty = sumPartQty;
        this.locateNo = locateNo;
    }

    public WmsStockSn(String locateNo, String partNo, String partName, String zoneNo, String unit, String whNo) {
        this.locateNo = locateNo;
        this.partNo = partNo;
        this.partNameRdd = partName;
        this.zoneNo = zoneNo;
        this.unit = unit;
        this.whNo = whNo;
    }

    //locate_no,part_no,sn_status,qc_status,sum(qty),is_deleted,is_valid
    public WmsStockSn(String locateNo, String partNo, Integer snStatus,
                      Integer qcStatus, Double qty, Integer isDeleted, Integer isValid) {
        this.locateNo = locateNo;
        this.partNo = partNo;
        this.snStatus = snStatus;
        this.qcStatus = qcStatus;
        this.qty = qty;
        this.isDeleted = isDeleted;
        this.isValid = isValid;
    }


    public WmsStockSn(Integer snStatus, String whNo, String locateNo, String partNo, String partNameRdd, String lotNo, Double qty) {
        this.snStatus = snStatus;
        this.whNo = whNo;
        this.locateNo = locateNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.lotNo = lotNo;
        this.qty = qty;
    }

    public WmsStockSn(Long id, String sn, String partNo, String partNameRdd, String unit, Integer snStatus,
                      Integer qcStatus, Double qty, String locateNo, String zoneNo, String whNo, String lotNo,
                      String dateCode, String leftCode, String fixLotNo, String vendorNo, String vendorNameRdd,
                      String qualityDate, String custNo, String lotCheckRule, String sn2d,
                      String packageNo, String createDatetime, String createUser, String modifyDatetime, String modifyUser) {
        this.id = id;
        this.sn = sn;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.unit = unit;
        this.snStatus = snStatus;
        this.qcStatus = qcStatus;
        this.qty = qty;
        this.locateNo = locateNo;
        this.zoneNo = zoneNo;
        this.whNo = whNo;
        this.lotNo = lotNo;
        this.dateCode = dateCode;
        this.leftCode = leftCode;
        this.fixLotNo = fixLotNo;
        this.vendorNo = vendorNo;
        this.vendorNameRdd = vendorNameRdd;
        this.qualityDate = qualityDate;
        this.qualityDay = qualityDay;
        this.custNo = custNo;
        this.lotCheckRule = lotCheckRule;
        this.sn2d = sn2d;
        this.packageNo = packageNo;
        this.createDatetime = createDatetime;
        this.createUser = createUser;
        this.modifyDatetime = modifyDatetime;
        this.modifyUser = modifyUser;
    }

    public WmsStockSn(String partNo, String packageNo, String locateNo, String createDatetime, String modifyDatetime) {
        this.partNo = partNo;
        this.packageNo = packageNo;
        this.locateNo = locateNo;
        this.createDatetime = createDatetime;
        this.modifyDatetime = modifyDatetime;
    }

    public WmsStockSn(Long id, String organizeCode, String sn, String partNo, String partNameRdd, String unit, Integer snStatus,
                      String areaNo, String partSpec, Integer qcStatus, Double qty, Long boxQtys,
                      String locateNo, String zoneNo, String whNo, String lotNo, String refSrc,
                      String dateCode, String packageNo, String createDatetime, String createUser,
                      String modifyDatetime, String modifyUser) {
        this.id = id;
        this.organizeCode = organizeCode;
        this.sn = sn;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.unit = unit;
        this.snStatus = snStatus;
        this.areaNo = areaNo;
        this.partSpec = partSpec;
        this.qcStatus = qcStatus;
        this.qty = qty;
        this.boxQtys = boxQtys;
        this.locateNo = locateNo;
        this.zoneNo = zoneNo;
        this.whNo = whNo;
        this.lotNo = lotNo;
        this.refSrc = refSrc;
        this.dateCode = dateCode;
        this.packageNo = packageNo;
        this.createDatetime = createDatetime;
        this.createUser = createUser;
        this.modifyDatetime = modifyDatetime;
        this.modifyUser = modifyUser;
    }

    public WmsStockSn(Long id, String organizeCode, String sn, String partNo, String partNameRdd, String unit, Integer snStatus,
                      String areaNo, Integer qcStatus, Double qty,
                      String locateNo, String zoneNo, String whNo, String lotNo, String refSrc,
                      String dateCode, String packageNo, String createDatetime, String createUser,
                      String modifyDatetime, String modifyUser) {
        this.id = id;
        this.organizeCode = organizeCode;
        this.sn = sn;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.unit = unit;
        this.snStatus = snStatus;
        this.areaNo = areaNo;
        this.qcStatus = qcStatus;
        this.qty = qty;
        this.locateNo = locateNo;
        this.zoneNo = zoneNo;
        this.whNo = whNo;
        this.lotNo = lotNo;
        this.refSrc = refSrc;
        this.dateCode = dateCode;
        this.packageNo = packageNo;
        this.createDatetime = createDatetime;
        this.createUser = createUser;
        this.modifyDatetime = modifyDatetime;
        this.modifyUser = modifyUser;
    }

    public WmsStockSn(String organizeCode, String refSrc, String partNo, String partNameRdd, Integer snType,
                      String locateNo, String workCenterCode, String packageNo, String shippingFlag, String lotNo, String dateCode, String fixLotNo
            , String leftCode, Double qty, String sn, String createUser, String createDatetime,String modifyUser,String modifyDatetime) {
        this.organizeCode = organizeCode;
        this.refSrc = refSrc;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.snType = snType;
        this.locateNo = locateNo;
        this.workCenterCode = workCenterCode;
        this.packageNo = packageNo;
        this.shippingFlag = shippingFlag;
        this.lotNo = lotNo;
        this.dateCode = dateCode;
        this.fixLotNo = fixLotNo;
        this.leftCode = leftCode;
        this.qty = qty;
        this.sn = sn;
        this.createUser = createUser;
        this.createDatetime = createDatetime;
        this.modifyUser = modifyUser;
        this.modifyDatetime = modifyDatetime;
    }


    public WmsStockSn(WmsStockSn stockSn, String batchCode) {
        this.id = stockSn.getId();
        this.organizeCode = stockSn.getOrganizeCode();
        this.refSrc = stockSn.getRefSrc();
        this.partNo = stockSn.getPartNo();
        this.partNameRdd = stockSn.getPartNameRdd();
        this.snType = stockSn.getSnType();
        this.locateNo = stockSn.getLocateNo();
        this.workCenterCode = stockSn.getWorkCenterCode();
        this.packageNo = stockSn.getPackageNo();
        this.shippingFlag = stockSn.getShippingFlag();
        this.lotNo = stockSn.getLotNo();
        this.dateCode = stockSn.getDateCode();
        this.fixLotNo = stockSn.getFixLotNo();
        this.leftCode = stockSn.getLeftCode();
        this.qty = stockSn.getQty();
        this.sn = stockSn.getSn();
        this.createUser = stockSn.getCreateUser();
        this.createDatetime = stockSn.getCreateDatetime();
        this.modifyUser = stockSn.getModifyUser();
        this.modifyDatetime = stockSn.getModifyDatetime();
        this.refSrc = batchCode;
    }

    public WmsStockSn(String organizeCode, String batchNo, String sn, String workCenterCode, String partNo,
                      String partNameRdd, String shippingFlag, String leftCode, String createUser, String createDatetime,
                      String modifyUser, String modifyDatetime) {
        this.organizeCode = organizeCode;
        this.batchNo = batchNo;
        this.sn = sn;
        this.workCenterCode = workCenterCode;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.shippingFlag = shippingFlag;
        this.leftCode = leftCode;
        this.createUser = createUser;
        this.createDatetime = createDatetime;
        this.modifyUser = modifyUser;
        this.modifyDatetime = modifyDatetime;

    }

    public WmsStockSn(String organizeCode, String batchNo, Integer bhType, String locateNo, String partNo,
                      String partNameRdd, Long summaryId, String workCenterCode, String createUser, String createDatetime,
                      String modifyUser, String modifyDatetime) {
        this.organizeCode = organizeCode;
        this.batchNo = batchNo;
        this.bhType = bhType;
        this.locateNo = locateNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.summaryId = summaryId;
        this.workCenterCode = workCenterCode;
        this.createUser = createUser;
        this.createDatetime = createDatetime;
        this.modifyUser = modifyUser;
        this.modifyDatetime = modifyDatetime;

    }

    public WmsStockSn(String organizeCode, Long id, String sn, String partNo, String partNameRdd, String unit, Integer snStatus,
                      Integer qcStatus, Double qty, String locateNo, String zoneNo, String whNo, String lotNo,
                      String dateCode, String leftCode, String fixLotNo, String vendorNo, String vendorNameRdd,
                      String qualityDate, String custNo, String custSn, String sn2d,
                      String packageNo, String createDatetime, String createUser, String modifyDatetime, String modifyUser,
                      String parentPositionNo, Date pdate, Integer printed, String refSrc, String refType,
                      String shippingFlag, String workCenterCode, Integer snType,
                      String packagePartNo, Integer useCount, Integer seqNo,
                      String whNameRdd, String locateNameRdd, String zoneNameRdd, String partTypeDesc,
                      String prodCfgTypeName, String custNameRdd, String workOrderCode, String color, String orderNo) {
        this.organizeCode = organizeCode;
        this.id = id;
        this.sn = sn;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.unit = unit;
        this.snStatus = snStatus;
        this.qcStatus = qcStatus;
        this.qty = qty;
        this.locateNo = locateNo;
        this.zoneNo = zoneNo;
        this.whNo = whNo;
        this.lotNo = lotNo;
        this.dateCode = dateCode;
        this.leftCode = leftCode;
        this.fixLotNo = fixLotNo;
        this.vendorNo = vendorNo;
        this.vendorNameRdd = vendorNameRdd;
        this.qualityDate = qualityDate;
        this.custNo = custNo;
        this.custSn = custSn;
        this.sn2d = sn2d;
        this.packageNo = packageNo;
        this.createDatetime = createDatetime;
        this.createUser = createUser;
        this.modifyDatetime = modifyDatetime;
        this.modifyUser = modifyUser;
        this.parentPositionNo = parentPositionNo;
        this.pdate = pdate;
        this.printed = printed;
        this.refSrc = refSrc;
        this.refType = refType;
        this.shippingFlag = shippingFlag;
        this.workCenterCode = workCenterCode;
        this.snType = snType;
        this.packagePartNo = packagePartNo;
        this.useCount = useCount;
        this.seqNo = seqNo;

        this.whNameRdd = whNameRdd;
        this.locateNameRdd = locateNameRdd;
        this.zoneNameRdd = zoneNameRdd;
        this.partTypeDesc = partTypeDesc;
        this.prodCfgTypeName = prodCfgTypeName;
        this.custNameRdd = custNameRdd;
        this.workOrderCode = workOrderCode;
        this.color = color;
        this.orderNo = orderNo;
    }

    public WmsStockSn(String packageNo, Double qty, String qualityDate, String lotNo, String dateCode, String leftCode, String fixLotNo) {
        this.packageNo = packageNo;
        this.qty = qty;
        this.qualityDate = qualityDate;
        this.lotNo = lotNo;
        this.dateCode = dateCode;
        this.leftCode = leftCode;
        this.fixLotNo = fixLotNo;
    }

    public WmsStockSn(String sn, Double qty, String unit, String partNo, String partNameRdd, String partTypeDesc, String lotNo, String leftCode, String fixLotNo, String vendorNo, String organizeCode) {
        this.sn = sn;
        this.qty = qty;
        this.unit = unit;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.partTypeDesc = partTypeDesc;
        this.lotNo = lotNo;
        this.leftCode = leftCode;
        this.fixLotNo = fixLotNo;
        this.vendorNo = vendorNo;
        this.organizeCode = organizeCode;
    }

    public WmsStockSn(WmsStockSn wmsStockSn, Double sumQty) {
        this.partNo = wmsStockSn.getPartNo();
        this.vendorNo = wmsStockSn.getVendorNo();
        this.unit = wmsStockSn.getUnit();
        this.partNameRdd = wmsStockSn.getPartNameRdd();
        this.sumQty = sumQty;
    }

    public WmsStockSn( String zoneNo, String locateNo, String partNo,
                      String partNameRdd, String sn, Double qty, String qualityDate,
                       Integer snStatus,String lotNo) {
        this.zoneNo = zoneNo;
        this.locateNo = locateNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.sn = sn;
        this.qty = qty;
        this.qualityDate = qualityDate;
        this.snStatus = snStatus;
        this.lotNo = lotNo;
    }
}
