美元防止防止超额过滤去除
This commit is contained in:
parent
8c77513e38
commit
93a779f240
@ -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()
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user