Commit 911c55c0 by yu.sun

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

parent ef535637
...@@ -357,10 +357,21 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -357,10 +357,21 @@ 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())
&& 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); throw new ServiceException(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR);
} }
} }
}
if (cartGoods == null) { if (cartGoods == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR); throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
......
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