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

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.rcv.RcvLinesDTO;
import com.prolog.cs.biz.inbound.dto.rcv.RcvLinesProfilesDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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 TaskInstockDetailDTO implements Serializable {
    private static final long serialVersionUID = 9027551783218814096L;
    @ApiModelProperty(value = "ID(主键雪花id)", required = true)
    @NotBlank(message = "ID(主键雪花id) can not blank!", groups = validEdit.class)
    private String taskInboundId;

    @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 = "收货单头ID")
    private String rcvHeaderId;

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

    @ApiModelProperty(value = "商品ID")
    private String itemId;

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

    @ApiModelProperty(value = "数量")
    private BigDecimal qty;

    @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)
    @NotNull(message = "单品数量 can not blank!", groups = validAdd.class)
    private BigDecimal pieceQty;

    @ApiModelProperty(value = "批次ID")
    private String batchId;

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

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

    @ApiModelProperty(value = "是否允许作业标识", required = true)
    @NotBlank(message = "是否允许作业标识 can not blank!", groups = validAdd.class)
    private String activeFlag;

    @ApiModelProperty(value = "余量")
    private BigDecimal remainQty;

    @ApiModelProperty(value = "备注")
    private String comments;

    @ApiModelProperty(value = "结论（合格/不合格/隔离）")
    private String result;

    @ApiModelProperty(value = "原因")
    private String reason;

    @ApiModelProperty(value = "任务类型（收货/移库/补货）")
    private String taskType;

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

    @ApiModelProperty(value = "数据生成方式（系统自动/人工）部分类型的单据自动生成质检单")
    private String dataSrcType;

    @ApiModelProperty(value = "执行者")
    private String executor;

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

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

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "拆分人")
    private String spilterName;

    @ApiModelProperty(value = "是否拆分(0否1是)")
    private Integer isSpilt;

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

    @ApiModelProperty(value = "仓库编码")
    private String warehouseCode;

    @ApiModelProperty(value = "库位编码")
    private String whLocatorCode;
    @ApiModelProperty(value = "库位名称")
    private String whLocatorName;
    @ApiModelProperty(value = "库别编码")
    private String whAreaCategoryCode;
    @ApiModelProperty(value = "库别名称")
    private String whAreaCategoryName;
    @ApiModelProperty(value = "建筑物编码")
    private String bldgCode;
    @ApiModelProperty(value = "库区编码")
    private String whAreaCode;

    @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 = 7)
    private String itemNum;
    @ApiModelProperty(value = "商品名称(展示用)", position = 8)
    private String itemName;
    @ApiModelProperty(value = "商品分类名(展示用)", position = 9)
    private String categoryName;
    @ApiModelProperty(value = "商品分类code名(展示用)", hidden = true, position = 9)
    private String categoryId;
    @ApiModelProperty(value = "收货行拓展属性", position = 10, hidden = true)
    private RcvLinesProfilesDTO rcvLinesProfilesDTO;

    @ApiModelProperty(value = "收货行数据", position = 11, hidden = true)
    private RcvLinesDTO rcvLinesDTO;

    @ApiModelProperty(value = "单品零散数(列表展示用)", position = 1)
    private BigDecimal oddPieceQty;

    @ApiModelProperty(value = "包装件数(列表展示用)", position = 1)
    private BigDecimal caseQty;

    @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;

    // -------------------库存服务所需字段--------------------------------
    // 供应商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 = "数据版本号", hidden = true)
    private Integer dataVersion;

    @ApiModelProperty(value = "数据是否锁定(0否1是拆分/异常处理并发)", hidden = true)
    private Integer isLock;

    @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;
    @ApiModelProperty(value = "(新)收货类型")
    private String rcvType;

    // ===============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;

    @ApiModelProperty(value = "(新)质检行id", position = -1)
    private String rqcLineId;

    @ApiModelProperty(value = "(新)选择的库区id", position = -3)
    private String warehouseAreaId;
    //	@ApiModelProperty(value = "(新)选择的库区编号", position = -3)
    //	private String warehouseAreaCode;
    @ApiModelProperty(value = "(新)选择的建筑物id", position = -3)
    private String bldgId;
    @ApiModelProperty(value = "(新)选择的建筑物名称", position = -3)
    private String bldgName;

    // ===============5.26新加字段=========================
    @ApiModelProperty(value = "(新)库存状态", position = -2)
    private String inventoryStatus;

    @ApiModelProperty(value = "上架标签", position = -2)
    private String instockLabel;

    // ===============6.1新加字段============================================
    @ApiModelProperty(value = "生产厂家名称", position = -4)
    private String manufacturerName;

    @ApiModelProperty(value = "生产厂家id", position = -4)
    private String manufacturerId;

    // ===========6.2号新加字段=====================================================
    @ApiModelProperty(value = "(新)是否打印上架标签(0否1是)", position = -1109)
    private Integer isInstockPrint;

    @ApiModelProperty(value = "(新)质检单头id", position = -11)
    private String rqcHeaderId;

    @ApiModelProperty(value = "(新)货位楼层(冗余)", position = -11)
    private Integer locatorFloorNum;

    // 来源行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 = "(新)收货员(冗余)", position = -11)
    private String rcvUser;

    // ==== 6.1 新加字段===========================================================
    @ApiModelProperty(value = "(新)受托生产企业id(供应商id)", position = -4)
    private String delegationPartyId;
    @ApiModelProperty(value = "(新)受托生产企业名称(供应商名称)", position = -4)
    private String delegationPartyName;
    @ApiModelProperty(value = "(新)是否委托生产(0否1是)", position = -4)
    private Integer isDelegate;

    // ==== 6.9 新加字段===========================================================
    @ApiModelProperty(value = "(新)显示生产日期", position = -4)
    private String showProductionDate;
    @ApiModelProperty(value = "(新)显示有效期至", position = -4)
    private String showExpiredDate;
    @ApiModelProperty(value = "(新)最小包装数", position = -4)
    private BigDecimal pieceConversionRate;
    @ApiModelProperty(value = "(新)推荐库房列表", position = -4)
    private String warehouseRoomCodes;

    // ============6.10新加字段======================================================
    @ApiModelProperty(value = "(新)asn单行明细备注", position = -4)
    private String asnLineRemark;

    // ============6.11新加字段======================================================
    @ApiModelProperty(value = "(新)商品助记码", position = -4)
    private String itemZjm;

    @ApiModelProperty(value = "(新)货主编号", position = -5)
    private String mtlOwnerNum;
    @ApiModelProperty(value = "(新)货主名称", position = -5)
    private String mtlOwnerName;

    @ApiModelProperty(value = "(新)原单据编号", position = -5)
    private String asnBillNum;

    @ApiModelProperty(value = "(新)收货编号", position = -5)
    private String autoBillNum;
    @ApiModelProperty(value = "(新)注册证号(冗余)", position = -100)
    private String itemHealthRegisterNbr;
    @ApiModelProperty(value = "(新)商品批准文号", position = -1113)
    private String approvalNumber;

    @ApiModelProperty(value = "(新)质检报告单号(关联批次)", position = -1114)
    private String rqcReportNo;

    @ApiModelProperty(value = "(新)验收员", position = -1114)
    private String rqcUser;

    @ApiModelProperty(value = "小数拆分标识(Y为允许,其他均不可)", position = -2)
    private String allowDecimal;

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

    // 账期类型
    @ApiModelProperty(value = "账期类型")
    private String saleBillType;
    // 业务员
    @ApiModelProperty(value = "账期业务员")
    private String bizUser;
    // 部门
    @ApiModelProperty(value = "部门")
    private String orgName;

    // 8.27新加
    @ApiModelProperty(value = "(新)货位id/用于调账选择以及其他关联货位", position = -2017)
    private String rcvWhLocatorId;
    @ApiModelProperty(value = "(新)货位code/用于调账选择以及其他关联货位", position = -2017)
    private String rcvWhLocatorCode;
    @ApiModelProperty(value = "(新)货位库区code/用于调账选择以及其他关联货位", position = -2017)
    private String rcvWhAreaCode;
    @ApiModelProperty(value = "(新)货位库别code/用于调账选择以及其他关联货位", position = -2017)
    private String rcvWhAreaCategoryCode;
    // 8.27新加
    @ApiModelProperty(value = "(新)库存转换操作类型 0-代管转正常;1-代管转待检;2-待检转正常", position = -2017)
    private String inventoryOpType;
    @ApiModelProperty(value = "(新)关联的代管货位id", position = -2017)
    private String hostLocatorId;

    // 客户id
    @ApiModelProperty(value = "(新)客户id", position = -2017)
    private String customerId;
    // 订单备注
    @ApiModelProperty(value = "(新)订单备注", position = -2017)
    private String asnRemark;

    @ApiModelProperty(value = "(新)企业id", position = -2017)
    private String enterpriseId;

    @ApiModelProperty(value = "供应商/客户名称", position = 9)
    private String shipperName;

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

    /**
     * 预留字段
     **/
    @ApiModelProperty(value = "预留字段(推荐货位拣货方式)")
    private String attribute2;

    @ApiModelProperty(value = "商品剂型编码(oms增加)")
    private String ftypesCode;


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

    /**
     * 创建人用户名
     */
    @ApiModelProperty(value = "创建人用户名")
    private String creatorName;


    @ApiModelProperty(value = "件数")
    private BigDecimal newCaseQty;

    @ApiModelProperty(value = "零散数")
    private BigDecimal newOddPieceQty;

    @ApiModelProperty(value = "上架数量")
    private BigDecimal newPieceQty;

    @ApiModelProperty(value = "目标容器")
    private String containerFrom;

    @ApiModelProperty(value = "支架号")
    private String palletNo;

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