123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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<ParsingChannel> 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();
- }
- }
|