package com.jiayue.ipfcst.client.Schedule; import com.jiayue.ipfcst.client.service.*; import com.jiayue.ipfcst.client.service.an.DownloadService; import com.jiayue.ipfcst.client.service.an.ParsingChannelService; import com.jiayue.ipp.common.data.entity.an.ParsingChannel; import com.jiayue.ipp.common.data.enums.an.AnChannelType; import com.jiayue.ipp.common.data.enums.an.UseStatusEnum; import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service @AllArgsConstructor public class ParsingJob { @Autowired private final ParsingChannelService parsingChannelService; @Autowired private final DownloadService downloadService; // @Autowired // private final JiaYueWindPowerCdqResultCoverService jiaYueWindPowerCdqResultCoverService; @Autowired private final JiaYueWindPowerCdqResultCoverFD0002Service jiaYueWindPowerCdqResultCoverFD0002Service; @Autowired private final JiaYueWindPowerCdqResultCoverFD0003Service jiaYueWindPowerCdqResultCoverFD0003Service; @Autowired private final JiaYueWindPowerCdqResultCoverFD0001Service jiaYueWindPowerCdqResultCoverFD0001Service; @Autowired private final JiaYueWindPowerCdqResultCoverFD0005Service jiaYueWindPowerCdqResultCoverFD0005Service; @Autowired private final JiaYueWindPowerCdqResultCoverFD0006Service jiaYueWindPowerCdqResultCoverFD0006Service; @Autowired private final JiaYueWindPowerCdqResultCoverFD0007Service jiaYueWindPowerCdqResultCoverFD0007Service; // @Scheduled(fixedRate = 900000) @Scheduled(fixedRate = 60000) public void start() { List parsingChannels = new ArrayList<>(); ParsingChannel parsingChannel = new ParsingChannel(); parsingChannel.setAnChannelType(AnChannelType.E3); parsingChannel.setChannelName("解析反向隔离"); parsingChannel.setId("722af308253fcd6eff67959c7f76eaf8"); parsingChannel.setRemoteIp("127.0.0.1"); parsingChannel.setUseStatus(UseStatusEnum.E1); parsingChannels.add(parsingChannel); //循环ftp解析通道 for (ParsingChannel parsingChannel1 : parsingChannels) { if (parsingChannel1.getUseStatus().name().equals("E1")) { switch (parsingChannel1.getAnChannelType().name()) { case "E3": downloadService.parsing(parsingChannel1); break; default: break; } } } } /** * 超短期生成定时任务 */ @Scheduled(cron = "30 10,25,40,55 * * * ? ") // @Scheduled(fixedRate = 60000) public void ultraShortTermApi() { jiaYueWindPowerCdqResultCoverFD0001Service.executeForecast(); jiaYueWindPowerCdqResultCoverFD0002Service.executeForecast(); jiaYueWindPowerCdqResultCoverFD0003Service.executeForecast(); jiaYueWindPowerCdqResultCoverFD0005Service.executeForecast(); jiaYueWindPowerCdqResultCoverFD0006Service.executeForecast(); jiaYueWindPowerCdqResultCoverFD0007Service.executeForecast(); } }