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

import cn.hutool.core.collection.CollUtil;
import com.bonus.canteen.core.order.android.dto.OrderCallQueryDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.util.List;

public class OrdCallListNewDTO {
   @ApiModelProperty(
      value = "订单状态",
      required = true
   )
   private @NotNull(
   message = "订单状态"
) Integer ordState;
   @JsonIgnore
   private Integer type;
   @ApiModelProperty(
      value = "食堂id",
      required = true
   )
   private Long canteenId;
   @ApiModelProperty("档口ids(集合),如果集合为空会查全部")
   private List<Long> shopstallIds;
   @ApiModelProperty("37为核销,38叫号 (从请求头获取不用传)")
   private String sourceType;
   @ApiModelProperty("设备sn码")
   private String machineSn;
   @ApiModelProperty(
      value = "页数",
      required = true
   )
   private @NotNull(
   message = "页数不能为空"
) Long size;
   @ApiModelProperty(
      value = "当前页",
      required = true
   )
   private @NotNull(
   message = "当前页不能为空"
) Long current;

   public OrderCallQueryDTO convertToOrderCallQueryDTO() {
      OrderCallQueryDTO orderCallQueryDTO = new OrderCallQueryDTO();
      orderCallQueryDTO.setMachineSn(this.machineSn);
      orderCallQueryDTO.setOrdState(this.ordState);
      orderCallQueryDTO.setStallId(CollUtil.isNotEmpty(this.shopstallIds) ? (Long)this.shopstallIds.get(0) : null);
      return orderCallQueryDTO;
   }

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

   public Integer getType() {
      return this.type;
   }

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

   public List<Long> getShopstallIds() {
      return this.shopstallIds;
   }

   public String getSourceType() {
      return this.sourceType;
   }

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

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

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

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

   @JsonIgnore
   public void setType(final Integer type) {
      this.type = type;
   }

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

   public void setShopstallIds(final List<Long> shopstallIds) {
      this.shopstallIds = shopstallIds;
   }

   public void setSourceType(final String sourceType) {
      this.sourceType = sourceType;
   }

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

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

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

}
