Bladeren bron

提现限制

wangqifan 4 jaren geleden
bovenliggende
commit
c18e38798b
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      src/main/java/com/izouma/tcg/service/customizeStore/WithdrawApplyService.java

+ 4 - 0
src/main/java/com/izouma/tcg/service/customizeStore/WithdrawApplyService.java

@@ -50,6 +50,10 @@ public class WithdrawApplyService {
     }
     }
 
 
     public WithdrawApply withdraw(Long userId, BigDecimal money) {
     public WithdrawApply withdraw(Long userId, BigDecimal money) {
+        List<WithdrawApply> withdrawApplies = withdrawApplyRepo.findAllByUserIdAndStatus(userId, WithdrawStatus.UNDO);
+        if (withdrawApplies.size() > 0) {
+            throw new BusinessException("已发起提现,请等待审核处理再发起新提现");
+        }
         BigDecimal todayWithdraw = withdrawApplyRepo
         BigDecimal todayWithdraw = withdrawApplyRepo
                 .findAllByUserIdAndStatusAndPassTimeBetween(userId, WithdrawStatus.PASS, LocalDate
                 .findAllByUserIdAndStatusAndPassTimeBetween(userId, WithdrawStatus.PASS, LocalDate
                         .now().atStartOfDay(), LocalDate.now().atTime(LocalTime.MAX)).stream()
                         .now().atStartOfDay(), LocalDate.now().atTime(LocalTime.MAX)).stream()