feat: There is no way the, tree async

This commit is contained in:
super_liu
2022-02-22 17:18:18 +08:00
parent 5352684945
commit 183ba86528
9 changed files with 199 additions and 45 deletions
@@ -46,7 +46,7 @@ public class StateSync {
// 月初
@Scheduled(cron="0 0 1 1 * ?")
// @Scheduled(cron="0 0 1 1 * ?")
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void StandScheduledJobMonthBegin(){
@@ -143,8 +143,10 @@ public class StateSync {
}
}
// 月初
@Scheduled(cron="0 0 1 1 * ?")
// 月末
@Scheduled(cron="0 0 1 28-31 * ?")
// @Scheduled(cron="0 0 1 28-31 * ?")
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void StandScheduledJobMonthEnd(){
@@ -154,7 +156,8 @@ public class StateSync {
// 判断当前日期是否为月末
Date date = new Date();
if(isLastDayOfMonth(date)){
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---START-01");
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---START-01");
// logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---START-01");
String nextFirst = DateUtil.printDate(DateUtil.nextMonthFirstDate());
String nextFin = DateUtil.finOneDay(DateUtil.printDate(DateUtil.nextMonthFirstDate()));
String nextFinByQuery = DateUtil.addDay(DateUtil.finOneDay(DateUtil.printDate(DateUtil.nextMonthFirstDate())),1);
@@ -233,9 +236,11 @@ public class StateSync {
bussionessStandStateService.updateBatchById(updList);
}
}
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---End-01");
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---End-01");
// logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---End-01");
}else {
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"当前日期不是最后一日---End-01");
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---End-01");
// logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"当前日期不是最后一日---End-01");
}
}catch(Exception e){
logger.info(e.getMessage());