package com.prolog.cs.biz.inbound.dto.rcv;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.prolog.cs.biz.inbound.constant.ValidatorGroup.validAdd;
import com.prolog.cs.biz.inbound.constant.ValidatorGroup.validEdit;
import com.prolog.cs.biz.inbound.dto.CargoChangeIn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description 上架单行 来源于上架任务池
 * @Author Xiong
 * @Date 2021-04-02
 */

@ApiModel
@Data
public class RcvInstockLinesDTO implements Serializable {
    private static final long serialVersionUID = 7004538676229297929L;
    @ApiModelProperty(value = "ASN单号")
    private String asnNo;

    @ApiModelProperty(value = "收货单号")
    private String rcvNo;

    @ApiModelProperty(value = "质检单号")
    private String rqcNo;

    @ApiModelProperty(value = "订单类型")
    private String rcvType;

    @ApiModelProperty(value = "订单类型")
    private String rcvTypeName;

    @ApiModelProperty(value = "单位名称")
    private String shipperName;

    @ApiModelProperty(value = "商品助记码")
    private String itemZjm;

    @ApiModelProperty(value = "商品编码")
    private String itemNum;

    @ApiModelProperty(value = "商品名称")
    private String itemName;

    @ApiModelProperty(value = "包装单位", required = true)
    @NotBlank(message = "包装单位 can not blank!", groups = validAdd.class)
    private String uom;

    @ApiModelProperty(value = "包装含量", required = true)
    @NotNull(message = "包装含量 can not blank!", groups = validAdd.class)
    private BigDecimal conversionRate;

    @ApiModelProperty(value = "库存状态", required = true)
    private String stockStatus;

    @ApiModelProperty(value = "批号")
    private String manufacturerLotNum;

    @ApiModelProperty(value = "显示生产日期", position = -3)
    private String showProductionDate;

    @ApiModelProperty(value = "显示有效期至", position = -3)
    private String showExpiredDate;

    @ApiModelProperty(value = "单品数量", required = true)
    @NotNull(message = "单品数量 can not blank!", groups = validAdd.class)
    private BigDecimal pieceQty;

    @ApiModelProperty(value = "整箱数", required = true)
    @NotNull(message = "整箱数 can not blank!", groups = validAdd.class)
    private BigDecimal oddCaseQty;

    @ApiModelProperty(value = "零散数", required = true)
    @NotNull(message = "零散数 can not blank!", groups = validAdd.class)
    private BigDecimal oddPieceQty;

    @ApiModelProperty(value = "容器编码")
    private String containerCode;

    @ApiModelProperty(value = "库别编码")
    private String whAreaCategoryCode;

    @ApiModelProperty(value = "库区编码")
    private String whAreaCode;

    @ApiModelProperty(value = "库别编码")
    private String whAreaCategoryName;

    @ApiModelProperty(value = "库区编码")
    private String whAreaName;


    @ApiModelProperty(value = "实际货位")
    private String whLocatorCode;

    @ApiModelProperty(value = "推荐货位")
    private String whLocatorCodeRecommend;

    @ApiModelProperty(value = "上架人")
    private String creatorName;

    @ApiModelProperty(value = "上架时间")
    private String gmtCreateTime;

    @ApiModelProperty(value = "创建时间")
    private String gmtCreate;

    @ApiModelProperty(value = "行ID(雪花,主键id)")
    @NotBlank(message = "行ID can not blank!", groups = validEdit.class)
    private String inBoundLineId;

    @ApiModelProperty(value = "收货单头ID")
    private String rcvHeaderId;

    @ApiModelProperty(value = "收货行头ID")
    private String rcvLineId;

    @ApiModelProperty(value = "行号")
    //	@NotNull(message = "行号 can not blank!", groups = validAdd.class)
    private BigDecimal lineNum;

    @ApiModelProperty(value = "库位ID")
    private String whLocatorId;

    @ApiModelProperty(value = "库位名称")
    private String whLocatorName;

    @ApiModelProperty(value = "建筑物编码")
    private String bldgCode;


    @ApiModelProperty(value = "商品ID", required = true)
    @NotBlank(message = "商品ID can not blank!", groups = validAdd.class)
    private String itemId;

    @ApiModelProperty(value = "包装单位类型(2019/2020)新老包装")
    //	@NotBlank(message = "包装单位类型(2019/2020)新老包装 can not blank!", groups = validAdd.class)
    private String uomType;

    @ApiModelProperty(value = "batch_id", required = true)
    @NotBlank(message = "batch_id can not blank!", groups = validAdd.class)
    private String batchId;

    @ApiModelProperty(value = "批次号")
    //	@NotBlank(message = "批次号 can not blank!", groups = validAdd.class)
    private String batchNum;

    @ApiModelProperty(value = "批次生产日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date batchProductionDate;

    @ApiModelProperty(value = "批次有效期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date batchExpiredDate;

    @ApiModelProperty(value = "供应商批次号")
    private String vendorBatchNum;


    @ApiModelProperty(value = "货格编码")
    private String goodsCaseCode;

    @ApiModelProperty(value = "备注(可填异常信息)")
    private String comments;

    @ApiModelProperty(value = "上架推荐库位算法(预留) A1.R1/A2.R2")
    private String algorithmType;

    @ApiModelProperty(value = "执行者（上架员）")
    private String executorUser;


    @ApiModelProperty(value = "任务池ID（来源TASK）")
    //	@NotBlank(message = "任务池ID（来源TASK） can not blank!", groups = validAdd.class)
    private String taskId;

    @ApiModelProperty(value = "货主ID（冗余，关联收货单）")
    private String mtlOwnerId;

    @ApiModelProperty(value = "仓库ID（冗余，关联收货单）", required = true)
    @NotBlank(message = "仓库ID（冗余，关联收货单） can not blank!", groups = validAdd.class)
    private String warehouseId;

    @ApiModelProperty(value = "来源单类型（冗余，关联收货单）")
    private String srcBillType;

    @ApiModelProperty(value = "来源单头ID（冗余，关联收货单）")
    private String srcHeaderId;

    @ApiModelProperty(value = "来源单行ID（冗余，关联收货单）")
    private String srcLineId;

    @ApiModelProperty(value = "ASN头ID（冗余，关联收货单）")
    private String asnHeaderId;

    @ApiModelProperty(value = "ASN行ID（冗余，关联收货单）")
    private String asnLineId;

    @ApiModelProperty(value = "商品条码(列表展示用)", position = 1)
    private String itemBarcode;
    @ApiModelProperty(value = "商品体积(列表展示用)", position = 2)
    private BigDecimal itemVolume;
    @ApiModelProperty(value = "商品重量(列表展示用)", position = 3)
    private BigDecimal itemWeight;
    @ApiModelProperty(value = "质检是否双票(列表展示用)", position = 4)
    private Integer itemHealthTwovoflag;
    @ApiModelProperty(value = "仓库名称(列表展示用)", position = 5)
    private String warehouseName;
    @ApiModelProperty(value = "库区名称(列表展示用)", position = 6)
    private String warehouseAreaName;
    @ApiModelProperty(value = "商品分类名(列表展示用)", position = 9)
    private String categoryName;

    // -------------------库存服务所需字段--------------------------------
    // 供应商id
    @ApiModelProperty(value = "供应商id(隐藏字段)", position = 9)
    private String vendorId;
    // 组织id
    @ApiModelProperty(value = "组织id(隐藏字段)", position = 9)
    private String orgId;
    // erp
    @ApiModelProperty(value = "erp批号(隐藏字段)", position = 9)
    private String erpBatchNum;
    // 产地
    @ApiModelProperty(value = "商品产地(隐藏字段)", position = 9)
    private String productionPlace;
    // 单品含税额
    @ApiModelProperty(value = "单品含税进价(隐藏字段)", position = 9)
    private BigDecimal piecePriceTi;
    // 单品不含税额
    @ApiModelProperty(value = "单品不含税进价(隐藏字段)", position = 9)
    private BigDecimal piecePriceTe;
    // 税率
    @ApiModelProperty(value = "税率(隐藏字段)", position = 9)
    private BigDecimal taxRate;
    @ApiModelProperty(value = "大类id")
    private String categoryId;
    @ApiModelProperty(value = "库别id")
    private String whAreaCategoryId;
    // ============5.12 新增字段==========================
    @ApiModelProperty(value = "推荐库区编号(逗号分隔列表)", position = -1)
    private String warehouseAreaCodes;
    @ApiModelProperty(value = "商品整散分离标识(0整散合一/1整散分开)", position = -1)
    private String itemIsPieceOrCase;
    @ApiModelProperty(value = "推荐库别编号(逗号分隔列表)", position = -1)
    private String warehouseAreaCategorys;
    // ===============5.17 新加字段================
    @ApiModelProperty(value = "商品规格说明(冗余)", position = -1)
    private String specification;
    @ApiModelProperty(value = "上市许可持有人(冗余)", position = -1)
    private String itemHealthListedLicensor;
    @ApiModelProperty(value = "生产企业许可证号(冗余)", position = -1)
    private String itemHealthProduceLicense;
    @ApiModelProperty(value = "存储分类(冗余)", position = -1)
    private String itemHealthStoreCategory;
    @ApiModelProperty(value = "商品是否进口(冗余)", position = -1)
    private Integer itemIsImported;
    @ApiModelProperty(value = "商品是否复检(0否1是)(冗余)", position = -1)
    private Integer itemIsRecheck;
    @ApiModelProperty(value = "商品是否器械(0否1是)(冗余)", position = -1)
    private Integer isInstrument;

    @ApiModelProperty(value = "收货时间(冗余)", position = -1)
    private Date rcvDate;

    // ========5.20新加==========================
    // 商品通用名
    @ApiModelProperty(value = "商品通用名(冗余)", position = -2)
    private String itemHealthCommonName;
    // 商品是否锁定
    @ApiModelProperty(value = "商品是否锁定(0否1是)(冗余)", position = -2)
    private Integer isLock;
    // 商品是否代管
    @ApiModelProperty(value = "商品是否代管(0否1是)(冗余)", position = -2)
    private Integer isHosted;
    // 生产厂家id
    @ApiModelProperty(value = "生产厂家id(冗余)", position = -2)
    private String manufacturerId;
    // 生产厂家code
    @ApiModelProperty(value = "生产厂家id(冗余)", position = -2)
    private String manufacturerCode;
    // 生产厂家name
    @ApiModelProperty(value = "生产厂家id(冗余)", position = -2)
    private String manufacturerName;
    @ApiModelProperty(value = "入库预留保质天数(冗余)", position = -2)
    private BigDecimal inStoreDay;
    // 注册证号
    @ApiModelProperty(value = "注册证号(冗余)", position = -2)
    private String itemHealthRegisterNbr;
    // 有效期天数(需转换)
    @ApiModelProperty(value = "有效期天数(需转换)(冗余)", position = -2)
    private BigDecimal shelfLifeDays;
    // 保质期单位
    @ApiModelProperty(value = "保质期单位(年/月/日,默认日)(冗余)", position = -2)
    private String shelfLifeUnit;
    // 是否特殊品
    @ApiModelProperty(value = "商品是否特殊品(0否1是)(冗余)", position = -2)
    private Integer itemIsSpecial;
    // 是否无菌
    @ApiModelProperty(value = "商品是否无菌(0否1是)(冗余)", position = -2)
    private Integer isBacteria;
    // 退货单位提供的商品售出期间储存、运输质量控制情况
    @ApiModelProperty(value = "退货单位提供的商品售出期间储存、运输质量控制情况(冗余)", position = -2)
    private String returnInfo;
    // 退货冷藏品出库期质量
    @ApiModelProperty(value = "退货冷藏品出库期质量(冗余)", position = -2)
    private String returnColdQuality;
    // 退货说明
    @ApiModelProperty(value = "退货说明(冗余)", position = -2)
    private String returnExplain;

    // ================== 5.26 新加字段=======
    @ApiModelProperty(value = "上架标签", position = -1)
    private String instockLabel;

    @ApiModelProperty(value = "上架任务池状态  1-初始状态 0-已生成上架单 2-已成功发送入库任务 3-eis上架任务已回告")
    private String status;

    @ApiModelProperty(value = "库存状态", position = -1)
    private String inventoryStatus;

    @ApiModelProperty(value = "实际货位名", position = -2)
    private String realWhLocatorName;

    @ApiModelProperty(value = "实际货位id", position = -2)
    private String realWhLocatorId;

    @ApiModelProperty(value = "实际货位编码", position = -2)
    private String realWhLocatorCode;

    @ApiModelProperty(value = "建筑物id", position = -2)
    private String bldgId;

    // ==============7.5新加=====================

    @ApiModelProperty(value = "批准文号", position = -3)
    private String approvalNumber;

    // 来源行id
    @ApiModelProperty(value = "来源行id(一般为质检行)", position = -5)
    private String refLineId;
    // 来源类型
    @ApiModelProperty(value = "来源类型(0收货1质检2复检)", position = -5)
    private Integer refType;
    @ApiModelProperty(value = "来源头id(一般为质检头)", position = -5)
    private String refBillId;
    @ApiModelProperty(value = "来源头编码(一般为质检头)", position = -5)
    private String refBillNo;
    // 自动生成上架单据时间
    @ApiModelProperty(value = "业务时间，可以为自动生成数据时间")
    private Date autoTime;

    @ApiModelProperty(value = "存储条件", position = -6)
    private String storeTemperature;

    @ApiModelProperty(value = "(新)库存子状态(1 正常/2 虚拟/ 3 实物/4 直调/5代管转正常/6代管转待检)", position = -7)
    private String subStatus;

    @ApiModelProperty(value = "(新)库存转换操作类型 0-代管转正常;1-代管转待检;2-待检转正常", position = -7)
    private String inventoryOpType;

    @ApiModelProperty(value = "(新)关联的代管货位id", position = -7)
    private String hostLocatorId;

    @ApiModelProperty(value = "(新)货主转换", position = -7)
    private CargoChangeIn cargoChangeIn;

    @ApiModelProperty(value = "二级库存(id&code)", position = -2000)
    private String secondStatus;

    /**
     * 企业id
     */
    @ApiModelProperty(value = "企业id")
    private String enterpriseId;

    /**
     * 创建人编码
     */
    @ApiModelProperty(value = "创建人编码")
    private String creator;

    @ApiModelProperty(value = "货主名称")
    private String mtlOwnerName;

    @ApiModelProperty(value = "供应商名称")
    private String vendorName;

    @ApiModelProperty(value = "实际上架数量")
    private BigDecimal realQty;

    /** 状态 **/
    @ApiModelProperty(value = "eis推送状态任务状态 0-初始状态  1-已成功发送入库任务 2-eis上架任务已回告")
    private String eisPushStatus;
}
