|
|
@@ -1,6 +1,7 @@
|
|
|
package com.izouma.nineth.service;
|
|
|
|
|
|
import com.izouma.nineth.annotations.RedisLock;
|
|
|
+import com.izouma.nineth.config.GeneralProperties;
|
|
|
import com.izouma.nineth.utils.DateTimeUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -18,6 +19,7 @@ public class WithdrawApplyScheduleService {
|
|
|
|
|
|
private SysConfigService sysConfigService;
|
|
|
private WithdrawApplyService withdrawApplyService;
|
|
|
+ private GeneralProperties generalProperties;
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 8 * * ?")
|
|
|
@@ -31,6 +33,9 @@ public class WithdrawApplyScheduleService {
|
|
|
@Scheduled(cron = "0 0 15 * * ?")
|
|
|
@RedisLock(value = "'scheduleAutoApprove'", expire = 1, unit = TimeUnit.HOURS)
|
|
|
public void scheduleAutoApprove() throws ExecutionException, InterruptedException {
|
|
|
+ if (generalProperties.getWorkerId() != 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (sysConfigService.getBoolean("enable_auto_withdraw")
|
|
|
&& DateTimeUtils.isWorkDay(LocalDate.now())) {
|
|
|
withdrawApplyService.approveAll();
|