Commit 6c4d8407 by huiyang.chen

麦咖啡咖啡月卡开发 优化

parent cbb38165
...@@ -303,6 +303,8 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -303,6 +303,8 @@ public class ShoppingCartMCoffeeServiceImpl {
if (CollectionUtils.isNotEmpty(cartGoodsList)) { if (CollectionUtils.isNotEmpty(cartGoodsList)) {
// check购物车中所有商品 // check购物车中所有商品
cartGoodsList = checkCartGoods(partnerId, storeId, orderType, menuType, shoppingCartGoodsResponseVo, cartGoodsList); cartGoodsList = checkCartGoods(partnerId, storeId, orderType, menuType, shoppingCartGoodsResponseVo, cartGoodsList);
// 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService);
//校验咖啡月卡的商品是否在购物车里面存在 //校验咖啡月卡的商品是否在购物车里面存在
List<String> goodsId = shoppingCartInfoRequestVo.getGoodsId(); List<String> goodsId = shoppingCartInfoRequestVo.getGoodsId();
...@@ -316,16 +318,35 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -316,16 +318,35 @@ public class ShoppingCartMCoffeeServiceImpl {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_GOODS_CHECK_ERROR); return ResponseUtil.error(ResponseResult.SHOPPING_CART_GOODS_CHECK_ERROR);
} }
CartGoods cartGoods = cartGoodsListNew.stream().max(Comparator.comparing(CartGoods::getOriginalPrice)).get(); CartGoods cartGoods = cartGoodsListNew.stream().max(Comparator.comparing(CartGoods::getOriginalPrice)).get();
for (CartGoods cart: cartGoodsList ) { if (cartGoods != null){
if (cart.getCartGoodsUid().equals(cartGoods.getCartGoodsUid())){ //修改购物车商品数量
cart.setCategoryName(shoppingCartInfoRequestVo.getCoffeeCouponName()); UpdateShoppingCartGoodsQtyRequestVo vo =new UpdateShoppingCartGoodsQtyRequestVo();
cart.setCouponCode(shoppingCartInfoRequestVo.getCoffeeCouponCode()); vo.setCartGoodsUid(cartGoods.getCartGoodsUid());
} vo.setPartnerId(partnerId);
vo.setQty(cartGoods.getQty() - 1);
vo.setOrderType(orderType);
vo.setShopId(storeId);
vo.setMenuType(menuType);
vo.setChannelType(shoppingCartInfoRequestVo.getChannelType());
vo.setAppId(appId);
updateGoodsQty(vo);
//添加商品券到购物车
MCoffeeAddGoodsRequestVo requestVo =new MCoffeeAddGoodsRequestVo();
requestVo.setAppId(appId);
requestVo.setCategoryName("DSPQ");
requestVo.setCategoryName(shoppingCartInfoRequestVo.getCoffeeCouponName());
requestVo.setChannelType(shoppingCartInfoRequestVo.getChannelType());
requestVo.setMenuType(menuType);
requestVo.setOrderType(orderType);
requestVo.setPartnerId(partnerId);
requestVo.setQty(1);
requestVo.setShopId(storeId);
requestVo.setSkuId(cartGoods.getSkuId());
requestVo.setSpuId(cartGoods.getSpuId());
requestVo.setCouponCode(shoppingCartInfoRequestVo.getCoffeeCouponCode());
addGoods(requestVo);
} }
} }
// 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService);
} }
// 当couponCode不为空时,需参与价格计算 // 当couponCode不为空时,需参与价格计算
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = getCoupon(couponCode, null, cartGoodsList);
......
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