From cd904de915d9b883ffd10e78650d3e6fdb039cb6 Mon Sep 17 00:00:00 2001 From: hy001 Date: Sat, 16 May 2026 06:35:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=80=81=E7=A4=BC=E7=AD=89?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gift/strategy/GiftCountStrategy.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java index 173f4111..13f224f0 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/GiftCountStrategy.java @@ -187,12 +187,23 @@ public class GiftCountStrategy implements GiftStrategy { // 动态礼物处理 processDynamicGift(runningWater); - boolean isHighPriceGift = checkHighPriceGift(runningWater); - - BigDecimal giftValueCount = BigDecimal.valueOf(getActualAmount(giftValue, giftValue.getGiftValue())); - - runningWater.getAcceptUsers().forEach(accept -> { - + boolean isHighPriceGift = checkHighPriceGift(runningWater); + + BigDecimal giftValueCount = BigDecimal.valueOf(getActualAmount(giftValue, giftValue.getGiftValue())); + BigDecimal actualValueCount = BigDecimal.valueOf( + getActualAmount( + giftValue, + Optional.ofNullable(giftValue.getActualAmount()).orElse(giftValue.getGiftValue()) + ) + ); + if (Objects.nonNull(runningWater.getUserId()) + && actualValueCount.compareTo(BigDecimal.ZERO) > 0) { + // Wealth level is based on the sender's actual gold spend. + consumptionLevelService.incrConsumptionGolds(runningWater.getUserId(), actualValueCount); + } + + runningWater.getAcceptUsers().forEach(accept -> { + BigDecimal userVipBenefit = userProfileGateway.getUserVipBenefit(accept.getAcceptUserId(), VipBenefitType.XP_RATE); BigDecimal resultValueCount = giftValueCount.multiply(userVipBenefit).setScale(0, RoundingMode.DOWN); // 记录魅力等级