package com.bonus.canteen.core.device.android.buffet.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.bonus.canteen.core.order.weight.vo.MacWeighConsumVO;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.time.LocalDateTime;

public class BuffetOrdDetailVO {
   @ApiModelProperty("商品菜品id")
   private Long dishesId;
   @ApiModelProperty("菜品详情id")
   private Long detailId;
   @ApiModelProperty("菜品名称")
   private String menuName;
   @ApiModelProperty("菜品图片")
   private String menuImgUrl;
   @ApiModelProperty("菜品单价")
   private BigDecimal menuPrice;
   @ApiModelProperty("每份重量")
   private Integer weight;
   @ApiModelProperty("菜品重量")
   private Integer menuWeigh;
   @ApiModelProperty("销售方式 1按份2称重")
   private Integer salseMode;
   @ApiModelProperty("销售数量")
   private Integer quantity;
   @ApiModelProperty("终端编号")
   private String macNo;
   @ApiModelProperty("菜品总价")
   private Integer totalAmount;
   @ApiModelProperty("终端时间")
   @JSONField(
      format = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime macTime;
   @ApiModelProperty("终端流水号")
   private String submitKey;

   public static BuffetOrdDetailVO of(MacWeighConsumVO orderWeightDetailVO) {
      BuffetOrdDetailVO buffetOrdDetailVO = new BuffetOrdDetailVO();
      buffetOrdDetailVO.setDishesId(orderWeightDetailVO.getDishesId());
      buffetOrdDetailVO.setMenuImgUrl(orderWeightDetailVO.getMenuImgUrl());
      buffetOrdDetailVO.setDetailId(orderWeightDetailVO.getDetailId());
      buffetOrdDetailVO.setMenuPrice(orderWeightDetailVO.getMenuPrice());
      buffetOrdDetailVO.setWeight(orderWeightDetailVO.getWeight());
      buffetOrdDetailVO.setMenuWeigh(orderWeightDetailVO.getMenuWeigh());
      buffetOrdDetailVO.setQuantity(orderWeightDetailVO.getQuantity());
      buffetOrdDetailVO.setSalseMode(orderWeightDetailVO.getSalseMode());
      buffetOrdDetailVO.setMacNo(orderWeightDetailVO.getMacNo());
      buffetOrdDetailVO.setSubmitKey(orderWeightDetailVO.getSubmitKey());
      buffetOrdDetailVO.setTotalAmount(orderWeightDetailVO.getTotalAmount() != null ? orderWeightDetailVO.getTotalAmount() : 0);
      buffetOrdDetailVO.setMacTime(orderWeightDetailVO.getMacTime());
      buffetOrdDetailVO.setMenuName(orderWeightDetailVO.getDishesName());
      return buffetOrdDetailVO;
   }

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

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

   public String getMenuName() {
      return this.menuName;
   }

   public String getMenuImgUrl() {
      return this.menuImgUrl;
   }

   public BigDecimal getMenuPrice() {
      return this.menuPrice;
   }

   public Integer getWeight() {
      return this.weight;
   }

   public Integer getMenuWeigh() {
      return this.menuWeigh;
   }

   public Integer getSalseMode() {
      return this.salseMode;
   }

   public Integer getQuantity() {
      return this.quantity;
   }

   public String getMacNo() {
      return this.macNo;
   }

   public Integer getTotalAmount() {
      return this.totalAmount;
   }

   public LocalDateTime getMacTime() {
      return this.macTime;
   }

   public String getSubmitKey() {
      return this.submitKey;
   }

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

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

   public void setMenuName(final String menuName) {
      this.menuName = menuName;
   }

   public void setMenuImgUrl(final String menuImgUrl) {
      this.menuImgUrl = menuImgUrl;
   }

   public void setMenuPrice(final BigDecimal menuPrice) {
      this.menuPrice = menuPrice;
   }

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

   public void setMenuWeigh(final Integer menuWeigh) {
      this.menuWeigh = menuWeigh;
   }

   public void setSalseMode(final Integer salseMode) {
      this.salseMode = salseMode;
   }

   public void setQuantity(final Integer quantity) {
      this.quantity = quantity;
   }

   public void setMacNo(final String macNo) {
      this.macNo = macNo;
   }

   public void setTotalAmount(final Integer totalAmount) {
      this.totalAmount = totalAmount;
   }

   public void setMacTime(final LocalDateTime macTime) {
      this.macTime = macTime;
   }

   public void setSubmitKey(final String submitKey) {
      this.submitKey = submitKey;
   }

}
