Browse Source

#定时任务修改

zhongwei
yang_shj 2 months ago
parent
commit
ffe9e4480b
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  2. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  3. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -88,6 +88,9 @@ public interface MainConstants {
// 站点实时数据 // 站点实时数据
String REAL_TIME_DATA = "realTimeData"; String REAL_TIME_DATA = "realTimeData";
String LOAD_STATION_ON_LINE = "loadStationOnLine";
// 光伏站-机组指标数据 // 光伏站-机组指标数据
String LOAD_PHOTOVOLTAIC_TARGET = "loadPhotovoltaicTarget"; String LOAD_PHOTOVOLTAIC_TARGET = "loadPhotovoltaicTarget";

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -57,7 +57,7 @@ public class MonitorScheduledTask {
* 站点在线状态同步 * 站点在线状态同步
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(REAL_TIME_DATA) @XxlJob(LOAD_STATION_ON_LINE)
//@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadStationOnLine(String param) { public ReturnT<String> loadStationOnLine(String param) {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -168,6 +168,10 @@ public class HydroelectricServiceImpl implements HydroelectricService {
device.setStartupDurationYear(-1.0); device.setStartupDurationYear(-1.0);
device.setShutDownDurationYear(-1.0); device.setShutDownDurationYear(-1.0);
} }
if(CollectionUtil.isEmpty(startStopTimes)){
device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0);
}else{
// 开停机数据 // 开停机数据
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst(); Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst();
if(startStop.isPresent()){ if(startStop.isPresent()){
@ -188,6 +192,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
device.setStartDownTime("-1"); device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0); device.setStartupDownDuration(-1.0);
} }
}
return device; return device;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
} }

Loading…
Cancel
Save