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

import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.order.common.model.OrderDetail;
import io.swagger.annotations.ApiModelProperty;

public class OrdDetailMachineVO {
   private Long detailId;
   private Long orderId;
   private String goodsName;
   private Integer price;
   private Integer quantity;
   @ApiModelProperty("商品预定数量")
   private Integer goodsSubNum;
   @ApiModelProperty("商品领取数量")
   private Integer goodsGetNum;
   private Integer unitPrice;
   @ApiModelProperty("销售方式 1按份,2称重 默认按份")
   private String unit;
   @ApiModelProperty("订单状态 接受单、拒绝订单、取消、退款、完成")
   private Integer ordState;
   @ApiModelProperty(
      value = "售卖方式",
      hidden = true
   )
   private Integer salesMode;
   @ApiModelProperty("订单详情总金额 分")
   private Integer totalAmount;
   @ApiModelProperty("实际付款金额 单位为分")
   private Integer realAmount;
   @ApiModelProperty("商品已退数量")
   private Integer goodsRefundNum;
   @ApiModelProperty("申请退单数量")
   private Integer applyRefundNum;
   @ApiModelProperty("实际退单数量")
   private Integer realRefundNum;
   @ApiModelProperty("图片url")
   private String imageUrl;

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

   public static OrdDetailMachineVO of(OrderDetail detail) {
      OrdDetailMachineVO detailMachineVO = new OrdDetailMachineVO();
      detailMachineVO.setDetailId(detail.getDetailId());
      detailMachineVO.setOrderId(detail.getOrderId());
      detailMachineVO.setGoodsName(detail.getGoodsDishesName());
      detailMachineVO.setPrice(detail.getPrice().intValue());
      detailMachineVO.setUnit(detail.getSalesMode().toString());
      detailMachineVO.setGoodsGetNum(detail.getGoodsGetNum());
      detailMachineVO.setGoodsSubNum(detail.getQuantity());
      detailMachineVO.setQuantity(detail.getQuantity());
      detailMachineVO.setTotalAmount(detail.getTotalAmount().intValue());
      detailMachineVO.setRealAmount(detail.getRealAmount().intValue());
      detailMachineVO.setOrdState(detail.getDetailState());
      detailMachineVO.setSalesMode(detail.getSalesMode());
      detailMachineVO.setGoodsRefundNum(detailMachineVO.getGoodsRefundNum());
      return detailMachineVO;
   }

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

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

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

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

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

   public Integer getGoodsSubNum() {
      return this.goodsSubNum;
   }

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

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

   public String getUnit() {
      return this.unit;
   }

   public Integer getOrdState() {
      return this.ordState;
   }

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

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

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

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

   public Integer getApplyRefundNum() {
      return this.applyRefundNum;
   }

   public Integer getRealRefundNum() {
      return this.realRefundNum;
   }

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

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

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

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

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

   public void setGoodsSubNum(final Integer goodsSubNum) {
      this.goodsSubNum = goodsSubNum;
   }

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

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

   public void setUnit(final String unit) {
      this.unit = unit;
   }

   public void setOrdState(final Integer ordState) {
      this.ordState = ordState;
   }

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

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

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

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

   public void setApplyRefundNum(final Integer applyRefundNum) {
      this.applyRefundNum = applyRefundNum;
   }

   public void setRealRefundNum(final Integer realRefundNum) {
      this.realRefundNum = realRefundNum;
   }

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

}
