package com.bonus.core.menu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;
import java.util.Optional;

@TableName("menu_recipe_dishes")
@ApiModel("菜品计划菜品关联")
public class MenuRecipeDishes extends Model<MenuRecipeDishes> {
   private static final long serialVersionUID = 1L;
   @TableId
   @ApiModelProperty("主键id")
   private Long id;
   @ApiModelProperty("菜谱详情id")
   private Long detailId;
   @ApiModelProperty("菜品id")
   private Long dishesId;
   @ApiModelProperty("菜品单价")
   private Integer price;
   @ApiModelProperty("规格类型(1-标准,2-大份,3-小份,4-50g,5-100g)")
   private Long sizeType;
   @ApiModelProperty("供应数量")
   private Integer supplyNum;
   @ApiModelProperty("销售数量")
   private Integer saleNum;
   @ApiModelProperty("剩余数量")
   private Integer surplusNum;
   @ApiModelProperty("个人限购数量")
   private Integer restrictNum;
   @ApiModelProperty("菜品价格(优惠价)")
   private Integer salePrice;
   @ApiModelProperty("是否推荐")
   private Integer recommendFlag;
   @ApiModelProperty("排序号")
   private Integer sortNum;
   @ApiModelProperty("乐观锁")
   private Integer revision;
   @TableField(
      fill = FieldFill.INSERT
   )
   @ApiModelProperty("创建人")
   private String crby;
   @TableField(
      fill = FieldFill.INSERT
   )
   @ApiModelProperty("创建时间")
   private LocalDateTime crtime;
   @TableField(
      fill = FieldFill.INSERT_UPDATE
   )
   @ApiModelProperty("更新人")
   private String upby;
   @TableField(
      fill = FieldFill.INSERT_UPDATE
   )
   @ApiModelProperty("更新时间")
   private LocalDateTime uptime;

   public Integer getSortNum() {
      return (Integer)Optional.ofNullable(this.sortNum).orElse(-1);
   }

   public Integer getRecommendFlag() {
      return (Integer)Optional.ofNullable(this.recommendFlag).orElse(2);
   }

   public Integer getSaleNum() {
      return (Integer)Optional.ofNullable(this.saleNum).orElse(0);
   }

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

   public Long getDetailId() {
      return this.detailId;
   }

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

   public Integer getPrice() {
      return this.price;
   }

   public Long getSizeType() {
      return this.sizeType;
   }

   public Integer getSupplyNum() {
      return this.supplyNum;
   }

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

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

   public Integer getSalePrice() {
      return this.salePrice;
   }

   public Integer getRevision() {
      return this.revision;
   }

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

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

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

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

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

   public void setDetailId(final Long detailId) {
      this.detailId = detailId;
   }

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

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

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

   public void setSupplyNum(final Integer supplyNum) {
      this.supplyNum = supplyNum;
   }

   public void setSaleNum(final Integer saleNum) {
      this.saleNum = saleNum;
   }

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

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

   public void setSalePrice(final Integer salePrice) {
      this.salePrice = salePrice;
   }

   public void setRecommendFlag(final Integer recommendFlag) {
      this.recommendFlag = recommendFlag;
   }

   public void setSortNum(final Integer sortNum) {
      this.sortNum = sortNum;
   }

   public void setRevision(final Integer revision) {
      this.revision = revision;
   }

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

   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

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

   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }
}
