每日金币大放送VIP折扣改为没个档位计算折扣然后累加
This commit is contained in:
parent
7a9f404233
commit
54fb972cf4
@ -78,6 +78,8 @@ public class RoomDailyTaskClaimExe {
|
||||
.filter(t -> t.getTierIndex() > maxTierClaimed && t.getTierIndex() <= maxTierCompleted)
|
||||
.toList();
|
||||
|
||||
BigDecimal vipRate = userProfileGateway.getUserVipBenefit(userId, VipBenefitType.XP_RATE);
|
||||
|
||||
long totalReward = 0;
|
||||
List<RoomDailyTaskClaimRecord> records = new ArrayList<>();
|
||||
for (RoomDailyTaskTier tier : claimableTiers) {
|
||||
@ -85,7 +87,9 @@ public class RoomDailyTaskClaimExe {
|
||||
if (taskDatabaseService.existsClaimRecord(bizNo)) {
|
||||
continue;
|
||||
}
|
||||
totalReward += tier.getRewardValue();
|
||||
// 每个档位单独计算 VIP 加成后累加
|
||||
long tierReward = new BigDecimal(tier.getRewardValue()).multiply(vipRate).setScale(0, RoundingMode.DOWN).longValue();
|
||||
totalReward += tierReward;
|
||||
|
||||
RoomDailyTaskClaimRecord record = new RoomDailyTaskClaimRecord();
|
||||
record.setUserId(userId);
|
||||
@ -111,9 +115,6 @@ 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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user