Browse Source

#站点管理、集中监控增加下限水位

zhongwei
yang_shj 8 months ago
parent
commit
f645f1e98a
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  2. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  3. 28
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  4. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  5. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java

@ -34,6 +34,9 @@ public class RealStationVo implements Serializable {
@ApiModelProperty("最大前池水位")
private Double waterLevelMax;
@ApiModelProperty("下限前池水位")
private Double downWaterLevel;
@ApiModelProperty("前池水位")
private Double waterLevel;

10
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java

@ -18,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.server.domain.Sys;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@ -88,9 +90,10 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
}
}
}
// fpd告警拼接
if(AlarmConstants.EARLY_WARNING.equals(alarm.getAlarmSource())){
alarm.setAlarmContext(optional.get().getName() + "." + alarm.getAlarmContext());
// 告警站点名称截取
if(StringUtil.isNotBlank(alarm.getAlarmContext()) && !AlarmConstants.CONDITION_ALARM.equals(alarm.getAlarmSource())){
String[] countext = alarm.getAlarmContext().split("\\.");
alarm.setAlarmContext(countext[countext.length - 1]);
}
// 步骤3.站点参数设置
alarm.setCreateDept(optional.get().getCreateDept());
@ -126,5 +129,4 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
});
return true;
}
}

28
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -127,7 +127,7 @@ public class RealTargetServiceImpl implements RealTargetService {
private final static String load_photovoltaic_target_key = "hzims:operation:photovoltaic:target:key";
// 创建线程池
//private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-power-data-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy());
private static final ExecutorService pool = new ThreadPoolExecutor(10, 10, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), new ThreadFactoryBuilder().setNameFormat("load-power-data-pool-%d").build() , new ThreadPoolExecutor.CallerRunsPolicy());
@Override
public void loadEmInfo(String param) {
@ -1250,20 +1250,24 @@ public class RealTargetServiceImpl implements RealTargetService {
// 将站点切割
int limit = countStep(stations.size());
List<List<StationEntity>> limits = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stations.stream().skip((long) a * 3).limit(3).parallel().collect(Collectors.toList())).collect(Collectors.toList());
CountDownLatch countDownLatch = new CountDownLatch(limits.size());
for(List<StationEntity> item : limits){
try{
item.forEach(station->{
// 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
Map<String, Float> generateMap = this.getGenerateYear(station,stationDevices,start,end);
if(MapUtils.isEmpty(generateMap)){
return;
}
log.error("pool_item_execute_complete: {}" ,JSONObject.toJSONString(generateMap));
powerMap.put(station.getId(),generateMap);
pool.submit(()->{
item.forEach(station->{
// 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
Map<String, Float> generateMap = this.getGenerateYear(station,stationDevices,start,end);
if(MapUtils.isEmpty(generateMap)){
return;
}
powerMap.put(station.getId(),generateMap);
});
countDownLatch.countDown();
log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
});
}catch (Exception exception){
log.error("pool_item_execute_complete_error: {}" ,exception.getMessage());
}catch (Exception e){
log.error("pool_item_execute_complete_error : {}" ,e.getMessage());
}
}
redisTemplate.opsForValue().set(recent_year_power_data, powerMap);

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -500,6 +500,7 @@ public class MonitorServiceImpl implements MonitorService {
}
realStation.setStationCode(optional.get().getCode());
realStation.setStationName(optional.get().getName());
realStation.setDownWaterLevel(Optional.ofNullable(optional.get().getDownWaterLevel()).orElse(0.0));
realStation.setWaterLevelMax(Optional.ofNullable(optional.get().getLimitWaterLevel()).orElse(0.0));
realStation.setServerType(optional.get().getServeType());
realStation.setStationDeptId(optional.get().getRefDept());

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -336,12 +336,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
return;
}
station.setWaterLevel(levelList.get(0));
if(ObjectUtil.isEmpty(station.getWaterLevelMax()) || ObjectUtil.isEmpty(station.getWaterLevel()) || station.getWaterLevelMax() <= 0 || station.getWaterLevel() <= 0){
if(station.getWaterLevel() <= 0){
return;
}
if(station.getWaterLevelMax() < station.getWaterLevel()){
if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){
station.setWaterColor(2);
}else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.9){
}else if((station.getWaterLevelMax() > 0 && (station.getWaterLevel() / station.getWaterLevelMax()) > 0.8) || (station.getDownWaterLevel() > 0 && (station.getWaterLevel() / station.getDownWaterLevel()) < 1.2)){
station.setWaterColor(1);
}
}

Loading…
Cancel
Save