|
@@ -981,6 +981,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
|
|
|
// 供应商促销优惠活动
|
|
// 供应商促销优惠活动
|
|
PromotionsVo promotions = baseMapper.getPromotionByShopId(shop.getShopId());
|
|
PromotionsVo promotions = baseMapper.getPromotionByShopId(shop.getShopId());
|
|
|
|
+ boolean hasGift = false;
|
|
if (1 == cartItemVo.getSvipProductFlag()) {
|
|
if (1 == cartItemVo.getSvipProductFlag()) {
|
|
// 超级会员优惠商品,不参与促销活动(普通机构购买该商品可参与店铺促销)/阶梯价/复购价
|
|
// 超级会员优惠商品,不参与促销活动(普通机构购买该商品可参与店铺促销)/阶梯价/复购价
|
|
// 超级会员设置商品优惠价
|
|
// 超级会员设置商品优惠价
|
|
@@ -1014,25 +1015,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
// 优惠总额 + 满减金额
|
|
// 优惠总额 + 满减金额
|
|
reducedPrice.set(MathUtil.add(reducedPrice.get(), promotions.getReducedPrice()).doubleValue());
|
|
reducedPrice.set(MathUtil.add(reducedPrice.get(), promotions.getReducedPrice()).doubleValue());
|
|
} else if (promotions.getMode() == 3) {
|
|
} else if (promotions.getMode() == 3) {
|
|
- // 满赠
|
|
|
|
|
|
+ // 满足满赠
|
|
|
|
+ hasGift = true;
|
|
List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
|
|
List<CartItemVo> giftList = baseMapper.getPromotionGifts(promotions.getId());
|
|
- giftList.forEach(gift -> {
|
|
|
|
- if (shopIds.contains(gift.getShopId())) {
|
|
|
|
- // 赠品在当前订单内的供应商下
|
|
|
|
- shopList.forEach(s -> {
|
|
|
|
- if (s.getShopId().equals(gift.getShopId())) {
|
|
|
|
- s.getCartList().add(gift);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- // 获取赠品供应商
|
|
|
|
- CartShopVo giftShop = baseMapper.getShopByProductId(gift.getProductId());
|
|
|
|
- shopIds.add(giftShop.getShopId());
|
|
|
|
- giftShop.setCartList(new ArrayList<>());
|
|
|
|
- giftShop.getCartList().add(gift);
|
|
|
|
- shopList.add(giftShop);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
promotions.setGiftList(giftList);
|
|
promotions.setGiftList(giftList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1080,7 +1065,26 @@ public class CartClubServiceImpl implements CartClubService {
|
|
shop.setSvipReducedPrice(svipReducedPrice.get());
|
|
shop.setSvipReducedPrice(svipReducedPrice.get());
|
|
// 当前供应商添加到首位
|
|
// 当前供应商添加到首位
|
|
shopList.add(0, shop);
|
|
shopList.add(0, shop);
|
|
-
|
|
|
|
|
|
+ // 满足促销满赠
|
|
|
|
+ if (hasGift) {
|
|
|
|
+ promotions.getGiftList().forEach(gift -> {
|
|
|
|
+ if (shopIds.contains(gift.getShopId())) {
|
|
|
|
+ // 赠品在当前订单内的供应商下
|
|
|
|
+ shopList.forEach(s -> {
|
|
|
|
+ if (s.getShopId().equals(gift.getShopId())) {
|
|
|
|
+ s.getCartList().add(gift);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ // 获取赠品供应商
|
|
|
|
+ CartShopVo giftShop = baseMapper.getShopByProductId(gift.getProductId());
|
|
|
|
+ shopIds.add(giftShop.getShopId());
|
|
|
|
+ giftShop.setCartList(new ArrayList<>());
|
|
|
|
+ giftShop.getCartList().add(gift);
|
|
|
|
+ shopList.add(giftShop);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
// 是否充值商品
|
|
// 是否充值商品
|
|
boolean includeRecharge = false;
|
|
boolean includeRecharge = false;
|
|
boolean recharge = productService.isRechargeProduct(cartDto.getProductId());
|
|
boolean recharge = productService.isRechargeProduct(cartDto.getProductId());
|