Merge branch 'develop_migration' into 'develop_master'
feat: There is no way the, 企标复审计划月初逻辑 改为 下整月 See merge request LiuChao/foton-slrs-system-rest!406
This commit is contained in:
+18
-17
@@ -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(){
|
||||
@@ -54,15 +54,21 @@ public class StateSync {
|
||||
try{
|
||||
Thread.sleep(2000);
|
||||
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---START-01");
|
||||
String nowFirst = DateUtil.firstOneDay(DateUtil.printDate(new Date()));
|
||||
String nowFin = DateUtil.finOneDay(DateUtil.printDate(new Date()));
|
||||
String nowFinByQuery = DateUtil.addDay(DateUtil.finOneDay(DateUtil.printDate(new Date())),1);
|
||||
System.out.println("当前月第一日:"+nowFirst);
|
||||
System.out.println("当前月最后一日:"+nowFin);
|
||||
// String nowFirst = DateUtil.firstOneDay(DateUtil.printDate(new Date()));
|
||||
// String nowFin = DateUtil.finOneDay(DateUtil.printDate(new Date()));
|
||||
// String nowFinByQuery = DateUtil.addDay(DateUtil.finOneDay(DateUtil.printDate(new Date())),1);
|
||||
// System.out.println("当前月第一日:"+nowFirst);
|
||||
// System.out.println("当前月最后一日:"+nowFin);
|
||||
// 改为下月整月
|
||||
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);
|
||||
System.out.println("下个月第一日:"+ nextFirst);
|
||||
System.out.println("下个月最后一日:"+nextFin);
|
||||
|
||||
SarBussionessStand stand = new SarBussionessStand();
|
||||
stand.setIssueTimeStart(nowFirst);
|
||||
stand.setIssueTimeEnd(nowFin);
|
||||
stand.setIssueTimeStart(nextFirst);
|
||||
stand.setIssueTimeEnd(nextFin);
|
||||
List<SarBussionessStand> standList = sarBussionessStandDao.queryByBussStateSync(stand);
|
||||
if(!standList.isEmpty()){
|
||||
List<SarBussionessStandState> filterList = new ArrayList<>();
|
||||
@@ -85,7 +91,7 @@ public class StateSync {
|
||||
List<SarBussionessStandState> updList = new ArrayList<>();
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.isNull("REVIEW_RESULTS");
|
||||
wrapper.between("REVIEW_TIME",nowFirst,nowFinByQuery);
|
||||
wrapper.between("REVIEW_TIME",nextFirst,nextFinByQuery);
|
||||
List<SarBussionessStandState> stateList = bussionessStandStateService.list(wrapper);
|
||||
if(!stateList.isEmpty()){
|
||||
// 差集 (list1 - list2) 新增复审表
|
||||
@@ -143,8 +149,6 @@ public class StateSync {
|
||||
}
|
||||
}
|
||||
|
||||
// 月初
|
||||
@Scheduled(cron="0 0 1 1 * ?")
|
||||
// 月末
|
||||
// @Scheduled(cron="0 0 1 28-31 * ?")
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@@ -156,8 +160,7 @@ public class StateSync {
|
||||
// 判断当前日期是否为月末
|
||||
Date date = new Date();
|
||||
if(isLastDayOfMonth(date)){
|
||||
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");
|
||||
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);
|
||||
@@ -236,11 +239,9 @@ public class StateSync {
|
||||
bussionessStandStateService.updateBatchById(updList);
|
||||
}
|
||||
}
|
||||
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");
|
||||
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 1 * ? --- " + new Date()+"---End-01");
|
||||
// logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + 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());
|
||||
|
||||
Reference in New Issue
Block a user