FileAnalysisJob.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 = 60000 * 6000)
  61. }