Commit b16452e2 by huiyang.chen

fix 月卡加减购物车

parent a0e1e8ef
......@@ -1040,8 +1040,13 @@ public class ShoppingCartMCoffeeServiceImpl {
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService);
if (StringUtils.isNotEmpty(couponCode) && StringUtils.isNotEmpty(goodsId)) {
CartGoods couponGoods = cartGoodsList.stream().findFirst().filter(t -> t.getCouponCode().equals(couponCode)).get();
CartGoods cartGoods = cartGoodsList.stream().findFirst().filter(t -> (t.getGoodsId().equals(goodsId) && (!t.getCartGoodsUid().equals(couponGoods.getCartGoodsUid())))).get();
CartGoods couponGoods = cartGoodsList.stream().filter(t -> couponCode.equals(t.getCouponCode())).findFirst().orElse(null);
CartGoods cartGoods =new CartGoods();
if (couponGoods !=null) {
cartGoods = cartGoodsList.stream().filter(t -> (t.getGoodsId().equals(goodsId) && (!t.getCartGoodsUid().equals(couponGoods.getCartGoodsUid())))).findFirst().orElse(null);
}else {
cartGoods = cartGoodsList.stream().filter(t -> (t.getGoodsId().equals(goodsId))).findFirst().orElse(null);
}
if (cartGoods != null) {
if (cardAddVo.getIsSelect()) {
//修改购物车商品数量
......@@ -1065,6 +1070,14 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
}
}else {
if (couponGoods != null) {
//删除购物车行,因为商品券再购物车始终是一
UpdateShoppingCartGoodsQtyRequestVo vo = updateCartVo(couponGoods, cardAddVo, false);
updateGoodsQty(vo);
MCoffeeAddGoodsRequestVo requestVo = addCartVO(cardAddVo, false);
addGoods(requestVo);
}
}
cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, null, shoppingCartBaseService);
}
......
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