Commit 911c55c0 by yu.sun

sunyu::update::fix bug about clear monthCard info

parent ef535637
...@@ -357,8 +357,19 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -357,8 +357,19 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
for (CartGoods goods : cartGoodsList) { for (CartGoods goods : cartGoodsList) {
if (Objects.equals(1,goods.getIsMonthCard()) && updateShoppingCartGoodsQtyRequestVo.getQty()>10){ if (Objects.equals(1,goods.getIsMonthCard())
throw new ServiceException(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR); && goods.getGoodsId().equals(updateShoppingCartGoodsQtyRequestVo.getCartGoodsUid())){
if (updateShoppingCartGoodsQtyRequestVo.getQty() == 0){
Iterator<CartGoods> iterator = cartGoodsList.iterator();
while (iterator.hasNext()){
if (iterator.next().getGoodsId().equals(goods.getGoodsId())){
iterator.remove();
}
}
}
if (updateShoppingCartGoodsQtyRequestVo.getQty()>10) {
throw new ServiceException(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR);
}
} }
} }
......
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