package com.bonus.canteen.core.supply.dto;

import com.bonus.canteen.core.utils.SysUtil;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;

public class DrpSupplierQualificationAddDTO implements Serializable {
   @ApiModelProperty("资质编号")
   private String qualificationNum;
   @ApiModelProperty("资质名称")
   private @NotBlank(
   message = "资质名称不能为空!"
) String qualificationName;
   @ApiModelProperty("有效期")
   private LocalDate validity;
   @ApiModelProperty("资质照片")
   private String imgUrl;
   @ApiModelProperty("供应商id")
   private @NotNull(
   message = "供应商id不能为空 ^_^"
) Long supplierId;
   @ApiModelProperty("主次(1主，2次)")
   private Integer mainFlag;
   @ApiModelProperty("关联证书库ID")
   private Long certId;

   public void setImgUrl(String imgUrl) {
      this.imgUrl = SysUtil.getCutPath(imgUrl);
   }

   public String getQualificationNum() {
      return this.qualificationNum;
   }

   public String getQualificationName() {
      return this.qualificationName;
   }

   public LocalDate getValidity() {
      return this.validity;
   }

   public String getImgUrl() {
      return this.imgUrl;
   }

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

   public Integer getMainFlag() {
      return this.mainFlag;
   }

   public Long getCertId() {
      return this.certId;
   }

   public void setQualificationNum(final String qualificationNum) {
      this.qualificationNum = qualificationNum;
   }

   public void setQualificationName(final String qualificationName) {
      this.qualificationName = qualificationName;
   }

   public void setValidity(final LocalDate validity) {
      this.validity = validity;
   }

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

   public void setMainFlag(final Integer mainFlag) {
      this.mainFlag = mainFlag;
   }

   public void setCertId(final Long certId) {
      this.certId = certId;
   }

   public String toString() {
      String var10000 = this.getQualificationNum();
      return "DrpSupplierQualificationAddDTO(qualificationNum=" + var10000 + ", qualificationName=" + this.getQualificationName() + ", validity=" + String.valueOf(this.getValidity()) + ", imgUrl=" + this.getImgUrl() + ", supplierId=" + this.getSupplierId() + ", mainFlag=" + this.getMainFlag() + ", certId=" + this.getCertId() + ")";
   }
}
