package com.bonus.canteen.core.order.mobile.vo;

import cn.hutool.core.bean.BeanUtil;
import com.bonus.common.houqin.constant.LeConstants;
import com.bonus.canteen.core.allocation.canteen.model.AllocDeliveryCostModel;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.menu.vo.CheckDishesVo;
import com.bonus.canteen.core.order.common.model.OrderShoppingCart;
import com.bonus.canteen.core.supermarket.vo.SupermarketNotRemovedProductListVO;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

public class OrderShoppingCartListMobileVO {
   private Long shoppingCartId;
   private Long custId;
   private Long menuId;
   private Long goodsDishesId;
   private String goodsDishesName;
   private String goodsDishesImgUrl;
   private Long canteenId;
   private String canteenName;
   private Long stallId;
   private String stallName;
   private Integer detailType;
   private Integer orderType;
   private LocalDate orderDate;
   private Integer mealtimeType;
   private String mealtimeName;
   private Integer quantity;
   private JsonNode extParam;
   private Integer ifExpired;
   private Long menuDetailId;
   private BigDecimal salePrice;
   private BigDecimal prefPrice;
   private Integer weightUnit;
   private String unitName;
   private Integer salesMode;
   private Integer surplusNum;
   private Integer restrictNum;
   private Long sizeType;
   private String sizeJson;
   private Long inventoryId;
   @ApiModelProperty("配送方式列表")
   private List<AllocDeliveryCostModel> costModelList;

   public static OrderShoppingCartListMobileVO of(OrderShoppingCart orderShoppingCart) {
      OrderShoppingCartListMobileVO vo = (OrderShoppingCartListMobileVO)BeanUtil.copyProperties(orderShoppingCart, OrderShoppingCartListMobileVO.class, new String[0]);
      return vo;
   }

   public String getGoodsDishesImgUrl() {
      return SysUtil.getCutFileUrl(this.goodsDishesImgUrl);
   }

   public boolean ifInvalid() {
      return LeConstants.COMMON_YES.equals(this.ifExpired) || this.surplusNum != null && this.surplusNum <= 0;
   }

   public void fillSupermarketProductInfo(SupermarketNotRemovedProductListVO productVO) {
      if (productVO != null) {
         this.ifExpired = productVO.ifExpired() ? LeConstants.COMMON_YES : LeConstants.COMMON_NO;
         this.goodsDishesName = productVO.getMaterialName();
         this.goodsDishesImgUrl = productVO.getImageUrl();
         this.menuDetailId = productVO.getSupermarketDetailId();
         this.salePrice = productVO.getSalePrice();
         this.prefPrice = productVO.getPrefPrice();
         this.unitName = productVO.getUnitName();
         this.salesMode = productVO.getSalesMode();
         this.surplusNum = productVO.getInventoryNum().intValue();
         this.restrictNum = productVO.getPersonLimit();
         this.inventoryId = productVO.getInventoryId();
      } else {
         this.ifExpired = LeConstants.COMMON_YES;
      }

   }

   public void fillDishesInfo(CheckDishesVo dishesVo) {
      if (dishesVo != null) {
         this.ifExpired = dishesVo.getIfExpired();
         this.goodsDishesName = dishesVo.getGoodsDishesName();
         this.goodsDishesImgUrl = dishesVo.getImageUrl();
         this.menuDetailId = dishesVo.getMenuDetailId();
         this.salePrice = dishesVo.getSalePrice();
         this.prefPrice = dishesVo.getPrefPrice();
         this.unitName = dishesVo.getUnitName();
         this.weightUnit = dishesVo.getWeightUnit();
         this.salesMode = dishesVo.getSalesMode();
         this.surplusNum = dishesVo.getSurplusNum();
         this.restrictNum = dishesVo.getRestrictNum();
         this.orderDate = dishesVo.getOrderDate();
         this.mealtimeType = dishesVo.getMealtimeType();
         this.costModelList = dishesVo.getCostModelList();
         this.sizeType = dishesVo.getSizeType();
         this.sizeJson = dishesVo.getSizeJson();
      } else {
         this.ifExpired = LeConstants.COMMON_YES;
      }

   }

   public Long getShoppingCartId() {
      return this.shoppingCartId;
   }

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

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

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

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

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

   public String getCanteenName() {
      return this.canteenName;
   }

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

   public String getStallName() {
      return this.stallName;
   }

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

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

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

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

   public String getMealtimeName() {
      return this.mealtimeName;
   }

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

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

   public Integer getIfExpired() {
      return this.ifExpired;
   }

   public Long getMenuDetailId() {
      return this.menuDetailId;
   }

   public BigDecimal getSalePrice() {
      return this.salePrice;
   }

   public BigDecimal getPrefPrice() {
      return this.prefPrice;
   }

   public Integer getWeightUnit() {
      return this.weightUnit;
   }

   public String getUnitName() {
      return this.unitName;
   }

   public Integer getSalesMode() {
      return this.salesMode;
   }

   public Integer getSurplusNum() {
      return this.surplusNum;
   }

   public Integer getRestrictNum() {
      return this.restrictNum;
   }

   public Long getSizeType() {
      return this.sizeType;
   }

   public String getSizeJson() {
      return this.sizeJson;
   }

   public Long getInventoryId() {
      return this.inventoryId;
   }

   public List<AllocDeliveryCostModel> getCostModelList() {
      return this.costModelList;
   }

   public void setShoppingCartId(final Long shoppingCartId) {
      this.shoppingCartId = shoppingCartId;
   }

   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 setGoodsDishesName(final String goodsDishesName) {
      this.goodsDishesName = goodsDishesName;
   }

   public void setGoodsDishesImgUrl(final String goodsDishesImgUrl) {
      this.goodsDishesImgUrl = goodsDishesImgUrl;
   }

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

   public void setCanteenName(final String canteenName) {
      this.canteenName = canteenName;
   }

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

   public void setStallName(final String stallName) {
      this.stallName = stallName;
   }

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

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

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

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

   public void setMealtimeName(final String mealtimeName) {
      this.mealtimeName = mealtimeName;
   }

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

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

   public void setIfExpired(final Integer ifExpired) {
      this.ifExpired = ifExpired;
   }

   public void setMenuDetailId(final Long menuDetailId) {
      this.menuDetailId = menuDetailId;
   }

   public void setSalePrice(final BigDecimal salePrice) {
      this.salePrice = salePrice;
   }

   public void setPrefPrice(final BigDecimal prefPrice) {
      this.prefPrice = prefPrice;
   }

   public void setWeightUnit(final Integer weightUnit) {
      this.weightUnit = weightUnit;
   }

   public void setUnitName(final String unitName) {
      this.unitName = unitName;
   }

   public void setSalesMode(final Integer salesMode) {
      this.salesMode = salesMode;
   }

   public void setSurplusNum(final Integer surplusNum) {
      this.surplusNum = surplusNum;
   }

   public void setRestrictNum(final Integer restrictNum) {
      this.restrictNum = restrictNum;
   }

   public void setSizeType(final Long sizeType) {
      this.sizeType = sizeType;
   }

   public void setSizeJson(final String sizeJson) {
      this.sizeJson = sizeJson;
   }

   public void setInventoryId(final Long inventoryId) {
      this.inventoryId = inventoryId;
   }

   public void setCostModelList(final List<AllocDeliveryCostModel> costModelList) {
      this.costModelList = costModelList;
   }

   @Override
   public boolean equals(final Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof OrderShoppingCartListMobileVO)) {
         return false;
      } else {
         OrderShoppingCartListMobileVO other = (OrderShoppingCartListMobileVO)o;
         if (!other.canEqual(this)) {
            return false;
         } else {
            Object this$shoppingCartId = this.getShoppingCartId();
            Object other$shoppingCartId = other.getShoppingCartId();
            if (this$shoppingCartId == null) {
               if (other$shoppingCartId != null) {
                  return false;
               }
            } else if (!this$shoppingCartId.equals(other$shoppingCartId)) {
               return false;
            }

            Object this$custId = this.getCustId();
            Object other$custId = other.getCustId();
            if (this$custId == null) {
               if (other$custId != null) {
                  return false;
               }
            } else if (!this$custId.equals(other$custId)) {
               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;
            }

            label350: {
               Object this$goodsDishesId = this.getGoodsDishesId();
               Object other$goodsDishesId = other.getGoodsDishesId();
               if (this$goodsDishesId == null) {
                  if (other$goodsDishesId == null) {
                     break label350;
                  }
               } else if (this$goodsDishesId.equals(other$goodsDishesId)) {
                  break label350;
               }

               return false;
            }

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

               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;
            }

            label329: {
               Object this$detailType = this.getDetailType();
               Object other$detailType = other.getDetailType();
               if (this$detailType == null) {
                  if (other$detailType == null) {
                     break label329;
                  }
               } else if (this$detailType.equals(other$detailType)) {
                  break label329;
               }

               return false;
            }

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

               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;
            }

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

            label301: {
               Object this$ifExpired = this.getIfExpired();
               Object other$ifExpired = other.getIfExpired();
               if (this$ifExpired == null) {
                  if (other$ifExpired == null) {
                     break label301;
                  }
               } else if (this$ifExpired.equals(other$ifExpired)) {
                  break label301;
               }

               return false;
            }

            label294: {
               Object this$menuDetailId = this.getMenuDetailId();
               Object other$menuDetailId = other.getMenuDetailId();
               if (this$menuDetailId == null) {
                  if (other$menuDetailId == null) {
                     break label294;
                  }
               } else if (this$menuDetailId.equals(other$menuDetailId)) {
                  break label294;
               }

               return false;
            }

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

            label280: {
               Object this$salesMode = this.getSalesMode();
               Object other$salesMode = other.getSalesMode();
               if (this$salesMode == null) {
                  if (other$salesMode == null) {
                     break label280;
                  }
               } else if (this$salesMode.equals(other$salesMode)) {
                  break label280;
               }

               return false;
            }

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

            label266: {
               Object this$restrictNum = this.getRestrictNum();
               Object other$restrictNum = other.getRestrictNum();
               if (this$restrictNum == null) {
                  if (other$restrictNum == null) {
                     break label266;
                  }
               } else if (this$restrictNum.equals(other$restrictNum)) {
                  break label266;
               }

               return false;
            }

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

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

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

            label238: {
               Object this$goodsDishesImgUrl = this.getGoodsDishesImgUrl();
               Object other$goodsDishesImgUrl = other.getGoodsDishesImgUrl();
               if (this$goodsDishesImgUrl == null) {
                  if (other$goodsDishesImgUrl == null) {
                     break label238;
                  }
               } else if (this$goodsDishesImgUrl.equals(other$goodsDishesImgUrl)) {
                  break label238;
               }

               return false;
            }

            label231: {
               Object this$canteenName = this.getCanteenName();
               Object other$canteenName = other.getCanteenName();
               if (this$canteenName == null) {
                  if (other$canteenName == null) {
                     break label231;
                  }
               } else if (this$canteenName.equals(other$canteenName)) {
                  break label231;
               }

               return false;
            }

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

            label217: {
               Object this$orderDate = this.getOrderDate();
               Object other$orderDate = other.getOrderDate();
               if (this$orderDate == null) {
                  if (other$orderDate == null) {
                     break label217;
                  }
               } else if (this$orderDate.equals(other$orderDate)) {
                  break label217;
               }

               return false;
            }

            label210: {
               Object this$mealtimeName = this.getMealtimeName();
               Object other$mealtimeName = other.getMealtimeName();
               if (this$mealtimeName == null) {
                  if (other$mealtimeName == null) {
                     break label210;
                  }
               } else if (this$mealtimeName.equals(other$mealtimeName)) {
                  break label210;
               }

               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;
            }

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

            label189: {
               Object this$prefPrice = this.getPrefPrice();
               Object other$prefPrice = other.getPrefPrice();
               if (this$prefPrice == null) {
                  if (other$prefPrice == null) {
                     break label189;
                  }
               } else if (this$prefPrice.equals(other$prefPrice)) {
                  break label189;
               }

               return false;
            }

            label182: {
               Object this$unitName = this.getUnitName();
               Object other$unitName = other.getUnitName();
               if (this$unitName == null) {
                  if (other$unitName == null) {
                     break label182;
                  }
               } else if (this$unitName.equals(other$unitName)) {
                  break label182;
               }

               return false;
            }

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

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

            return true;
         }
      }
   }

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

   @Override
   public int hashCode() {
      int result = 1;
      Object $shoppingCartId = this.getShoppingCartId();
      result = result * 59 + ($shoppingCartId == null ? 43 : $shoppingCartId.hashCode());
      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 $detailType = this.getDetailType();
      result = result * 59 + ($detailType == null ? 43 : $detailType.hashCode());
      Object $orderType = this.getOrderType();
      result = result * 59 + ($orderType == null ? 43 : $orderType.hashCode());
      Object $mealtimeType = this.getMealtimeType();
      result = result * 59 + ($mealtimeType == null ? 43 : $mealtimeType.hashCode());
      Object $quantity = this.getQuantity();
      result = result * 59 + ($quantity == null ? 43 : $quantity.hashCode());
      Object $ifExpired = this.getIfExpired();
      result = result * 59 + ($ifExpired == null ? 43 : $ifExpired.hashCode());
      Object $menuDetailId = this.getMenuDetailId();
      result = result * 59 + ($menuDetailId == null ? 43 : $menuDetailId.hashCode());
      Object $weightUnit = this.getWeightUnit();
      result = result * 59 + ($weightUnit == null ? 43 : $weightUnit.hashCode());
      Object $salesMode = this.getSalesMode();
      result = result * 59 + ($salesMode == null ? 43 : $salesMode.hashCode());
      Object $surplusNum = this.getSurplusNum();
      result = result * 59 + ($surplusNum == null ? 43 : $surplusNum.hashCode());
      Object $restrictNum = this.getRestrictNum();
      result = result * 59 + ($restrictNum == null ? 43 : $restrictNum.hashCode());
      Object $sizeType = this.getSizeType();
      result = result * 59 + ($sizeType == null ? 43 : $sizeType.hashCode());
      Object $inventoryId = this.getInventoryId();
      result = result * 59 + ($inventoryId == null ? 43 : $inventoryId.hashCode());
      Object $goodsDishesName = this.getGoodsDishesName();
      result = result * 59 + ($goodsDishesName == null ? 43 : $goodsDishesName.hashCode());
      Object $goodsDishesImgUrl = this.getGoodsDishesImgUrl();
      result = result * 59 + ($goodsDishesImgUrl == null ? 43 : $goodsDishesImgUrl.hashCode());
      Object $canteenName = this.getCanteenName();
      result = result * 59 + ($canteenName == null ? 43 : $canteenName.hashCode());
      Object $stallName = this.getStallName();
      result = result * 59 + ($stallName == null ? 43 : $stallName.hashCode());
      Object $orderDate = this.getOrderDate();
      result = result * 59 + ($orderDate == null ? 43 : $orderDate.hashCode());
      Object $mealtimeName = this.getMealtimeName();
      result = result * 59 + ($mealtimeName == null ? 43 : $mealtimeName.hashCode());
      Object $extParam = this.getExtParam();
      result = result * 59 + ($extParam == null ? 43 : $extParam.hashCode());
      Object $salePrice = this.getSalePrice();
      result = result * 59 + ($salePrice == null ? 43 : $salePrice.hashCode());
      Object $prefPrice = this.getPrefPrice();
      result = result * 59 + ($prefPrice == null ? 43 : $prefPrice.hashCode());
      Object $unitName = this.getUnitName();
      result = result * 59 + ($unitName == null ? 43 : $unitName.hashCode());
      Object $sizeJson = this.getSizeJson();
      result = result * 59 + ($sizeJson == null ? 43 : $sizeJson.hashCode());
      Object $costModelList = this.getCostModelList();
      result = result * 59 + ($costModelList == null ? 43 : $costModelList.hashCode());
      return result;
   }

   @Override
   public String toString() {
      Long var10000 = this.getShoppingCartId();
      return "OrderShoppingCartListMobileVO(shoppingCartId=" + var10000 + ", custId=" + this.getCustId() + ", menuId=" + this.getMenuId() + ", goodsDishesId=" + this.getGoodsDishesId() + ", goodsDishesName=" + this.getGoodsDishesName() + ", goodsDishesImgUrl=" + this.getGoodsDishesImgUrl() + ", canteenId=" + this.getCanteenId() + ", canteenName=" + this.getCanteenName() + ", stallId=" + this.getStallId() + ", stallName=" + this.getStallName() + ", detailType=" + this.getDetailType() + ", orderType=" + this.getOrderType() + ", orderDate=" + String.valueOf(this.getOrderDate()) + ", mealtimeType=" + this.getMealtimeType() + ", mealtimeName=" + this.getMealtimeName() + ", quantity=" + this.getQuantity() + ", extParam=" + String.valueOf(this.getExtParam()) + ", ifExpired=" + this.getIfExpired() + ", menuDetailId=" + this.getMenuDetailId() + ", salePrice=" + String.valueOf(this.getSalePrice()) + ", prefPrice=" + String.valueOf(this.getPrefPrice()) + ", weightUnit=" + this.getWeightUnit() + ", unitName=" + this.getUnitName() + ", salesMode=" + this.getSalesMode() + ", surplusNum=" + this.getSurplusNum() + ", restrictNum=" + this.getRestrictNum() + ", sizeType=" + this.getSizeType() + ", sizeJson=" + this.getSizeJson() + ", inventoryId=" + this.getInventoryId() + ", costModelList=" + String.valueOf(this.getCostModelList()) + ")";
   }
}
