package com.bonus.core.order.mobile.dto;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import com.sun.istack.NotNull;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

public class OrderShoppingSearchDTO {
   @ApiModelProperty(
      value = "人员id",
      hidden = true
   )
   private @NotNull
   Long custId;
   @ApiModelProperty("订单类型")
   private @NotNull Integer orderType;
   @ApiModelProperty("食堂/超市id")
   private Long canteenId;
   @ApiModelProperty("档口id")
   private Long stallId;
   @ApiModelProperty("食堂/超市id范围")
   private List<Long> canteenIdList;

   public List<Long> getCanteenIdList() {
      if (CollUtil.isNotEmpty(this.canteenIdList)) {
         return this.canteenIdList;
      } else {
         return (List)(this.canteenId != null ? CollUtil.newArrayList(new Long[]{this.canteenId}) : ListUtil.empty());
      }
   }

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

   public Integer getOrderType() {
      return this.orderType;
   }

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

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

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

   public OrderShoppingSearchDTO setOrderType(final Integer orderType) {
      this.orderType = orderType;
      return this;
   }

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

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

   public OrderShoppingSearchDTO setCanteenIdList(final List<Long> canteenIdList) {
      this.canteenIdList = canteenIdList;
      return this;
   }

   @Override
   public boolean equals(final Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof OrderShoppingSearchDTO)) {
         return false;
      } else {
         OrderShoppingSearchDTO other = (OrderShoppingSearchDTO)o;
         if (!other.canEqual(this)) {
            return false;
         } else {
            label71: {
               Object this$custId = this.getCustId();
               Object other$custId = other.getCustId();
               if (this$custId == null) {
                  if (other$custId == null) {
                     break label71;
                  }
               } else if (this$custId.equals(other$custId)) {
                  break label71;
               }

               return false;
            }

            Object this$orderType = this.getOrderType();
            Object other$orderType = other.getOrderType();
            if (this$orderType == null) {
               if (other$orderType != null) {
                  return false;
               }
            } else if (!this$orderType.equals(other$orderType)) {
               return false;
            }

            label57: {
               Object this$canteenId = this.getCanteenId();
               Object other$canteenId = other.getCanteenId();
               if (this$canteenId == null) {
                  if (other$canteenId == null) {
                     break label57;
                  }
               } else if (this$canteenId.equals(other$canteenId)) {
                  break label57;
               }

               return false;
            }

            Object this$stallId = this.getStallId();
            Object other$stallId = other.getStallId();
            if (this$stallId == null) {
               if (other$stallId != null) {
                  return false;
               }
            } else if (!this$stallId.equals(other$stallId)) {
               return false;
            }

            Object this$canteenIdList = this.getCanteenIdList();
            Object other$canteenIdList = other.getCanteenIdList();
            if (this$canteenIdList == null) {
               if (other$canteenIdList == null) {
                  return true;
               }
            } else if (this$canteenIdList.equals(other$canteenIdList)) {
               return true;
            }

            return false;
         }
      }
   }

   protected boolean canEqual(final Object other) {
      return other instanceof OrderShoppingSearchDTO;
   }

   @Override
   public int hashCode() {
      int result = 1;
      Object $custId = this.getCustId();
      result = result * 59 + ($custId == null ? 43 : $custId.hashCode());
      Object $orderType = this.getOrderType();
      result = result * 59 + ($orderType == null ? 43 : $orderType.hashCode());
      Object $canteenId = this.getCanteenId();
      result = result * 59 + ($canteenId == null ? 43 : $canteenId.hashCode());
      Object $stallId = this.getStallId();
      result = result * 59 + ($stallId == null ? 43 : $stallId.hashCode());
      Object $canteenIdList = this.getCanteenIdList();
      result = result * 59 + ($canteenIdList == null ? 43 : $canteenIdList.hashCode());
      return result;
   }

   @Override
   public String toString() {
      Long var10000 = this.getCustId();
      return "OrderShoppingSearchDTO(custId=" + var10000 + ", orderType=" + this.getOrderType() + ", canteenId=" + this.getCanteenId() + ", stallId=" + this.getStallId() + ", canteenIdList=" + String.valueOf(this.getCanteenIdList()) + ")";
   }
}
