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

import com.bonus.canteen.core.order.utils.LeNumUtil;
import com.bonus.canteen.core.report.api.dto.ReportOrderDetailDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDate;

@ApiModel("订单详情统计查询DTO")
public class OrdIntervalDetailStatDTO {
   @ApiModelProperty("当前页 默认值1")
   private Long current = 1L;
   @ApiModelProperty("每页条数 默认值10")
   private Long size = 10L;
   @ApiModelProperty("订单日期  yyyy-MM-dd")
   private LocalDate ordGoodsDate;
   @ApiModelProperty("餐次id")
   private Long intervalId;
   @ApiModelProperty("餐次类型")
   private Integer mealtimeType;
   @ApiModelProperty("商品名称")
   private String goodsName;

   public ReportOrderDetailDTO convertToReportOrderDetailDTO() {
      ReportOrderDetailDTO dto = new ReportOrderDetailDTO();
      dto.setCurrent(this.current);
      dto.setSize(this.size);
      dto.setOrdGoodsDate(this.ordGoodsDate);
      dto.setGoodsName(this.goodsName);
      if (LeNumUtil.isValidId(this.mealtimeType)) {
         dto.setMealtimeType(this.mealtimeType);
      } else if (LeNumUtil.isValidId(this.intervalId)) {
         dto.setMealtimeType(this.intervalId.intValue());
      }

      return dto;
   }

   public Long getCurrent() {
      return this.current;
   }

   public Long getSize() {
      return this.size;
   }

   public LocalDate getOrdGoodsDate() {
      return this.ordGoodsDate;
   }

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

   public Integer getMealtimeType() {
      return this.mealtimeType;
   }

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

   public void setCurrent(final Long current) {
      this.current = current;
   }

   public void setSize(final Long size) {
      this.size = size;
   }

   public void setOrdGoodsDate(final LocalDate ordGoodsDate) {
      this.ordGoodsDate = ordGoodsDate;
   }

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

   public void setMealtimeType(final Integer mealtimeType) {
      this.mealtimeType = mealtimeType;
   }

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

}
