|
@@ -7,11 +7,13 @@ import com.zhongshu.reward.server.core.dao.WxTransferBatchDao;
|
|
|
import com.zhongshu.reward.server.core.domain.WxTransferBatch;
|
|
|
import com.zhongshu.reward.server.core.service.WalletReceiptsService;
|
|
|
import com.zhongshu.reward.server.core.service.WxTransferService;
|
|
|
+import com.zhongshu.reward.server.core.util.DateUtils;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -58,10 +60,17 @@ public class WalletTimer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 0 0 25 * ?")
|
|
|
+ @Scheduled(cron = "0 0 1 * * ?")
|
|
|
public void settle(){
|
|
|
try {
|
|
|
- walletReceiptsService.settle();
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
+
|
|
|
+ if (DateUtils.checkLastDayOfMonth() && now.getMonthValue() == 2){
|
|
|
+ for (int i = now.getDayOfMonth(); i <= 31; i++) {
|
|
|
+ walletReceiptsService.settle(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ walletReceiptsService.settle(now.getDayOfMonth());
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -70,7 +79,7 @@ public class WalletTimer {
|
|
|
@Scheduled(cron = "0 0 0 1 * ?")
|
|
|
public void autoReceipts(){
|
|
|
try {
|
|
|
- walletReceiptsService.settle();
|
|
|
+ walletReceiptsService.autoReceipts();
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|