每日金币大放送增加VIP奖励比例,VIP奖励比例统一为RoundingMode.DOWN

This commit is contained in:
tianfeng 2026-03-16 17:40:51 +08:00
parent f359ed23b6
commit d7c516ab98
3 changed files with 10 additions and 2 deletions

View File

@ -231,7 +231,7 @@ public class PropsPurchasingCmdExe {
}
BigDecimal userVipBenefit = userProfileGateway.getUserVipBenefit(cmd.getReqUserId(), VipBenefitType.SHOP_DISCOUNT);
amount = amount.multiply(userVipBenefit).setScale(2, RoundingMode.HALF_UP);
amount = amount.multiply(userVipBenefit).setScale(0, RoundingMode.DOWN);
ImmutableKeyValuePair<String, String> origin = getOriginCode(cmd, commodity);

View File

@ -3,6 +3,8 @@ package com.red.circle.other.app.command.task;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.other.app.dto.clientobject.task.RoomDailyTaskClaimCO;
import com.red.circle.other.app.dto.cmd.task.RoomDailyTaskClaimCmd;
import com.red.circle.other.domain.enums.VipBenefitType;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.domain.gateway.user.ability.RegisterDeviceGateway;
import com.red.circle.other.infra.database.rds.entity.activity.LotteryDeviceRecord;
import com.red.circle.other.infra.database.rds.entity.task.RoomDailyTaskClaimRecord;
@ -24,6 +26,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
@ -42,6 +46,7 @@ public class RoomDailyTaskClaimExe {
private final WalletGoldClient walletGoldClient;
private final RegisterDeviceGateway registerDeviceGateway;
private final LotteryDeviceRecordService lotteryDeviceRecordService;
private final UserProfileGateway userProfileGateway;
private final static long ROOM_DAILY_FIXED_ACTIVITY_ID = 10011L;
@Transactional(rollbackFor = Exception.class)
@ -106,6 +111,9 @@ public class RoomDailyTaskClaimExe {
taskDatabaseService.saveOrUpdateProgress(progress);
taskDatabaseService.saveClaimRecords(records);
BigDecimal userVipBenefit = userProfileGateway.getUserVipBenefit(userId, VipBenefitType.XP_RATE);
totalReward = new BigDecimal(totalReward).multiply(userVipBenefit).setScale(0, RoundingMode.DOWN).longValue();
// 发放奖励
String bizNo = taskCode + ":" + today + ":batch:" + maxTierClaimed + "-" + maxTierCompleted;
walletGoldClient.changeBalance(GoldReceiptCmd.builder()

View File

@ -194,7 +194,7 @@ public class GiftCountStrategy implements GiftStrategy {
runningWater.getAcceptUsers().forEach(accept -> {
BigDecimal userVipBenefit = userProfileGateway.getUserVipBenefit(accept.getAcceptUserId(), VipBenefitType.XP_RATE);
BigDecimal resultValueCount = giftValueCount.multiply(userVipBenefit).setScale(2, RoundingMode.HALF_UP);
BigDecimal resultValueCount = giftValueCount.multiply(userVipBenefit).setScale(0, RoundingMode.DOWN);
// 记录魅力等级
consumptionLevelService.incrConsumptionDiamond(accept.getAcceptUserId(), resultValueCount);