|
|
@@ -493,7 +493,7 @@ public class UserBalanceService {
|
|
|
LocalDate start = LocalDate.of(2023, 1, 10);
|
|
|
LocalDate end = LocalDate.of(2023, 1, 18);
|
|
|
if (now.isBefore(end) & now.isAfter(start)) {
|
|
|
- Long checkResult = checkRechargeSum(rechargeOrder.getUserId(), rechargeOrder.getAmount());
|
|
|
+ Long checkResult = checkRechargeSum(rechargeOrder.getAmount());
|
|
|
if (checkResult > 0) {
|
|
|
airDrop(rechargeOrder.getUserId(), checkResult);
|
|
|
}
|
|
|
@@ -521,19 +521,10 @@ public class UserBalanceService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public Long checkRechargeSum(Long userId, BigDecimal recharge) {
|
|
|
- LocalDateTime start = LocalDateTime.of(2023, 1, 13, 0, 0, 0);
|
|
|
- LocalDateTime end = LocalDateTime.now();
|
|
|
- BigDecimal total = balanceRecordRepo.sumRechargeUser(start, end, userId);
|
|
|
- BigDecimal nowTotal;
|
|
|
- if (total != null) {
|
|
|
- nowTotal = total.add(recharge);
|
|
|
- } else {
|
|
|
- nowTotal = recharge;
|
|
|
- }
|
|
|
- int compare1 = nowTotal.compareTo(BigDecimal.valueOf(5000));
|
|
|
+ public Long checkRechargeSum(BigDecimal recharge) {
|
|
|
+ int compare1 = recharge.compareTo(BigDecimal.valueOf(5000));
|
|
|
if (compare1 >= 0) {
|
|
|
- int compare2 = nowTotal.compareTo(BigDecimal.valueOf(10000));
|
|
|
+ int compare2 = recharge.compareTo(BigDecimal.valueOf(10000));
|
|
|
if (compare2 >= 0) {
|
|
|
return 3L;
|
|
|
}
|