package com.jiayue.biz.job; import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; import com.jiayue.biz.domain.ProphaseAnemometryData; import com.jiayue.biz.domain.ProphaseWeatherData; import com.jiayue.biz.domain.WindTowerInfo; import com.jiayue.biz.mapper.ProphaseAnemometryDataMapper; import com.jiayue.biz.mapper.ProphaseWeatherDataMapper; import com.jiayue.biz.service.ProphaseAnemometryDataService; import com.jiayue.biz.service.ProphaseWeatherDataService; import com.jiayue.biz.service.WindTowerDataParentTableService; import com.jiayue.biz.service.WindTowerInfoService; import com.jiayue.biz.service.impl.AnalysisDataImpl; import com.jiayue.biz.service.impl.EmailImpl; import com.jiayue.biz.util.CalculationUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import java.math.RoundingMode; import java.sql.Timestamp; import java.util.*; import java.util.stream.Collectors; /** * 定时扫描系统邮件并解析 * * @author whc * @version 3.0 */ @Slf4j @Service @EnableScheduling public class FileAnalysisJob { @Autowired private final EmailImpl emailImpl; @Autowired AnalysisDataImpl analysisData; @Autowired WindTowerInfoService windTowerInfoService; @Autowired ProphaseAnemometryDataService prophaseAnemometryDataService; @Autowired ProphaseWeatherDataService prophaseWeatherDataService; public FileAnalysisJob(EmailImpl emailImpl) { this.emailImpl = emailImpl; } @Scheduled(fixedDelay = 60000) public void fileAnalysis() { log.debug("文件解析定时任务执行开始"); this.emailImpl.readMail(); log.debug("文件解析定时任务执行完成"); } // @Scheduled(fixedDelay = 60000 * 15) public void sldFileAnalysis() { log.debug("声雷达文件解析定时任务执行开始"); this.analysisData.AnalysisSldFile(); log.debug("声雷达文件解析定时任务执行完成"); } // @Scheduled(fixedDelay = 6000 // @Scheduled(fixedDelay = 60000 * 15) public void eolFileAnalysis() { log.debug("eol文件解析定时任务执行开始"); this.analysisData.moveEolFileAndParseEol(); log.debug("eol文件解析定时任务执行完成"); } // @Scheduled(fixedDelay = 60000 * 6000) }