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

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;

public class MenuDishesImportDTO implements Serializable {

   public MenuDishesImportDTO() {

   }

   @ExcelProperty(
      index = 0
   )
   private String dishesName;
   @ExcelProperty(
      index = 1
   )
   private BigDecimal price;
   @ExcelProperty(
      index = 2
   )
   private String dishesTypeName;
   @ExcelProperty(
      index = 3
   )
   private String materialNames;
   @ExcelProperty(
      index = 4
   )
   private Integer salesMode;
   @ExcelProperty(
           index = 5
   )
   private BigDecimal specificationOfWeighing;
   @ExcelProperty(
      index = 6
   )
   private BigDecimal weight;
   @ExcelProperty(
      index = 7
   )
   private String areaName;
   @ExcelProperty(
      index = 8
   )
   private String canteenName;
   @ExcelProperty(
      index = 9
   )
   private String stallName;
   @ExcelIgnore
   private String failReason;
   @ExcelIgnore
   private String areaId;
   @ExcelIgnore
   private String canteenId;
   @ExcelIgnore
   private String stallId;
   @ExcelIgnore
   private String typeId;

   public BigDecimal getPrice() {
      return ObjectUtil.isNull(this.price) ? BigDecimal.ZERO : this.price.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
   }

   public Integer getSalesMode() {
      return ObjectUtil.isNull(this.salesMode) ? 1 : this.salesMode;
   }

   public BigDecimal getSpecificationOfWeighing() {
      return ObjectUtil.isNull(this.price) ? BigDecimal.ZERO : this.price.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
   }

   public void setSpecificationOfWeighing(BigDecimal specificationOfWeighing) {
      this.specificationOfWeighing = specificationOfWeighing;
   }

   public String getDishesName() {
      return this.dishesName;
   }

   public String getDishesTypeName() {
      return this.dishesTypeName;
   }


   public String getMaterialNames() {
      return this.materialNames;
   }

   public BigDecimal getWeight() {
      return ObjectUtil.isNull(this.weight) ? BigDecimal.ZERO : this.weight.setScale(0, RoundingMode.DOWN);
   }

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

   public String getCanteenName() {
      return this.canteenName;
   }

   public String getStallName() {
      return this.stallName;
   }

   public String getFailReason() {
      return this.failReason;
   }

   public void setDishesName(final String dishesName) {
      this.dishesName = dishesName;
   }

   public void setPrice(final BigDecimal price) {
      this.price = price;
   }

   public void setDishesTypeName(final String dishesTypeName) {
      this.dishesTypeName = dishesTypeName;
   }

   public void setMaterialNames(final String materialNames) {
      this.materialNames = materialNames;
   }

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

   public void setWeight(final BigDecimal weight) {
      this.weight = weight;
   }

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

   public void setCanteenName(final String canteenName) {
      this.canteenName = canteenName;
   }

   public void setStallName(final String stallName) {
      this.stallName = stallName;
   }

   public void setFailReason(final String failReason) {
      this.failReason = failReason;
   }

   public String getAreaId() {
      return areaId;
   }

   public void setAreaId(String areaId) {
      this.areaId = areaId;
   }

   public String getCanteenId() {
      return canteenId;
   }

   public void setCanteenId(String canteenId) {
      this.canteenId = canteenId;
   }

   public String getStallId() {
      return stallId;
   }

   public void setStallId(String stallId) {
      this.stallId = stallId;
   }

   public String getTypeId() {
      return typeId;
   }

   public void setTypeId(String typeId) {
      this.typeId = typeId;
   }

   @Override
   public String toString() {
      return "MenuDishesImportDTO{" +
              "dishesName='" + dishesName + '\'' +
              ", price=" + price +
              ", dishesTypeName='" + dishesTypeName + '\'' +
              ", materialNames='" + materialNames + '\'' +
              ", salesMode=" + salesMode +
              ", specificationOfWeighing=" + specificationOfWeighing +
              ", weight=" + weight +
              ", areaName='" + areaName + '\'' +
              ", canteenName='" + canteenName + '\'' +
              ", stallName='" + stallName + '\'' +
              ", failReason='" + failReason + '\'' +
              ", areaId='" + areaId + '\'' +
              ", canteenId='" + canteenId + '\'' +
              ", stallId='" + stallId + '\'' +
              ", typeId='" + typeId + '\'' +
              '}';
   }
}
