Commit b0d67ba2 by yu.sun

sunyu::update::fix bug about modify virtual-product qty

parent 400daa73
......@@ -344,6 +344,16 @@ public class ShoppingCartMCoffeeServiceImpl {
String skuId = "";
Integer finalQty = qty;
for (CartGoods cartGoods_ : cartGoodsList) {
if (Objects.equals(1,cartGoods_.getIsMonthCard())
&& cartGoods_.getCartGoodsUid().equals(updateShoppingCartGoodsQtyRequestVo.getCartGoodsUid())
&& updateShoppingCartGoodsQtyRequestVo.getQty()>10) {
shoppingCartGoodsResponseVo.setChanged(true);
shoppingCartGoodsResponseVo.setToastMsg(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR.getMessage());
setAddAndUpdateResponse(shoppingCartGoodsResponseVo,cartGoodsList,
ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR.getMessage(),
ShoppingCartConstant.ADD_AND_UPDATE,null);
return ResponseUtil.success(shoppingCartGoodsResponseVo);
}
if (cartGoodsUid.equals(cartGoods_.getCartGoodsUid())) {
cartGoods = cartGoods_;
cartGoods_.setQty(qty);
......@@ -380,14 +390,6 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoodsList = new ArrayList<>();
}
}
if (updateShoppingCartGoodsQtyRequestVo.getQty()>10) {
shoppingCartGoodsResponseVo.setChanged(true);
shoppingCartGoodsResponseVo.setToastMsg(ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR.getMessage());
setAddAndUpdateResponse(shoppingCartGoodsResponseVo,cartGoodsList,
ResponseResult.SHOPPING_CART_QTY_LIMIT_ERR.getMessage(),
ShoppingCartConstant.ADD_AND_UPDATE,null);
return ResponseUtil.success(shoppingCartGoodsResponseVo);
}
}
}
......
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