用户送礼等级

This commit is contained in:
hy001 2026-05-16 06:35:45 +08:00
parent ac9b431367
commit cd904de915

View File

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