Commit 1a30b3f9a6e780537fe2fc3f87b955cacebf4ae8

Authored by yiming
1 parent cc56c6c4

读取天的文件夹件

src/main/java/com/example/demo/SaticScheduleTask.java
... ... @@ -50,7 +50,7 @@ public class SaticScheduleTask {
50 50  
51 51  
52 52  
53   - @Scheduled(cron = "0 0/10 * * * ?")
  53 + @Scheduled(cron = "0 0/5 * * * ?")
54 54 @PostConstruct
55 55 void getArrivalInfos(){
56 56 logger.info("票务数据缓存加载: " + LocalDateTime.now());
... ... @@ -60,7 +60,10 @@ public class SaticScheduleTask {
60 60 contrast.getSchedulingS=result.get(0);
61 61 contrast.getSchedulingSSell=result.get(1);
62 62 logger.info("===============================数据存放结束,开始读取文件================================");
63   - List<File> files = FileUtil.loopFiles(Paths.get(rootPath),1,new wdbFileFilter());
  63 + DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyyMMdd");
  64 + String date=now.format(dtf);
  65 + System.out.println(rootPath+File.separator+date);
  66 + List<File> files = FileUtil.loopFiles(Paths.get(rootPath+File.separator+date),1,new wdbFileFilter());
64 67 System.out.println("文件数"+files.size());
65 68 logger.info("===============================文件数"+files.size()+",读取文件结束================================");
66 69 //先把处理上一次没匹配到的
... ...