Commit c7ffeb90430a8a6f798cda0d9d99666cbf9b736d
1 parent
f58b666f
feat: 增加定时任务日志
Showing
1 changed file
with
5 additions
and
0 deletions
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| @@ -46,6 +46,7 @@ import sun.misc.BASE64Decoder; | @@ -46,6 +46,7 @@ import sun.misc.BASE64Decoder; | ||
| 46 | import javax.annotation.Resource; | 46 | import javax.annotation.Resource; |
| 47 | import java.io.*; | 47 | import java.io.*; |
| 48 | import java.math.BigDecimal; | 48 | import java.math.BigDecimal; |
| 49 | +import java.text.SimpleDateFormat; | ||
| 49 | import java.time.LocalDate; | 50 | import java.time.LocalDate; |
| 50 | import java.util.*; | 51 | import java.util.*; |
| 51 | import java.util.stream.Collectors; | 52 | import java.util.stream.Collectors; |
| @@ -387,14 +388,18 @@ public class ThreadJobService { | @@ -387,14 +388,18 @@ public class ThreadJobService { | ||
| 387 | LocalDate date = LocalDate.now(); | 388 | LocalDate date = LocalDate.now(); |
| 388 | Date date2 = ConstDateUtil.dateAddition(date.toString(), timeOut); | 389 | Date date2 = ConstDateUtil.dateAddition(date.toString(), timeOut); |
| 389 | Date date1 = new Date(); | 390 | Date date1 = new Date(); |
| 391 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 390 | // 如果当前日期小于设定时间就不获取固定排班 | 392 | // 如果当前日期小于设定时间就不获取固定排班 |
| 393 | + log.info("当前时间:{},设定时间:{}", simpleDateFormat.format(date1), simpleDateFormat.format(date2)); | ||
| 391 | if (date1.compareTo(date2) < 0) { | 394 | if (date1.compareTo(date2) < 0) { |
| 395 | + log.info("当前日期小于设定时间就不获取排班,当前时间:{},设定时间:{}", simpleDateFormat.format(date1), simpleDateFormat.format(date2)); | ||
| 392 | return; | 396 | return; |
| 393 | } | 397 | } |
| 394 | } | 398 | } |
| 395 | //查询当天是否保存过考情表 如果不存在则保存 | 399 | //查询当天是否保存过考情表 如果不存在则保存 |
| 396 | Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(new Date())); | 400 | Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(new Date())); |
| 397 | if (!CollectionUtil.isEmpty(dto) || originSchedulingMap.size() == 0) { | 401 | if (!CollectionUtil.isEmpty(dto) || originSchedulingMap.size() == 0) { |
| 402 | + log.info("已有数据,当天排班数据长度:{}", originSchedulingMap.size()); | ||
| 398 | return; | 403 | return; |
| 399 | } | 404 | } |
| 400 | List<DriverScheduling> bcList = getBcList(originSchedulingMap); | 405 | List<DriverScheduling> bcList = getBcList(originSchedulingMap); |