package com.bonus.canteen.core.order.deprecated.dto;

import com.bonus.canteen.core.common.utils.SysUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;

public class MacPayOffLineDetailDTO {
   private Long detailId;
   private Long goodsId;
   private String goodsName;
   private String imageUrl;
   private Integer detailType;
   private Long intervalId;
   private String intervalName;
   private Integer price;
   private Integer prefPrice;
   private Integer unitPrice;
   private Integer quantity;
   private Integer correctQuantity;
   private String correctImgUrl;
   private String correctReason;
   private Integer totalAmount;
   private Integer salesMode;
   private String tasteName;
   private String inventoryId;

   public void setImageUrl(String imageUrl) {
      this.imageUrl = SysUtil.getCutPath(imageUrl);
   }

   public void setCorrectImgUrl(String correctImgUrl) {
      this.correctImgUrl = SysUtil.getCutPath(correctImgUrl);
   }

   @JsonIgnore
   public boolean hasUncheckCorrect() {
      return this.correctQuantity != null && this.correctQuantity > 0;
   }

   public Integer computeCorrectRefundQuantity() {
      return !this.hasUncheckCorrect() ? 0 : this.quantity - this.correctQuantity;
   }

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

   public Long getGoodsId() {
      return this.goodsId;
   }

   public String getGoodsName() {
      return this.goodsName;
   }

   public String getImageUrl() {
      return this.imageUrl;
   }

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

   public Long getIntervalId() {
      return this.intervalId;
   }

   public String getIntervalName() {
      return this.intervalName;
   }

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

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

   public Integer getUnitPrice() {
      return this.unitPrice;
   }

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

   public Integer getCorrectQuantity() {
      return this.correctQuantity;
   }

   public String getCorrectImgUrl() {
      return this.correctImgUrl;
   }

   public String getCorrectReason() {
      return this.correctReason;
   }

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

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

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

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

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

   public void setGoodsId(final Long goodsId) {
      this.goodsId = goodsId;
   }

   public void setGoodsName(final String goodsName) {
      this.goodsName = goodsName;
   }

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

   public void setIntervalId(final Long intervalId) {
      this.intervalId = intervalId;
   }

   public void setIntervalName(final String intervalName) {
      this.intervalName = intervalName;
   }

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

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

   public void setUnitPrice(final Integer unitPrice) {
      this.unitPrice = unitPrice;
   }

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

   public void setCorrectQuantity(final Integer correctQuantity) {
      this.correctQuantity = correctQuantity;
   }

   public void setCorrectReason(final String correctReason) {
      this.correctReason = correctReason;
   }

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

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

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

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

}
