package com.prolog.eis.dto.outbound;

import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @program: eis_dclk_java
 * @description:
 * @author: Xiong
 * @create: 2022-11-15 15:06
 **/
@Data
public class ConfirmSublistDto {


    @ApiModelProperty("仓库编号")
    @NotBlank(message = "仓库编号不能为空")
    private String warehouseId;

    @ApiModelProperty("企业ID")
    @NotBlank(message = "企业ID不能为空")
    private String enterpriseId;

    @ApiModelProperty("物料ID")
    @NotBlank(message = "物料ID不能为空")
    private String itemId;

    @ApiModelProperty("批次ID")
    private String lotId;

    @ApiModelProperty("货主ID")
    @NotBlank(message = "货主ID不能为空")
    private String ownerId;

    @ApiModelProperty("包装ID")
    private String packId;

    @ApiModelProperty("库存梳数量")
    private BigDecimal inventoryQty;

    @ApiModelProperty("实盘数量")
    @NotNull(message = "实盘数量不能为空")
    private BigDecimal qty;

    @ApiModelProperty("是否锁定容器库存")
    private String isLock;

    @ApiModelProperty("源区域")
    private String originalArea;

    @ApiModelProperty("货位")
    private String locNo;

    @ApiModelProperty("源点位")
    private String originalLocation;

    @ApiModelProperty("目标区域")
    private String targetArea;

    @ApiModelProperty("目标点位")
    private String targetLocation;

    @ApiModelProperty("行号")
    @NotBlank(message = "行号不能为空")
    private String taskLineId;

    @ApiModelProperty("单据编号")
    @NotBlank(message = "单据编号不能为空")
    private String taskId;

    @ApiModelProperty("WMS订单号")
    @NotBlank(message = "WMS订单号不能为空")
    private String billNo;

    @ApiModelProperty("作业类型")
    @NotNull(message = "作业类型不能为空")
    private int workType;

    @ApiModelProperty("业务类型")
    @NotBlank(message = "业务类型不能为空")
    private String businessType;


    @ApiModelProperty("eis任务号")
    @NotBlank(message = "eis任务号")
    private String eisTaskId;

    @ApiModelProperty("目标容器编号")
    @NotBlank(message = "目标容器编号不能为空")
    private String targetContainerNo;

    @ApiModelProperty("WMS出库货位")
    @NotBlank(message = "WMS出库货位不能为空")
    private String wmsLocationCode;

    private String containerNo;

    @ApiModelProperty("EIS盘点是否需要WMS审核")
    private Integer isCheck;

    public boolean lock() {
        return StrUtil.isNotBlank(isLock) && StrUtil.equals(isLock, "1");
    }
}
