package com.bonus.canteen.core.menu.dto;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.bonus.canteen.core.common.page.PageDTO;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;

public class MenuEvaluaOrderPageDTO extends PageDTO {
   @ApiModelProperty("筛选评价时间开始")
   private LocalDateTime startTime;
   @ApiModelProperty("筛选评价时间结束")
   private LocalDateTime endTime;
   @ApiModelProperty("关键字(订单、人员名称)")
   private String keyword;
   @ApiModelProperty("1食堂订单2商超订单")
   private Integer orderEvaluaType;
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("食堂id")
   private Long canteenId;
   @ApiModelProperty("档口id")
   private Long stallId;
   @ApiModelProperty("餐次类型")
   private Integer mealtimeType;
   @ApiModelProperty("是否显示(1-显示,2-不显示)")
   private Integer showFlag;
   @ApiModelProperty("查询带图的评价")
   private Integer haveImage;
   @ApiModelProperty("需要导出列")
   private List<String> exportCols;
   @ApiModelProperty(
      value = "食堂ID范围",
      hidden = true
   )
   private Collection<Long> canteenIdList;
   @ApiModelProperty(
      value = "店铺档口id范围",
      hidden = true
   )
   private Collection<Long> stallIdList;
   @ApiModelProperty(
      value = "区域id范围",
      hidden = true
   )
   private Collection<Long> areaIdList;

   public Collection<Long> getCanteenIdList() {
      return CollUtil.isEmpty(this.canteenIdList) && this.canteenId != null ? ListUtil.toList(new Long[]{this.canteenId}) : ListUtil.toList(this.canteenIdList);
   }

   public Collection<Long> getStallIdList() {
      return CollUtil.isEmpty(this.stallIdList) && this.stallId != null ? ListUtil.toList(new Long[]{this.stallId}) : ListUtil.toList(this.stallIdList);
   }

   public String getKeyword() {
      return CharSequenceUtil.isBlank(this.keyword) ? "" : "%" + this.keyword + "%";
   }

   public LocalDateTime getStartTime() {
      return this.startTime;
   }

   public LocalDateTime getEndTime() {
      return this.endTime;
   }

   public Integer getOrderEvaluaType() {
      return this.orderEvaluaType;
   }

   public Long getCustId() {
      return this.custId;
   }

   public Long getCanteenId() {
      return this.canteenId;
   }

   public Long getStallId() {
      return this.stallId;
   }

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

   public Integer getShowFlag() {
      return this.showFlag;
   }

   public Integer getHaveImage() {
      return this.haveImage;
   }

   public List<String> getExportCols() {
      return this.exportCols;
   }

   public Collection<Long> getAreaIdList() {
      return this.areaIdList;
   }

   public void setStartTime(final LocalDateTime startTime) {
      this.startTime = startTime;
   }

   public void setEndTime(final LocalDateTime endTime) {
      this.endTime = endTime;
   }

   public void setKeyword(final String keyword) {
      this.keyword = keyword;
   }

   public void setOrderEvaluaType(final Integer orderEvaluaType) {
      this.orderEvaluaType = orderEvaluaType;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

   public void setCanteenId(final Long canteenId) {
      this.canteenId = canteenId;
   }

   public void setStallId(final Long stallId) {
      this.stallId = stallId;
   }

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

   public void setShowFlag(final Integer showFlag) {
      this.showFlag = showFlag;
   }

   public void setHaveImage(final Integer haveImage) {
      this.haveImage = haveImage;
   }

   public void setExportCols(final List<String> exportCols) {
      this.exportCols = exportCols;
   }

   public void setCanteenIdList(final Collection<Long> canteenIdList) {
      this.canteenIdList = canteenIdList;
   }

   public void setStallIdList(final Collection<Long> stallIdList) {
      this.stallIdList = stallIdList;
   }

   public void setAreaIdList(final Collection<Long> areaIdList) {
      this.areaIdList = areaIdList;
   }

}
