package com.bonus.core.order.common.vo;

import cn.hutool.core.bean.BeanUtil;
import com.bonus.core.common.utils.SysUtil;
import com.bonus.core.order.common.model.OrderDetail;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

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

public class OrderDetailVO implements OrderDetailWithImage {
   private Long detailId;
   private Long orderId;
   private String submitKey;
   private String machineSn;
   private Long goodsDishesId;
   private String goodsDishesName;
   private String goodsDishesImgUrl;
   private Long menuDetailId;
   private BigDecimal salePrice;
   private BigDecimal prefPrice;
   private BigDecimal price;
   private Integer weightUnit;
   private Integer quantity;
   private String unitName;
   private BigDecimal totalAmount;
   private BigDecimal calcTotalAmount;
   private BigDecimal realAmount;
   private BigDecimal refundAmount;
   private Integer salesMode;
   private Integer detailType;
   private String tasteName;
   private Integer detailState;
   private Integer goodsGetNum;
   private Integer goodsRefundNum;
   private String inventoryId;
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private LocalDateTime crtime;

   public String getImageUrl() {
      return SysUtil.getCutFileUrl(this.goodsDishesImgUrl);
   }

   public String getGoodsDishesImgUrl() {
      return SysUtil.getCutFileUrl(this.goodsDishesImgUrl);
   }

   public static OrderDetailVO of(OrderDetail orderDetail) {
      return (OrderDetailVO)BeanUtil.copyProperties(orderDetail, OrderDetailVO.class, new String[0]);
   }

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

   public Long getOrderId() {
      return this.orderId;
   }

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

   public String getMachineSn() {
      return this.machineSn;
   }

   public Long getGoodsDishesId() {
      return this.goodsDishesId;
   }

   public String getGoodsDishesName() {
      return this.goodsDishesName;
   }

   public Long getMenuDetailId() {
      return this.menuDetailId;
   }

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

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

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

   public Integer getWeightUnit() {
      return this.weightUnit;
   }

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

   public String getUnitName() {
      return this.unitName;
   }

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

   public BigDecimal getCalcTotalAmount() {
      return this.calcTotalAmount;
   }

   public BigDecimal getRealAmount() {
      return this.realAmount;
   }

   public BigDecimal getRefundAmount() {
      return this.refundAmount;
   }

   public Integer getSalesMode() {
      return this.salesMode;
   }

   public Integer getDetailType() {
      return this.detailType;
   }

   public String getTasteName() {
      return this.tasteName;
   }

   public Integer getDetailState() {
      return this.detailState;
   }

   public Integer getGoodsGetNum() {
      return this.goodsGetNum;
   }

   public Integer getGoodsRefundNum() {
      return this.goodsRefundNum;
   }

   public String getInventoryId() {
      return this.inventoryId;
   }

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

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

   public void setOrderId(final Long orderId) {
      this.orderId = orderId;
   }

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

   public void setMachineSn(final String machineSn) {
      this.machineSn = machineSn;
   }

   public void setGoodsDishesId(final Long goodsDishesId) {
      this.goodsDishesId = goodsDishesId;
   }

   public void setGoodsDishesName(final String goodsDishesName) {
      this.goodsDishesName = goodsDishesName;
   }

   public void setGoodsDishesImgUrl(final String goodsDishesImgUrl) {
      this.goodsDishesImgUrl = goodsDishesImgUrl;
   }

   public void setMenuDetailId(final Long menuDetailId) {
      this.menuDetailId = menuDetailId;
   }

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

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

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

   public void setWeightUnit(final Integer weightUnit) {
      this.weightUnit = weightUnit;
   }

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

   public void setUnitName(final String unitName) {
      this.unitName = unitName;
   }

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

   public void setCalcTotalAmount(final BigDecimal calcTotalAmount) {
      this.calcTotalAmount = calcTotalAmount;
   }

   public void setRealAmount(final BigDecimal realAmount) {
      this.realAmount = realAmount;
   }

   public void setRefundAmount(final BigDecimal refundAmount) {
      this.refundAmount = refundAmount;
   }

   public void setSalesMode(final Integer salesMode) {
      this.salesMode = salesMode;
   }

   public void setDetailType(final Integer detailType) {
      this.detailType = detailType;
   }

   public void setTasteName(final String tasteName) {
      this.tasteName = tasteName;
   }

   public void setDetailState(final Integer detailState) {
      this.detailState = detailState;
   }

   public void setGoodsGetNum(final Integer goodsGetNum) {
      this.goodsGetNum = goodsGetNum;
   }

   public void setGoodsRefundNum(final Integer goodsRefundNum) {
      this.goodsRefundNum = goodsRefundNum;
   }

   public void setInventoryId(final String inventoryId) {
      this.inventoryId = inventoryId;
   }

   @JsonFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

   public String toString() {
      Long var10000 = this.getDetailId();
      return "OrderDetailVO(detailId=" + var10000 + ", orderId=" + this.getOrderId() + ", submitKey=" + this.getSubmitKey() + ", machineSn=" + this.getMachineSn() + ", goodsDishesId=" + this.getGoodsDishesId() + ", goodsDishesName=" + this.getGoodsDishesName() + ", goodsDishesImgUrl=" + this.getGoodsDishesImgUrl() + ", menuDetailId=" + this.getMenuDetailId() + ", salePrice=" + String.valueOf(this.getSalePrice()) + ", prefPrice=" + String.valueOf(this.getPrefPrice()) + ", price=" + String.valueOf(this.getPrice()) + ", weightUnit=" + this.getWeightUnit() + ", quantity=" + this.getQuantity() + ", unitName=" + this.getUnitName() + ", totalAmount=" + String.valueOf(this.getTotalAmount()) + ", calcTotalAmount=" + String.valueOf(this.getCalcTotalAmount()) + ", realAmount=" + String.valueOf(this.getRealAmount()) + ", refundAmount=" + String.valueOf(this.getRefundAmount()) + ", salesMode=" + this.getSalesMode() + ", detailType=" + this.getDetailType() + ", tasteName=" + this.getTasteName() + ", detailState=" + this.getDetailState() + ", goodsGetNum=" + this.getGoodsGetNum() + ", goodsRefundNum=" + this.getGoodsRefundNum() + ", inventoryId=" + this.getInventoryId() + ", crtime=" + String.valueOf(this.getCrtime()) + ")";
   }
}
