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

import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bonus.canteen.core.utils.SysUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

@ApiModel
public class DrpInspectGoodsDetailPageVO {
   @ApiModelProperty("主键id")
   @TableId(
      value = "id",
      type = IdType.AUTO
   )
   private Long id;
   @ApiModelProperty("验货单号")
   private String inspectGoodsId;
   @ApiModelProperty("验货明细id")
   private Long inspectGoodsDetailId;
   @ApiModelProperty("货品id")
   private Long materialId;
   @ApiModelProperty("货品")
   private String materialName;
   @ApiModelProperty("货品编码")
   private String materialCode;
   @ApiModelProperty("货品类型")
   private String categoryName;
   @ApiModelProperty("单位id")
   private Long unitId;
   @ApiModelProperty("单位")
   private String unitName;
   @ApiModelProperty("单价")
   private Integer unitPrice;
   @ApiModelProperty("订货数量")
   private BigDecimal orderNum;
   @ApiModelProperty("送货数量")
   private BigDecimal deliveryNum;
   @ApiModelProperty("累计合格数量")
   private BigDecimal totalQualifiedNum;
   @ApiModelProperty("本次合格数量")
   private BigDecimal qualifiedNum;
   @ApiModelProperty("不合格原因")
   private String unqualifiedReason;
   @ApiModelProperty("创建人")
   private String createBy;
   @ApiModelProperty("创建时间")
   private LocalDateTime createTime;
   @ApiModelProperty("更新人")
   private String updateBy;
   @ApiModelProperty("更新时间")
   private LocalDateTime updateTime;
   @ApiModelProperty("图片地址")
   private String imageUrl;
   @ApiModelProperty("货品图片")
   private List<String> checkPicUrlList;
   @ApiModelProperty(
      value = "货品拍照",
      hidden = true
   )
   private String checkPicUrls;

   public void setCheckPicUrls(String checkPicUrls) {
      this.checkPicUrls = checkPicUrls;
      if (CharSequenceUtil.isNotBlank(checkPicUrls)) {
         this.checkPicUrlList = (List)CharSequenceUtil.split(checkPicUrls, ',').stream().map(SysUtil::getCutFileUrl).collect(Collectors.toList());
      }

   }

   public String getImageUrl() {
      return SysUtil.getCutFileUrl(this.imageUrl);
   }

   public Long getId() {
      return this.id;
   }

   public String getInspectGoodsId() {
      return this.inspectGoodsId;
   }

   public Long getInspectGoodsDetailId() {
      return this.inspectGoodsDetailId;
   }

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

   public String getMaterialName() {
      return this.materialName;
   }

   public String getMaterialCode() {
      return this.materialCode;
   }

   public String getCategoryName() {
      return this.categoryName;
   }

   public Long getUnitId() {
      return this.unitId;
   }

   public String getUnitName() {
      return this.unitName;
   }

   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 DrpInspectGoodsDetailPageVO setId(final Long id) {
      this.id = id;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setInspectGoodsId(final String inspectGoodsId) {
      this.inspectGoodsId = inspectGoodsId;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setInspectGoodsDetailId(final Long inspectGoodsDetailId) {
      this.inspectGoodsDetailId = inspectGoodsDetailId;
      return this;
   }

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

   public DrpInspectGoodsDetailPageVO setMaterialName(final String materialName) {
      this.materialName = materialName;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setMaterialCode(final String materialCode) {
      this.materialCode = materialCode;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setCategoryName(final String categoryName) {
      this.categoryName = categoryName;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setUnitId(final Long unitId) {
      this.unitId = unitId;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setUnitName(final String unitName) {
      this.unitName = unitName;
      return this;
   }

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

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

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

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

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

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

   public DrpInspectGoodsDetailPageVO setImageUrl(final String imageUrl) {
      this.imageUrl = imageUrl;
      return this;
   }

   public DrpInspectGoodsDetailPageVO setCheckPicUrlList(final List<String> checkPicUrlList) {
      this.checkPicUrlList = checkPicUrlList;
      return this;
   }

   public String getCreateBy() {
      return createBy;
   }

   public DrpInspectGoodsDetailPageVO setCreateBy(String createBy) {
      this.createBy = createBy;
      return this;
   }

   public LocalDateTime getCreateTime() {
      return createTime;
   }

   public DrpInspectGoodsDetailPageVO setCreateTime(LocalDateTime createTime) {
      this.createTime = createTime;
      return this;
   }

   public String getUpdateBy() {
      return updateBy;
   }

   public DrpInspectGoodsDetailPageVO setUpdateBy(String updateBy) {
      this.updateBy = updateBy;
      return this;
   }

   public LocalDateTime getUpdateTime() {
      return updateTime;
   }

   public DrpInspectGoodsDetailPageVO setUpdateTime(LocalDateTime updateTime) {
      this.updateTime = updateTime;
      return this;
   }
}
