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); // 记录魅力等级