package com.bonus.canteen.core.nutrition.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

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

@TableName("health_dishes_nutrition")
@ApiModel("菜品营养信息 实体类")
public class HealthDishesNutrition implements Serializable {
   @TableId("id")
   @ApiModelProperty("主键id")
   private Long id;
   @TableField("cust_id")
   @ApiModelProperty("人员id")
   private Long custId;
   @TableField("dishes_id")
   @ApiModelProperty("菜品id")
   private @NotNull(
   message = "[菜品id]不能为空"
) Long dishesId;
   @TableField("dishes_name")
   @ApiModelProperty("菜品名称")
   private @NotBlank(
   message = "[菜品名称]不能为空"
) @Size(
   max = 255,
   message = "编码长度不能超过255"
) @Length(
   max = 255,
   message = "编码长度不能超过255"
) String dishesName;
   @TableField("actual_weight")
   @ApiModelProperty("菜品实际重量(g)")
   private @NotNull(
   message = "[菜品实际重量(g)]不能为空"
) BigDecimal actualWeight;
   @TableField("standard_weight")
   @ApiModelProperty("菜品标准重量(g)")
   private @NotNull(
   message = "[菜品标准重量(g)]不能为空"
) BigDecimal standardWeight;
   @TableField("eat_date")
   @ApiModelProperty("食用日期")
   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd"
   )
   @DateTimeFormat(
      pattern = "yyyy-MM-dd"
   )
   private @NotNull(
   message = "[食用日期]不能为空"
) LocalDate eatDate;
   @TableField("mealtime_type")
   @ApiModelProperty("餐次类型 1-早餐 2-午餐 3-晚餐 4-下午茶 5-夜宵")
   private @NotNull(
   message = "[餐次类型 1-早餐 2-午餐 3-晚餐 4-下午茶 5-夜宵]不能为空"
) Integer mealtimeType;
   @TableField("dishes_source")
   @ApiModelProperty("类型(1-APP端自定义添加,2-菜品库)")
   private @NotNull(
   message = "[类型(1-APP端自定义添加,2-菜品库)]不能为空"
) Integer dishesSource;
   @TableField("calories")
   @ApiModelProperty("标准重量下包含的热量(千卡)")
   private @NotNull(
   message = "[热量(千卡)]不能为空"
) BigDecimal calories;
   @TableField("protein")
   @ApiModelProperty("标准重量下包含的蛋白质(g)")
   private @NotNull(
   message = "[蛋白质(g)]不能为空"
) BigDecimal protein;
   @TableField("carbohydrate")
   @ApiModelProperty("标准重量下包含的碳水化合物(g)")
   private @NotNull(
   message = "[碳水化合物(g)]不能为空"
) BigDecimal carbohydrate;
   @TableField("fat")
   @ApiModelProperty("标准重量下包含的脂肪(g)")
   private @NotNull(
   message = "[脂肪(g)]不能为空"
) BigDecimal fat;
   @TableField("dietary_fiber")
   @ApiModelProperty("标准重量下包含的膳食纤维(g)")
   private @NotNull(
   message = "[膳食纤维(g)]不能为空"
) BigDecimal dietaryFiber;
   @TableField("sodium")
   @ApiModelProperty("标准重量下包含的钠(mg)")
   private @NotNull(
   message = "[钠(mg)]不能为空"
) BigDecimal sodium;
   @TableField("crby")
   @ApiModelProperty("创建人")
   private @NotBlank(
   message = "[创建人]不能为空"
) @Size(
   max = 32,
   message = "编码长度不能超过32"
) @Length(
   max = 32,
   message = "编码长度不能超过32"
) String crby;
   @TableField("crtime")
   @ApiModelProperty("创建时间")
   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private @NotNull(
   message = "[创建时间]不能为空"
) LocalDate crtime;
   @TableField("upby")
   @ApiModelProperty("更新人")
   private @NotBlank(
   message = "[更新人]不能为空"
) @Size(
   max = 32,
   message = "编码长度不能超过32"
) @Length(
   max = 32,
   message = "编码长度不能超过32"
) String upby;
   @TableField("uptime")
   @ApiModelProperty("更新时间")
   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private @NotNull(
   message = "[更新时间]不能为空"
) LocalDate uptime;

   public Long getId() {
      return this.id;
   }

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

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

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

   public BigDecimal getActualWeight() {
      return this.actualWeight;
   }

   public BigDecimal getStandardWeight() {
      return this.standardWeight;
   }

   public LocalDate getEatDate() {
      return this.eatDate;
   }

   public Integer getMealtimeType() {
      return this.mealtimeType;
   }

   public Integer getDishesSource() {
      return this.dishesSource;
   }

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

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

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

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

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

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

   public String getCrby() {
      return this.crby;
   }

   public LocalDate getCrtime() {
      return this.crtime;
   }

   public String getUpby() {
      return this.upby;
   }

   public LocalDate getUptime() {
      return this.uptime;
   }

   public HealthDishesNutrition setId(final Long id) {
      this.id = id;
      return this;
   }

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

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

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

   public HealthDishesNutrition setActualWeight(final BigDecimal actualWeight) {
      this.actualWeight = actualWeight;
      return this;
   }

   public HealthDishesNutrition setStandardWeight(final BigDecimal standardWeight) {
      this.standardWeight = standardWeight;
      return this;
   }

   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd"
   )
   public HealthDishesNutrition setEatDate(final LocalDate eatDate) {
      this.eatDate = eatDate;
      return this;
   }

   public HealthDishesNutrition setMealtimeType(final Integer mealtimeType) {
      this.mealtimeType = mealtimeType;
      return this;
   }

   public HealthDishesNutrition setDishesSource(final Integer dishesSource) {
      this.dishesSource = dishesSource;
      return this;
   }

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

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

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

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

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

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

   public HealthDishesNutrition setCrby(final String crby) {
      this.crby = crby;
      return this;
   }

   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public HealthDishesNutrition setCrtime(final LocalDate crtime) {
      this.crtime = crtime;
      return this;
   }

   public HealthDishesNutrition setUpby(final String upby) {
      this.upby = upby;
      return this;
   }

   @JsonFormat(
      timezone = "GMT+8",
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public HealthDishesNutrition setUptime(final LocalDate uptime) {
      this.uptime = uptime;
      return this;
   }
}
