FileAnalysisJob.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package com.jiayue.biz.job;
  2. import cn.hutool.core.collection.ListUtil;
  3. import cn.hutool.core.date.DateUtil;
  4. import com.jiayue.biz.domain.ProphaseAnemometryData;
  5. import com.jiayue.biz.domain.ProphaseWeatherData;
  6. import com.jiayue.biz.domain.WindTowerInfo;
  7. import com.jiayue.biz.mapper.ProphaseAnemometryDataMapper;
  8. import com.jiayue.biz.mapper.ProphaseWeatherDataMapper;
  9. import com.jiayue.biz.service.ProphaseAnemometryDataService;
  10. import com.jiayue.biz.service.ProphaseWeatherDataService;
  11. import com.jiayue.biz.service.WindTowerDataParentTableService;
  12. import com.jiayue.biz.service.WindTowerInfoService;
  13. import com.jiayue.biz.service.impl.AnalysisDataImpl;
  14. import com.jiayue.biz.service.impl.EmailImpl;
  15. import com.jiayue.biz.util.CalculationUtil;
  16. import lombok.extern.slf4j.Slf4j;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.scheduling.annotation.EnableScheduling;
  19. import org.springframework.scheduling.annotation.Scheduled;
  20. import org.springframework.stereotype.Service;
  21. import java.math.RoundingMode;
  22. import java.sql.Timestamp;
  23. import java.util.*;
  24. import java.util.stream.Collectors;
  25. /**
  26. * 定时扫描系统邮件并解析
  27. *
  28. * @author whc
  29. * @version 3.0
  30. */
  31. @Slf4j
  32. @Service
  33. @EnableScheduling
  34. public class FileAnalysisJob {
  35. @Autowired
  36. private final EmailImpl emailImpl;
  37. @Autowired
  38. AnalysisDataImpl analysisData;
  39. @Autowired
  40. WindTowerInfoService windTowerInfoService;
  41. @Autowired
  42. ProphaseAnemometryDataService prophaseAnemometryDataService;
  43. @Autowired
  44. ProphaseWeatherDataService prophaseWeatherDataService;
  45. public FileAnalysisJob(EmailImpl emailImpl) {
  46. this.emailImpl = emailImpl;
  47. }
  48. @Scheduled(fixedDelay = 60000)
  49. public void fileAnalysis() {
  50. log.debug("文件解析定时任务执行开始");
  51. this.emailImpl.readMail();
  52. log.debug("文件解析定时任务执行完成");
  53. }
  54. // @Scheduled(fixedDelay = 60000 * 15)
  55. public void sldFileAnalysis() {
  56. log.debug("声雷达文件解析定时任务执行开始");
  57. this.analysisData.AnalysisSldFile();
  58. log.debug("声雷达文件解析定时任务执行完成");
  59. }
  60. // @Scheduled(fixedDelay = 6000
  61. // @Scheduled(fixedDelay = 60000 * 15)
  62. public void eolFileAnalysis() {
  63. log.debug("eol文件解析定时任务执行开始");
  64. this.analysisData.moveEolFileAndParseEol();
  65. log.debug("eol文件解析定时任务执行完成");
  66. }
  67. // @Scheduled(fixedDelay = 60000 * 6000)
  68. }