Commit 625b3360 by chongfu.liang

fix

parent f694ecda
...@@ -1821,7 +1821,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1821,7 +1821,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
String spqId = spuId.substring(CommonsConstant.COUPON_PREFIX.length()); String spqId = spuId.substring(CommonsConstant.COUPON_PREFIX.length());
if (CollectionUtils.isNotEmpty(allCartGoodsList)){ if (CollectionUtils.isNotEmpty(allCartGoodsList)){
int sum = allCartGoodsList.stream().filter(p -> p.getSpuId().equals(spqId)).mapToInt(CartGoods::getQty).sum(); int sum = allCartGoodsList.stream().filter(p -> p.getSpuId().equals(spqId)).mapToInt(CartGoods::getQty).sum();
if (sum + 1 > todayAvailableTimes){ if (sum + cartGoods.getQty() > todayAvailableTimes){
throw new ServiceException(ResponseResult.SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE); throw new ServiceException(ResponseResult.SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment