|
@@ -12,6 +12,7 @@ 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.powerGeneation.DayPowerGenerationService;
|
|
|
import com.cpp.web.service.station.ElectricFieldService;
|
|
|
import com.cpp.web.utils.LogUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -46,6 +47,10 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
|
|
|
private final ParsingLogService parsingLogService;
|
|
|
|
|
|
+ private final ElectricFieldService electricFieldService;
|
|
|
+
|
|
|
+ private final DayPowerGenerationService dayPowerGenerationService;
|
|
|
+
|
|
|
AlarmLog alarmLog = AlarmLog.getInstance();
|
|
|
|
|
|
/**
|
|
@@ -155,6 +160,36 @@ public class ScheduledJob implements ApplicationRunner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 云端发电量
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
+ public void generateYdPowerGeneration(){
|
|
|
+ log.info("-------------------------开始执行计算云端发电量定时任务-------------------------");
|
|
|
+ List<ElectricField> electricFieldList = electricFieldService.list();
|
|
|
+ if (electricFieldList.size() > 0){
|
|
|
+ for (ElectricField electricField : electricFieldList){
|
|
|
+ dayPowerGenerationService.generateYdPower(electricField.getStationCode());
|
|
|
+ }
|
|
|
+ log.info("-------------------------计算云端发电量定时任务执行完成-------------------------");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 云端发电量
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
+ public void generateZdPowerGeneration(){
|
|
|
+ log.info("-------------------------开始执行计算站端上传发电量定时任务-------------------------");
|
|
|
+ List<ElectricField> electricFieldList = electricFieldService.list();
|
|
|
+ if (electricFieldList.size() > 0){
|
|
|
+ for (ElectricField electricField : electricFieldList){
|
|
|
+ dayPowerGenerationService.generateZdPower(electricField.getStationCode());
|
|
|
+ }
|
|
|
+ log.info("-------------------------计算站端上传发电量定时任务执行完成-------------------------");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void run(ApplicationArguments args) throws Exception {
|