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

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

import java.math.BigDecimal;

@ApiModel("获取所有货品信息")
public class DrpPurMaterialInfoPageVO {
   @ApiModelProperty("货品id")
   private Long materialId;
   @ApiModelProperty("图片")
   private String imageUrl;
   @ApiModelProperty("货品编码")
   private String materialCode;
   @ApiModelProperty("货品名称")
   private String materialName;
   @ApiModelProperty("货品类型(1原料2商品)")
   private Integer materialType;
   @ApiModelProperty("货品类别id")
   private Long categoryId;
   @ApiModelProperty("货品类别")
   private String categoryName;
   @ApiModelProperty("计量单位id")
   private Long unitId;
   @ApiModelProperty("计量单位名称")
   private String unitName;
   @ApiModelProperty("进价")
   private Integer unitPrice;
   @ApiModelProperty("库存数")
   private BigDecimal inventoryNum;
   @ApiModelProperty("条码")
   private String barCode;
   @ApiModelProperty("供应商id")
   private Long supplierId;
   @ApiModelProperty("供应商")
   private String supplierName;
   @ApiModelProperty("计量类型(1按份2称重)")
   private Integer salesMode;
   private Long areaId;
   private String areaName;
   @ApiModelProperty("保质期类型 1年 2月 3日")
   private Integer shelfLifeType;
   @ApiModelProperty("保质期数")
   private Integer shelfLifeDays;
   @ApiModelProperty("保质期（转换）")
   private String shelfLife;
   @ApiModelProperty("是否注册(1是2否)")
   private Integer ifRegister;
   @ApiModelProperty("是否采集(1已采集2未采集)")
   private Integer ifCollect;

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

   public String getShelfLife() {
      if (!ObjectUtil.isEmpty(this.shelfLifeType) && !ObjectUtil.isEmpty(this.shelfLifeDays)) {
         if (this.shelfLifeType == 1) {
            this.shelfLife = this.shelfLifeDays + "年";
         } else if (this.shelfLifeType == 2) {
            this.shelfLife = this.shelfLifeDays + "个月";
         } else if (this.shelfLifeType == 3) {
            this.shelfLife = this.shelfLifeDays + "天";
         }

         return this.shelfLife;
      } else {
         return "";
      }
   }

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

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

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

   public Integer getMaterialType() {
      return this.materialType;
   }

   public Long getCategoryId() {
      return this.categoryId;
   }

   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 getInventoryNum() {
      return this.inventoryNum;
   }

   public String getBarCode() {
      return this.barCode;
   }

   public Long getSupplierId() {
      return this.supplierId;
   }

   public String getSupplierName() {
      return this.supplierName;
   }

   public Integer getSalesMode() {
      return this.salesMode;
   }

   public Long getAreaId() {
      return this.areaId;
   }

   public String getAreaName() {
      return this.areaName;
   }

   public Integer getShelfLifeType() {
      return this.shelfLifeType;
   }

   public Integer getShelfLifeDays() {
      return this.shelfLifeDays;
   }

   public Integer getIfRegister() {
      return this.ifRegister;
   }

   public Integer getIfCollect() {
      return this.ifCollect;
   }

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

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

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

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

   public DrpPurMaterialInfoPageVO setMaterialType(final Integer materialType) {
      this.materialType = materialType;
      return this;
   }

   public DrpPurMaterialInfoPageVO setCategoryId(final Long categoryId) {
      this.categoryId = categoryId;
      return this;
   }

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

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

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

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

   public DrpPurMaterialInfoPageVO setInventoryNum(final BigDecimal inventoryNum) {
      this.inventoryNum = inventoryNum;
      return this;
   }

   public DrpPurMaterialInfoPageVO setBarCode(final String barCode) {
      this.barCode = barCode;
      return this;
   }

   public DrpPurMaterialInfoPageVO setSupplierId(final Long supplierId) {
      this.supplierId = supplierId;
      return this;
   }

   public DrpPurMaterialInfoPageVO setSupplierName(final String supplierName) {
      this.supplierName = supplierName;
      return this;
   }

   public DrpPurMaterialInfoPageVO setSalesMode(final Integer salesMode) {
      this.salesMode = salesMode;
      return this;
   }

   public DrpPurMaterialInfoPageVO setAreaId(final Long areaId) {
      this.areaId = areaId;
      return this;
   }

   public DrpPurMaterialInfoPageVO setAreaName(final String areaName) {
      this.areaName = areaName;
      return this;
   }

   public DrpPurMaterialInfoPageVO setShelfLifeType(final Integer shelfLifeType) {
      this.shelfLifeType = shelfLifeType;
      return this;
   }

   public DrpPurMaterialInfoPageVO setShelfLifeDays(final Integer shelfLifeDays) {
      this.shelfLifeDays = shelfLifeDays;
      return this;
   }

   public DrpPurMaterialInfoPageVO setShelfLife(final String shelfLife) {
      this.shelfLife = shelfLife;
      return this;
   }

   public DrpPurMaterialInfoPageVO setIfRegister(final Integer ifRegister) {
      this.ifRegister = ifRegister;
      return this;
   }

   public DrpPurMaterialInfoPageVO setIfCollect(final Integer ifCollect) {
      this.ifCollect = ifCollect;
      return this;
   }
}
