美元防止防止超额过滤去除

This commit is contained in:
tianfeng 2026-01-15 18:25:33 +08:00
parent 8c77513e38
commit 93a779f240
2 changed files with 14 additions and 14 deletions

View File

@ -140,7 +140,7 @@ public class LotteryDrawExe {
private void deductUserGold(Long userId, LotteryActivity activity) {
GoldReceiptCmd build = GoldReceiptCmd.builder()
.appIncome()
.appExpenditure()
.userId(userId)
.amount(PennyAmount.ofDollar(activity.getCoinCost().longValue()))
.eventId(activity.getId())
@ -410,15 +410,15 @@ public class LotteryDrawExe {
}
// 特殊情况前期<50次已经拿到>=5美元进入"慢速模式"
if (currentAmount.compareTo(new BigDecimal("5.0")) >= 0 && drawCount < 50) {
log.info("User got big prize early, entering slow mode. userId: {}, amount: {}, count: {}",
progress.getUserId(), currentAmount, drawCount);
// 只允许0.1美元和虚拟物品prize_value<=0.15
return prizes.stream()
.filter(prize -> prize.getPrizeValue().compareTo(new BigDecimal("0.15")) <= 0)
.collect(Collectors.toList());
}
// if (currentAmount.compareTo(new BigDecimal("5.0")) >= 0 && drawCount < 50) {
// log.info("User got big prize early, entering slow mode. userId: {}, amount: {}, count: {}",
// progress.getUserId(), currentAmount, drawCount);
//
// // 只允许0.1美元和虚拟物品prize_value<=0.15
// return prizes.stream()
// .filter(prize -> prize.getPrizeValue().compareTo(new BigDecimal("0.15")) <= 0)
// .collect(Collectors.toList());
// }
// 正常防超额过滤
return prizes.stream()

View File

@ -352,9 +352,9 @@ public class LotteryMultiDrawExe {
if (currentAmount.compareTo(threshold) >= 0) {
return prizes.stream().filter(prize -> prize.getPrizeValue().compareTo(BigDecimal.ZERO) == 0).collect(Collectors.toList());
}
if (currentAmount.compareTo(new BigDecimal("5.0")) >= 0 && drawCount < 50) {
return prizes.stream().filter(prize -> prize.getPrizeValue().compareTo(new BigDecimal("0.15")) <= 0).collect(Collectors.toList());
}
// if (currentAmount.compareTo(new BigDecimal("5.0")) >= 0 && drawCount < 50) {
// return prizes.stream().filter(prize -> prize.getPrizeValue().compareTo(new BigDecimal("0.15")) <= 0).collect(Collectors.toList());
// }
return prizes.stream().filter(prize -> {
BigDecimal afterAmount = currentAmount.add(prize.getPrizeValue());
return afterAmount.compareTo(threshold) <= 0;
@ -520,7 +520,7 @@ public class LotteryMultiDrawExe {
private void deductUserGold(Long userId, Long activityId, Integer amount) {
GoldReceiptCmd build = GoldReceiptCmd.builder()
.appIncome()
.appExpenditure()
.userId(userId)
.amount(PennyAmount.ofDollar(amount.longValue()))
.eventId(activityId)