package com.bonus.core.allocation.advise.dto;

import com.bonus.core.allocation.advise.model.BasicsCanteenEvaluate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

@ApiModel("食堂评价入参")
public class EvaluateAddDTO {
   @ApiModelProperty("人员id")
   private @NotNull(
   message = "人员id, 不能为空"
) Long custId;
   @ApiModelProperty("食堂id")
   private @NotNull(
   message = "食堂id, 不能为空"
) Long canteenId;
   @ApiModelProperty("档口id")
   private @NotNull(
   message = "档口id, 不能为空"
) Long shopstallId;
   @ApiModelProperty("食堂评价详情集合")
   private List<AddCanteenEvaluateDetailDTO> evaluateDetailList;
   @ApiModelProperty("意见和建议")
   private String proposal;

   public void convertData(BasicsCanteenEvaluate basicsCanteenEvaluate) {
      Iterator var2 = this.getEvaluateDetailList().iterator();

      while(var2.hasNext()) {
         AddCanteenEvaluateDetailDTO detailModel = (AddCanteenEvaluateDetailDTO)var2.next();
         switch (detailModel.getFunctionId()) {
            case 1:
               basicsCanteenEvaluate.setAppearance(new BigDecimal(detailModel.getContent()));
               break;
            case 2:
               basicsCanteenEvaluate.setAttitude(new BigDecimal(detailModel.getContent()));
               break;
            case 3:
               basicsCanteenEvaluate.setTaste(new BigDecimal(detailModel.getContent()));
               break;
            case 4:
               basicsCanteenEvaluate.setVarieties(new BigDecimal(detailModel.getContent()));
               break;
            case 5:
               basicsCanteenEvaluate.setHygiene(new BigDecimal(detailModel.getContent()));
               break;
            case 6:
               basicsCanteenEvaluate.setPrice(new BigDecimal(detailModel.getContent()));
               break;
            case 7:
               basicsCanteenEvaluate.setWeight(new BigDecimal(detailModel.getContent()));
               break;
            case 8:
               basicsCanteenEvaluate.setCustomize1(new BigDecimal(detailModel.getContent()));
               break;
            case 9:
               basicsCanteenEvaluate.setCustomize2(new BigDecimal(detailModel.getContent()));
               break;
            case 10:
               basicsCanteenEvaluate.setCustomize3(new BigDecimal(detailModel.getContent()));
               break;
            case 11:
               basicsCanteenEvaluate.setCustomizeText1(detailModel.getContent());
               break;
            case 12:
               basicsCanteenEvaluate.setCustomizeText2(detailModel.getContent());
         }
      }

   }

   public Long getCustId() {
      return this.custId;
   }

   public Long getCanteenId() {
      return this.canteenId;
   }

   public Long getShopstallId() {
      return this.shopstallId;
   }

   public List<AddCanteenEvaluateDetailDTO> getEvaluateDetailList() {
      return this.evaluateDetailList;
   }

   public String getProposal() {
      return this.proposal;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

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

   public void setShopstallId(final Long shopstallId) {
      this.shopstallId = shopstallId;
   }

   public void setEvaluateDetailList(final List<AddCanteenEvaluateDetailDTO> evaluateDetailList) {
      this.evaluateDetailList = evaluateDetailList;
   }

   public void setProposal(final String proposal) {
      this.proposal = proposal;
   }


   @ApiModel("食堂评价详情 Model")
   public static class AddCanteenEvaluateDetailDTO {
      @ApiModelProperty("功能标识")
      private Integer functionId;
      @ApiModelProperty("内容")
      private String content;

      public Integer getFunctionId() {
         return this.functionId;
      }

      public String getContent() {
         return this.content;
      }

      public void setFunctionId(final Integer functionId) {
         this.functionId = functionId;
      }

      public void setContent(final String content) {
         this.content = content;
      }

   }
}
