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

import cn.hutool.core.bean.BeanUtil;
import com.bonus.core.order.common.model.OrderShoppingCart;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

public class OrderShoppingCartAddDTO {
   @ApiModelProperty(
      value = "人员id",
      hidden = true
   )
   private Long custId;
   @ApiModelProperty("菜谱id")
   private Long menuId;
   @ApiModelProperty("商品/菜品id")
   private @NotNull
   Long goodsDishesId;
   @ApiModelProperty("食堂/超市id")
   private Long canteenId;
   @ApiModelProperty("档口id")
   private Long stallId;
   @ApiModelProperty("商品/菜品名称")
   private @NotNull @NotEmpty String goodsDishesName;
   @ApiModelProperty("订单类型")
   private @NotNull Integer orderType;
   @ApiModelProperty("明细类型")
   private @NotNull Integer detailType;
   @ApiModelProperty("数量/重量")
   private @NotNull @Min(1L) Integer quantity;
   @ApiModelProperty("订单日期")
   private LocalDate orderDate;
   @ApiModelProperty("餐次")
   private Integer mealtimeType;
   private JsonNode extParam;

   public OrderShoppingCart convertToEntity() {
      OrderShoppingCart entity = (OrderShoppingCart)BeanUtil.copyProperties(this, OrderShoppingCart.class, new String[0]);
      return entity;
   }

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

   public Long getMenuId() {
      return this.menuId;
   }

   public Long getGoodsDishesId() {
      return this.goodsDishesId;
   }

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

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

   public String getGoodsDishesName() {
      return this.goodsDishesName;
   }

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

   public Integer getDetailType() {
      return this.detailType;
   }

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

   public LocalDate getOrderDate() {
      return this.orderDate;
   }

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

   public JsonNode getExtParam() {
      return this.extParam;
   }

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

   public void setMenuId(final Long menuId) {
      this.menuId = menuId;
   }

   public void setGoodsDishesId(final Long goodsDishesId) {
      this.goodsDishesId = goodsDishesId;
   }

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

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

   public void setGoodsDishesName(final String goodsDishesName) {
      this.goodsDishesName = goodsDishesName;
   }

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

   public void setDetailType(final Integer detailType) {
      this.detailType = detailType;
   }

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

   public void setOrderDate(final LocalDate orderDate) {
      this.orderDate = orderDate;
   }

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

   public void setExtParam(final JsonNode extParam) {
      this.extParam = extParam;
   }

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

               return false;
            }

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

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

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

               return false;
            }

            label127: {
               Object this$stallId = this.getStallId();
               Object other$stallId = other.getStallId();
               if (this$stallId == null) {
                  if (other$stallId == null) {
                     break label127;
                  }
               } else if (this$stallId.equals(other$stallId)) {
                  break label127;
               }

               return false;
            }

            label120: {
               Object this$orderType = this.getOrderType();
               Object other$orderType = other.getOrderType();
               if (this$orderType == null) {
                  if (other$orderType == null) {
                     break label120;
                  }
               } else if (this$orderType.equals(other$orderType)) {
                  break label120;
               }

               return false;
            }

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

            label106: {
               Object this$quantity = this.getQuantity();
               Object other$quantity = other.getQuantity();
               if (this$quantity == null) {
                  if (other$quantity == null) {
                     break label106;
                  }
               } else if (this$quantity.equals(other$quantity)) {
                  break label106;
               }

               return false;
            }

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

            label92: {
               Object this$goodsDishesName = this.getGoodsDishesName();
               Object other$goodsDishesName = other.getGoodsDishesName();
               if (this$goodsDishesName == null) {
                  if (other$goodsDishesName == null) {
                     break label92;
                  }
               } else if (this$goodsDishesName.equals(other$goodsDishesName)) {
                  break label92;
               }

               return false;
            }

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

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

            return true;
         }
      }
   }

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

   @Override
   public int hashCode() {
      int result = 1;
      Object $custId = this.getCustId();
      result = result * 59 + ($custId == null ? 43 : $custId.hashCode());
      Object $menuId = this.getMenuId();
      result = result * 59 + ($menuId == null ? 43 : $menuId.hashCode());
      Object $goodsDishesId = this.getGoodsDishesId();
      result = result * 59 + ($goodsDishesId == null ? 43 : $goodsDishesId.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 $orderType = this.getOrderType();
      result = result * 59 + ($orderType == null ? 43 : $orderType.hashCode());
      Object $detailType = this.getDetailType();
      result = result * 59 + ($detailType == null ? 43 : $detailType.hashCode());
      Object $quantity = this.getQuantity();
      result = result * 59 + ($quantity == null ? 43 : $quantity.hashCode());
      Object $mealtimeType = this.getMealtimeType();
      result = result * 59 + ($mealtimeType == null ? 43 : $mealtimeType.hashCode());
      Object $goodsDishesName = this.getGoodsDishesName();
      result = result * 59 + ($goodsDishesName == null ? 43 : $goodsDishesName.hashCode());
      Object $orderDate = this.getOrderDate();
      result = result * 59 + ($orderDate == null ? 43 : $orderDate.hashCode());
      Object $extParam = this.getExtParam();
      result = result * 59 + ($extParam == null ? 43 : $extParam.hashCode());
      return result;
   }

   @Override
   public String toString() {
      Long var10000 = this.getCustId();
      return "OrderShoppingCartAddDTO(custId=" + var10000 + ", menuId=" + this.getMenuId() + ", goodsDishesId=" + this.getGoodsDishesId() + ", canteenId=" + this.getCanteenId() + ", stallId=" + this.getStallId() + ", goodsDishesName=" + this.getGoodsDishesName() + ", orderType=" + this.getOrderType() + ", detailType=" + this.getDetailType() + ", quantity=" + this.getQuantity() + ", orderDate=" + String.valueOf(this.getOrderDate()) + ", mealtimeType=" + this.getMealtimeType() + ", extParam=" + String.valueOf(this.getExtParam()) + ")";
   }
}
