From 8243c06e629d79bba0388e6fb4f0e1ae70281ded Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 25 Mar 2022 12:30:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/feature/订单服务单代码改造' into feature/订单服务单代码改造
---
zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java
index 7c8ddf9..287a6a9 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/ShoppingGoodsServiceImpl.java
@@ -18,7 +18,7 @@
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.dto.GoodsSealLimitDto;
-import com.matrix.system.hive.dto.OrderItemDto;
+import com.matrix.system.hive.dto.SysOrderItemDto;
import com.matrix.system.hive.service.ShoppingGoodsService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -64,17 +64,17 @@
//校验参数不能为空
checkGoodsSelLimtParam(goodsSealLimitDto);
- goodsSealLimitDto.getOrderItemDtoList().forEach(item -> {
+ goodsSealLimitDto.getSysOrderItemDtoList().forEach(item -> {
ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId());
//最大销售次数检测
Integer maxNum = shopGoods.getCarMaxSaleCount();
if (maxNum != null && maxNum != 0) {
Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(), null);
- if ((buyNum + item.getCount()) == maxNum) {
+ if (buyNum.equals(maxNum)) {
if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) {
shopGoods.setStaus(Dictionary.BUSINESS_STATE_DOWN);
shoppingGoodsDao.update(shopGoods);
- LogUtil.info("{}商品达到最大销售数量自动下架",shopGoods.getName());
+ LogUtil.info("商品达到最大销售数量自动下架:{}", shopGoods.getName());
}
} else if ((buyNum + item.getCount()) > maxNum) {
throw new GlobleException(shopGoods.getName() + "已超过最大销售数量");
@@ -92,17 +92,14 @@
}
-
-
-
private void checkGoodsSelLimtParam(GoodsSealLimitDto goodsSealLimitDto) {
ParamCheckUtil.requireNonNulls(goodsSealLimitDto,
goodsSealLimitDto.getVipId(),
- goodsSealLimitDto.getOrderItemDtoList());
+ goodsSealLimitDto.getSysOrderItemDtoList());
- ParamCheckUtil.requireListElementNonNull(goodsSealLimitDto.getOrderItemDtoList(),
- Arrays.asList(OrderItemDto::getCount, OrderItemDto::getGoodsId));
+ ParamCheckUtil.requireListElementNonNull(goodsSealLimitDto.getSysOrderItemDtoList(),
+ Arrays.asList(SysOrderItemDto::getCount, SysOrderItemDto::getGoodsId));
}
@@ -391,9 +388,6 @@
shoppingGoods.setIsAssemble(Dictionary.FLAG_NO);
break;
case Dictionary.SHOPPING_GOODS_TYPE_TC:
- shoppingGoods.setIsAssemble(Dictionary.FLAG_YES);
- break;
- case Dictionary.SHOPPING_GOODS_TYPE_ZHK:
shoppingGoods.setIsAssemble(Dictionary.FLAG_YES);
break;
}
--
Gitblit v1.9.1