|
@@ -1,5 +1,6 @@
|
|
|
package com.cpp.web.job;
|
|
|
|
|
|
+import com.cpp.common.utils.spring.SpringUtils;
|
|
|
import com.cpp.system.service.ISysConfigService;
|
|
|
import com.cpp.web.domain.datafactory.enums.FileTypeEnum;
|
|
|
import com.cpp.web.domain.enums.AlarmEnum;
|
|
@@ -7,10 +8,12 @@ import com.cpp.web.domain.enums.DataSourcesEnum;
|
|
|
import com.cpp.web.domain.station.*;
|
|
|
import com.cpp.web.service.accuracy.CalcAccuracy;
|
|
|
import com.cpp.web.service.alarm.AlarmLog;
|
|
|
+import com.cpp.web.service.cloud.CloudFileParsing;
|
|
|
import com.cpp.web.service.datafactory.CloudFileParsing;
|
|
|
import com.cpp.web.service.datafactory.DataStore;
|
|
|
import com.cpp.web.service.datafactory.ParsingLogService;
|
|
|
import com.cpp.web.service.datafactory.SftpFileParsing;
|
|
|
+import com.cpp.web.service.station.ElectricFieldService;
|
|
|
import com.cpp.web.utils.LogUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -49,14 +52,12 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
/**
|
|
|
* 解析站端文件定时任务
|
|
|
*/
|
|
|
- @Scheduled(fixedRate = 60000L)
|
|
|
+// @Scheduled(fixedRate = 60000L)
|
|
|
public void parsingFile() {
|
|
|
sftpFileParsing.parsingFile();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- @Scheduled(cron = "0 0/15 0 * * *")
|
|
|
+ // @Scheduled(cron = "0 0/15 0 * * *")
|
|
|
public void check() {
|
|
|
//短期未解析告警
|
|
|
String dqEndTime = iSysConfigService.selectConfigByKey("dqEndTime");
|
|
@@ -82,7 +83,7 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
/**
|
|
|
* 解析中心端文件定时任务
|
|
|
*/
|
|
|
- @Scheduled(fixedRate = 60000L)
|
|
|
+// @Scheduled(fixedRate = 60000L)
|
|
|
public void cloudFileParsing() {
|
|
|
cloudFileParsing.parsingFile();
|
|
|
}
|
|
@@ -90,7 +91,7 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
/**
|
|
|
* 压缩文件上传并清理历史文件,一天一次
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 30 0 * * *")
|
|
|
+// @Scheduled(cron = "0 30 0 * * *")
|
|
|
public void uploadZipFile() {
|
|
|
sftpFileParsing.uploadZipFile();
|
|
|
}
|
|
@@ -99,7 +100,7 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
/**
|
|
|
* 计算准确率定时任务
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 30 1 * * *")
|
|
|
+// @Scheduled(cron = "0 30 1 * * *")
|
|
|
public void calculate() {
|
|
|
calcAccuracy.calculate();
|
|
|
}
|
|
@@ -107,15 +108,59 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
/**
|
|
|
* 告警消纳定时任务
|
|
|
*/
|
|
|
- @Scheduled(fixedRate = 60000L)
|
|
|
+// @Scheduled(fixedRate = 60000L)
|
|
|
public void e() {
|
|
|
AlarmLog.getInstance().eliminate();
|
|
|
}
|
|
|
|
|
|
|
|
|
+// /**
|
|
|
+// * 告警消纳定时任务
|
|
|
+// */
|
|
|
+ /**
|
|
|
+ * 告警消纳定时任务
|
|
|
+ */
|
|
|
+// @Scheduled(fixedRate = 60000L)
|
|
|
+// public void aaa() {
|
|
|
+// for (ElectricField electricField : SpringUtils.getBean(ElectricFieldService.class).list()) {
|
|
|
+// System.out.println(electricField.getStationCode());
|
|
|
+// System.out.println(DataStore.getInstance().getData(electricField.getStationCode(), ForecastPowerShortTermStation.class).getTime());
|
|
|
+// System.out.println(DataStore.getInstance().getData(electricField.getStationCode(), ForecastPowerUltraShortTermStation.class).getTime());
|
|
|
+// System.out.println(DataStore.getInstance().getData(electricField.getStationCode(), PowerStationStatusData.class).getTime());
|
|
|
+// System.out.println(DataStore.getInstance().getData(electricField.getStationCode(), WindTowerStatusData.class).getTime());
|
|
|
+// System.out.println(DataStore.getInstance().getData(electricField.getStationCode(), WeatherStationStatusData.class).getTime());
|
|
|
+// }
|
|
|
+// }
|
|
|
+ public void aaa() {
|
|
|
+ for (ElectricField electricField : SpringUtils.getBean(ElectricFieldService.class).list()) {
|
|
|
+ System.out.println(electricField.getStationCode());
|
|
|
+
|
|
|
+
|
|
|
+ ForecastPowerShortTermRegulation forecastPowerShortTermRegulation = DataStore.getInstance().getData(electricField.getStationCode(), ForecastPowerShortTermRegulation.class);
|
|
|
+ System.out.println(forecastPowerShortTermRegulation.getFpValue() + "," + forecastPowerShortTermRegulation.getTime());
|
|
|
+
|
|
|
+
|
|
|
+ ForecastPowerUltraShortTermRegulation forecastPowerUltraShortTermRegulation = DataStore.getInstance().getData(electricField.getStationCode(), ForecastPowerUltraShortTermRegulation.class);
|
|
|
+ System.out.println(forecastPowerUltraShortTermRegulation.getFpValue() + "," + forecastPowerUltraShortTermRegulation.getTime());
|
|
|
+
|
|
|
+ PowerStationStatusData powerStationStatusData = DataStore.getInstance().getData(electricField.getStationCode(), PowerStationStatusData.class);
|
|
|
+ System.out.println(powerStationStatusData.toString() + "," + powerStationStatusData.getTime());
|
|
|
+ if (electricField.getElectricFieldTypeEnum().equals("E2")) {
|
|
|
+ WindTowerStatusData data = DataStore.getInstance().getData(electricField.getStationCode(), WindTowerStatusData.class);
|
|
|
+ System.out.println(data + "," + data.getTime());
|
|
|
+ } else {
|
|
|
+ WeatherStationStatusData data = DataStore.getInstance().getData(electricField.getStationCode(), WeatherStationStatusData.class);
|
|
|
+ System.out.println(data + "," + data.getTime());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void run(ApplicationArguments args) throws Exception {
|
|
|
AlarmLog.getInstance().initMap();
|
|
|
DataStore.getInstance().init();
|
|
|
}
|
|
|
}
|
|
|
+
|