From 7bddd3d012579a036c7e56a6ccd0a79e642da264 Mon Sep 17 00:00:00 2001 From: wyn <1074145239@qq.com> Date: Tue, 23 Jun 2026 17:06:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E6=8C=87=E5=AE=9Avip?= =?UTF-8?q?=E6=89=8D=E7=8E=B0=E9=87=91=E4=BC=98=E6=83=A0=E5=88=B8=E8=BD=AC?= =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/common/service/impl/CouponServiceImpl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/peanut/modules/common/service/impl/CouponServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/CouponServiceImpl.java index cfa73bd..bd6fda8 100644 --- a/src/main/java/com/peanut/modules/common/service/impl/CouponServiceImpl.java +++ b/src/main/java/com/peanut/modules/common/service/impl/CouponServiceImpl.java @@ -389,7 +389,7 @@ public class CouponServiceImpl extends ServiceImpl impl List> buyOrderProducts = couponToProductDao.selectJoinMaps(wrapper); for (Map map : buyOrderProducts) { ShopProduct shopProduct = shopProductDao.selectById(map.get("product_id").toString()); - //预售书+赠送现金券:VIP用户将券额转为积分;配置user_vip_ids时按限定VIP匹配,不匹配不送券 + //预售书+赠送现金券:VIP用户将券额转为积分;配置user_vip_ids时匹配VIP且现金券换积分,不匹配只送券 if ("03".equals(shopProduct.getGoodsType())){ MyUserEntity userEntity = userDao.selectById(order.getUserId()); List userVipList = userVipDao.selectList(new LambdaQueryWrapper() @@ -398,21 +398,15 @@ public class CouponServiceImpl extends ServiceImpl impl int productId = Integer.parseInt(map.get("product_id").toString()); int couponId = Integer.parseInt(map.get("coupon_id").toString()); CouponEntity couponEntity = couponDao.selectById(couponId); - boolean shouldGrantCoupon = true; boolean couponToJf = false; if (StringUtils.isNotEmpty(couponEntity.getUserVipIds())) { - if (!matchUserVipIds(couponEntity.getUserVipIds(), userVipList)) { - shouldGrantCoupon = false; - } else { + if (matchUserVipIds(couponEntity.getUserVipIds(), userVipList)) { couponToJf = couponEntity.getCouponType() == 0; } } else { boolean isFyszVip = userVipList.stream().anyMatch(userVip -> Integer.valueOf(10).equals(userVip.getType())); couponToJf = couponEntity.getCouponType() == 0 && (productId == 2023 ? isFyszVip : userVipList.size() > 0); } - if (!shouldGrantCoupon) { - continue; - } if (couponToJf){ BigDecimal jf = BigDecimal.ZERO; for (int i=0;i