package com.bonus.canteen.core.supply.purchase.domain.param;

import cn.hutool.core.collection.CollUtil;
import com.bonus.canteen.core.utils.SysUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;

@ApiModel
public class DrpInspectGoodsDetailCommitAddDTO {
   @ApiModelProperty("送货明细id")
   private Long deliveryGoodsDetailId;
   @ApiModelProperty("货品id")
   private Long materialId;
   @ApiModelProperty("单价")
   private @NotNull(
   message = "单价不能为空!"
) Integer unitPrice;
   @ApiModelProperty("订货数量")
   private BigDecimal orderNum;
   @ApiModelProperty("送货数量")
   private BigDecimal deliveryNum;
   @ApiModelProperty("累计合格数量")
   private BigDecimal totalQualifiedNum;
   @ApiModelProperty("本次合格数量")
   private BigDecimal qualifiedNum;
   @ApiModelProperty("不合格原因")
   private String unqualifiedReason;
   @ApiModelProperty("货品图片")
   private List<String> checkPicUrlList;
   @ApiModelProperty(
      value = "货品拍照",
      hidden = true
   )
   private String checkPicUrls;

   public void setCheckPicUrlList(List<String> checkPicUrlList) {
      this.checkPicUrlList = checkPicUrlList;
      if (CollUtil.isNotEmpty(checkPicUrlList)) {
         this.checkPicUrls = (String)checkPicUrlList.stream().map(SysUtil::getCutPath).collect(Collectors.joining(","));
      }

   }

   public Long getDeliveryGoodsDetailId() {
      return this.deliveryGoodsDetailId;
   }

   public Long getMaterialId() {
      return this.materialId;
   }

   public Integer getUnitPrice() {
      return this.unitPrice;
   }

   public BigDecimal getOrderNum() {
      return this.orderNum;
   }

   public BigDecimal getDeliveryNum() {
      return this.deliveryNum;
   }

   public BigDecimal getTotalQualifiedNum() {
      return this.totalQualifiedNum;
   }

   public BigDecimal getQualifiedNum() {
      return this.qualifiedNum;
   }

   public String getUnqualifiedReason() {
      return this.unqualifiedReason;
   }

   public List<String> getCheckPicUrlList() {
      return this.checkPicUrlList;
   }

   public String getCheckPicUrls() {
      return this.checkPicUrls;
   }

   public DrpInspectGoodsDetailCommitAddDTO setDeliveryGoodsDetailId(final Long deliveryGoodsDetailId) {
      this.deliveryGoodsDetailId = deliveryGoodsDetailId;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setMaterialId(final Long materialId) {
      this.materialId = materialId;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setUnitPrice(final Integer unitPrice) {
      this.unitPrice = unitPrice;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setOrderNum(final BigDecimal orderNum) {
      this.orderNum = orderNum;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setDeliveryNum(final BigDecimal deliveryNum) {
      this.deliveryNum = deliveryNum;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setTotalQualifiedNum(final BigDecimal totalQualifiedNum) {
      this.totalQualifiedNum = totalQualifiedNum;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setQualifiedNum(final BigDecimal qualifiedNum) {
      this.qualifiedNum = qualifiedNum;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setUnqualifiedReason(final String unqualifiedReason) {
      this.unqualifiedReason = unqualifiedReason;
      return this;
   }

   public DrpInspectGoodsDetailCommitAddDTO setCheckPicUrls(final String checkPicUrls) {
      this.checkPicUrls = checkPicUrls;
      return this;
   }
}
