diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java index f4e66be4..a63ba523 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java @@ -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 origin = getOriginCode(cmd, commodity); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java index 70183fa2..c4aae551 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/task/RoomDailyTaskClaimExe.java @@ -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() 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 94d2626e..2fe8d5dd 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 @@ -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);