package com.bonus.core.menu.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.bonus.core.menu.constant.BigDecimalSerializer;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Optional;

@ApiModel("菜品详情(大小份)")
public class AppletDishesSizeV2VO {
   @ApiModelProperty("菜品id")
   private Long dishesId;
   @ApiModelProperty("菜品名称")
   private String dishesName;
   @ApiModelProperty("库存数量")
   private Integer surplusNum;
   @ApiModelProperty("限购数量")
   private Integer restrictNum;
   @ApiModelProperty("菜品价格")
   private Integer dishesPrice;
   @ApiModelProperty("优惠价")
   private Integer prefPrice;
   @ApiModelProperty("规格类型(1-标准,2-大份,3-小份,4-50g,5-100g)")
   private Long sizeType;
   @ApiModelProperty("菜品规格")
   private String sizeJson;
   @ApiModelProperty("月销量")
   private Integer monthlySales;
   @ApiModelProperty("好评率")
   private BigDecimal goodProbability;
   @ApiModelProperty("热量(千卡/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal calories;
   @ApiModelProperty("蛋白质(g/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal protein;
   @ApiModelProperty("脂肪(g/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal fat;
   @ApiModelProperty("碳水化合物(g/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal carbohydrate;
   @ApiModelProperty("膳食纤维(g/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal dietaryFiber;
   @ApiModelProperty("胆固醇(mg/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal cholesterol;
   @ApiModelProperty("钙(mg/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal calcium;
   @ApiModelProperty("钠(mg/100g)")
   @JsonSerialize(
      using = BigDecimalSerializer.class
   )
   private BigDecimal sodium;
   @ApiModelProperty("热量NRV(千卡/100g)")
   private BigDecimal caloriesNrv;
   @ApiModelProperty("蛋白质NRV(g/100g)")
   private BigDecimal proteinNrv;
   @ApiModelProperty("脂肪NRV(g/100g)")
   private BigDecimal fatNrv;
   @ApiModelProperty("碳水化合物NRV(g/100g)")
   private BigDecimal carbohydrateNrv;
   @ApiModelProperty("膳食纤维NRV(g/100g)")
   private BigDecimal dietaryFiberNrv;
   @ApiModelProperty("胆固醇NRV(mg/100g)")
   private BigDecimal cholesterolNrv;
   @ApiModelProperty("钙NRV(mg/100g)")
   private BigDecimal calciumNrv;
   @ApiModelProperty("钠NRV(mg/100g)")
   private BigDecimal sodiumNrv;

   public Integer getMonthlySales() {
      return (Integer)Optional.ofNullable(this.monthlySales).orElse(0);
   }

   public BigDecimal getGoodProbability() {
      return (BigDecimal)Optional.ofNullable(this.goodProbability).orElse(BigDecimal.ZERO);
   }

   public Long getSizeType() {
      return (Long)Optional.ofNullable(this.sizeType).orElse(1L);
   }

   public BigDecimal getCaloriesNrv() {
      return ((BigDecimal)Optional.ofNullable(this.calories).orElse(BigDecimal.ZERO)).multiply(new BigDecimal("4.185")).divide(new BigDecimal("8400"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getProteinNrv() {
      return ((BigDecimal)Optional.ofNullable(this.protein).orElse(BigDecimal.ZERO)).divide(new BigDecimal("60"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getFatNrv() {
      return ((BigDecimal)Optional.ofNullable(this.fat).orElse(BigDecimal.ZERO)).divide(new BigDecimal("60"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getCarbohydrateNrv() {
      return ((BigDecimal)Optional.ofNullable(this.carbohydrate).orElse(BigDecimal.ZERO)).divide(new BigDecimal("300"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getDietaryFiberNrv() {
      return ((BigDecimal)Optional.ofNullable(this.dietaryFiber).orElse(BigDecimal.ZERO)).divide(new BigDecimal("25"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getCholesterolNrv() {
      return ((BigDecimal)Optional.ofNullable(this.cholesterol).orElse(BigDecimal.ZERO)).divide(new BigDecimal("300"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getCalciumNrv() {
      return ((BigDecimal)Optional.ofNullable(this.calcium).orElse(BigDecimal.ZERO)).divide(new BigDecimal("800"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public BigDecimal getSodiumNrv() {
      return ((BigDecimal)Optional.ofNullable(this.sodium).orElse(BigDecimal.ZERO)).divide(new BigDecimal("2000"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
   }

   public Long getDishesId() {
      return this.dishesId;
   }

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

   public Integer getSurplusNum() {
      return this.surplusNum;
   }

   public Integer getRestrictNum() {
      return this.restrictNum;
   }

   public Integer getDishesPrice() {
      return this.dishesPrice;
   }

   public Integer getPrefPrice() {
      return this.prefPrice;
   }

   public String getSizeJson() {
      return this.sizeJson;
   }

   public BigDecimal getCalories() {
      return this.calories;
   }

   public BigDecimal getProtein() {
      return this.protein;
   }

   public BigDecimal getFat() {
      return this.fat;
   }

   public BigDecimal getCarbohydrate() {
      return this.carbohydrate;
   }

   public BigDecimal getDietaryFiber() {
      return this.dietaryFiber;
   }

   public BigDecimal getCholesterol() {
      return this.cholesterol;
   }

   public BigDecimal getCalcium() {
      return this.calcium;
   }

   public BigDecimal getSodium() {
      return this.sodium;
   }

   public void setDishesId(final Long dishesId) {
      this.dishesId = dishesId;
   }

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

   public void setSurplusNum(final Integer surplusNum) {
      this.surplusNum = surplusNum;
   }

   public void setRestrictNum(final Integer restrictNum) {
      this.restrictNum = restrictNum;
   }

   public void setDishesPrice(final Integer dishesPrice) {
      this.dishesPrice = dishesPrice;
   }

   public void setPrefPrice(final Integer prefPrice) {
      this.prefPrice = prefPrice;
   }

   public void setSizeType(final Long sizeType) {
      this.sizeType = sizeType;
   }

   public void setSizeJson(final String sizeJson) {
      this.sizeJson = sizeJson;
   }

   public void setMonthlySales(final Integer monthlySales) {
      this.monthlySales = monthlySales;
   }

   public void setGoodProbability(final BigDecimal goodProbability) {
      this.goodProbability = goodProbability;
   }

   public void setCalories(final BigDecimal calories) {
      this.calories = calories;
   }

   public void setProtein(final BigDecimal protein) {
      this.protein = protein;
   }

   public void setFat(final BigDecimal fat) {
      this.fat = fat;
   }

   public void setCarbohydrate(final BigDecimal carbohydrate) {
      this.carbohydrate = carbohydrate;
   }

   public void setDietaryFiber(final BigDecimal dietaryFiber) {
      this.dietaryFiber = dietaryFiber;
   }

   public void setCholesterol(final BigDecimal cholesterol) {
      this.cholesterol = cholesterol;
   }

   public void setCalcium(final BigDecimal calcium) {
      this.calcium = calcium;
   }

   public void setSodium(final BigDecimal sodium) {
      this.sodium = sodium;
   }

   public void setCaloriesNrv(final BigDecimal caloriesNrv) {
      this.caloriesNrv = caloriesNrv;
   }

   public void setProteinNrv(final BigDecimal proteinNrv) {
      this.proteinNrv = proteinNrv;
   }

   public void setFatNrv(final BigDecimal fatNrv) {
      this.fatNrv = fatNrv;
   }

   public void setCarbohydrateNrv(final BigDecimal carbohydrateNrv) {
      this.carbohydrateNrv = carbohydrateNrv;
   }

   public void setDietaryFiberNrv(final BigDecimal dietaryFiberNrv) {
      this.dietaryFiberNrv = dietaryFiberNrv;
   }

   public void setCholesterolNrv(final BigDecimal cholesterolNrv) {
      this.cholesterolNrv = cholesterolNrv;
   }

   public void setCalciumNrv(final BigDecimal calciumNrv) {
      this.calciumNrv = calciumNrv;
   }

   public void setSodiumNrv(final BigDecimal sodiumNrv) {
      this.sodiumNrv = sodiumNrv;
   }

}
