ParsingJob.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package com.jiayue.ipfcst.client.Schedule;
  2. import com.jiayue.ipfcst.client.service.*;
  3. import com.jiayue.ipfcst.client.service.an.DownloadService;
  4. import com.jiayue.ipfcst.client.service.an.ParsingChannelService;
  5. import com.jiayue.ipp.common.data.entity.an.ParsingChannel;
  6. import com.jiayue.ipp.common.data.enums.an.AnChannelType;
  7. import com.jiayue.ipp.common.data.enums.an.UseStatusEnum;
  8. import lombok.AllArgsConstructor;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.scheduling.annotation.Scheduled;
  11. import org.springframework.stereotype.Service;
  12. import java.util.ArrayList;
  13. import java.util.List;
  14. @Service
  15. @AllArgsConstructor
  16. public class ParsingJob {
  17. @Autowired
  18. private final ParsingChannelService parsingChannelService;
  19. @Autowired
  20. private final DownloadService downloadService;
  21. // @Autowired
  22. // private final JiaYueWindPowerCdqResultCoverService jiaYueWindPowerCdqResultCoverService;
  23. @Autowired
  24. private final JiaYueWindPowerCdqResultCoverFD0002Service jiaYueWindPowerCdqResultCoverFD0002Service;
  25. @Autowired
  26. private final JiaYueWindPowerCdqResultCoverFD0003Service jiaYueWindPowerCdqResultCoverFD0003Service;
  27. @Autowired
  28. private final JiaYueWindPowerCdqResultCoverFD0001Service jiaYueWindPowerCdqResultCoverFD0001Service;
  29. @Autowired
  30. private final JiaYueWindPowerCdqResultCoverFD0005Service jiaYueWindPowerCdqResultCoverFD0005Service;
  31. @Autowired
  32. private final JiaYueWindPowerCdqResultCoverFD0006Service jiaYueWindPowerCdqResultCoverFD0006Service;
  33. @Autowired
  34. private final JiaYueWindPowerCdqResultCoverFD0007Service jiaYueWindPowerCdqResultCoverFD0007Service;
  35. // @Scheduled(fixedRate = 900000)
  36. @Scheduled(fixedRate = 60000)
  37. public void start() {
  38. List<ParsingChannel> parsingChannels = new ArrayList<>();
  39. ParsingChannel parsingChannel = new ParsingChannel();
  40. parsingChannel.setAnChannelType(AnChannelType.E3);
  41. parsingChannel.setChannelName("解析反向隔离");
  42. parsingChannel.setId("722af308253fcd6eff67959c7f76eaf8");
  43. parsingChannel.setRemoteIp("127.0.0.1");
  44. parsingChannel.setUseStatus(UseStatusEnum.E1);
  45. parsingChannels.add(parsingChannel);
  46. //循环ftp解析通道
  47. for (ParsingChannel parsingChannel1 : parsingChannels) {
  48. if (parsingChannel1.getUseStatus().name().equals("E1")) {
  49. switch (parsingChannel1.getAnChannelType().name()) {
  50. case "E3":
  51. downloadService.parsing(parsingChannel1);
  52. break;
  53. default:
  54. break;
  55. }
  56. }
  57. }
  58. }
  59. /**
  60. * 超短期生成定时任务
  61. */
  62. @Scheduled(cron = "30 10,25,40,55 * * * ? ")
  63. // @Scheduled(fixedRate = 60000)
  64. public void ultraShortTermApi() {
  65. jiaYueWindPowerCdqResultCoverFD0001Service.executeForecast();
  66. jiaYueWindPowerCdqResultCoverFD0002Service.executeForecast();
  67. jiaYueWindPowerCdqResultCoverFD0003Service.executeForecast();
  68. jiaYueWindPowerCdqResultCoverFD0005Service.executeForecast();
  69. jiaYueWindPowerCdqResultCoverFD0006Service.executeForecast();
  70. jiaYueWindPowerCdqResultCoverFD0007Service.executeForecast();
  71. }
  72. }