Browse Source

Merge remote-tracking branch 'origin/prod' into prod

zhongwei
haungxing 11 months ago
parent
commit
eae00f3d20
  1. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
  2. 39
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  3. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java

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

@ -153,13 +153,15 @@ public class HomeServiceImpl implements HomeService {
count.setServeType(serve); count.setServeType(serve);
if(HomePageConstant.CHARGE.equals(type) && "2".equals(serve)){ if(HomePageConstant.CHARGE.equals(type) && "2".equals(serve)){
TargetVo target = (TargetVo) redisTemplate.opsForValue().get(charge); TargetVo target = (TargetVo) redisTemplate.opsForValue().get(charge);
if(ObjectUtil.isNotEmpty(target)){ if(ObjectUtil.isEmpty(target)){
TargetVo charge = this.chargeTarget(); TargetVo charge = this.chargeTarget();
if(ObjectUtil.isNotEmpty(charge)){ if(ObjectUtil.isNotEmpty(charge)){
count.setCount(Long.valueOf(charge.getCharge())); count.setCount(Long.valueOf(charge.getCharge()));
}else{ }else{
count.setCount(92L); count.setCount(113L);
} }
}else{
count.setCount(Long.valueOf(target.getCharge()));
} }
}else if(HomePageConstant.WATER_CONSERVANCY.equals(type) && "2".equals(serve)){ }else if(HomePageConstant.WATER_CONSERVANCY.equals(type) && "2".equals(serve)){
count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && HomePageConstant.waterList.contains(station.getType())).count()); count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && HomePageConstant.waterList.contains(station.getType())).count());

39
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -590,7 +590,7 @@ public class HydropowerServiceImpl implements HydropowerService {
// 总有功功率(总发电负荷) // 总有功功率(总发电负荷)
response.setPowerSum(this.getPowerSum(realList,station.getRefDept())); response.setPowerSum(this.getPowerSum(realList,station.getRefDept()));
// 总有功单位 // 总有功单位
response.setPowerUnit(this.getPowerUnit(realList,station.getRefDept())); response.setPowerUnit("kW");
// 月计划发电量 // 月计划发电量
response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode())); response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode()));
// 年计划发电量 // 年计划发电量
@ -1553,14 +1553,6 @@ public class HydropowerServiceImpl implements HydropowerService {
hydropower.setMinTemp(this.intervalTemp(weekWeather,station.getCode(),false)); hydropower.setMinTemp(this.intervalTemp(weekWeather,station.getCode(),false));
// 装机容量 // 装机容量
hydropower.setCapacity(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); hydropower.setCapacity(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum());
// 负荷
hydropower.setLoad(reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum());
// 出力
if(Math.abs(hydropower.getCapacity()) > 0){
hydropower.setOutput(BigDecimal.valueOf(hydropower.getLoad() / hydropower.getCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
hydropower.setOutput(0.0);
}
// 运行天数 // 运行天数
hydropower.setRunDay(this.getRunDay(station)); hydropower.setRunDay(this.getRunDay(station));
// 告警 // 告警
@ -1571,8 +1563,9 @@ public class HydropowerServiceImpl implements HydropowerService {
// 站点设备 // 站点设备
List<HydropowerUnitRealVo> devices = reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).collect(Collectors.toList()); List<HydropowerUnitRealVo> devices = reals.stream().filter(real-> real.getDeptId().equals(station.getRefDept())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(devices)){ if(CollectionUtil.isNotEmpty(devices)){
// 设备 List<AppHydropowerDeviceVo> hydropowerDevices = new ArrayList<>();
hydropower.setDevices(devices.stream().map(real->{ Double loadSum = 0.0;
for(HydropowerUnitRealVo real : devices){
AppHydropowerDeviceVo device = new AppHydropowerDeviceVo(); AppHydropowerDeviceVo device = new AppHydropowerDeviceVo();
device.setOrd(real.getOrd()); device.setOrd(real.getOrd());
device.setDeviceCode(real.getDeviceCode()); device.setDeviceCode(real.getDeviceCode());
@ -1580,12 +1573,30 @@ public class HydropowerServiceImpl implements HydropowerService {
device.setOrd(real.getOrd()); device.setOrd(real.getOrd());
device.setState(real.getState()); device.setState(real.getState());
device.setLoadUnit(Optional.ofNullable(real.getPowerUnit()).orElse("kW")); device.setLoadUnit(Optional.ofNullable(real.getPowerUnit()).orElse("kW"));
if("MW".equalsIgnoreCase(device.getLoadUnit())){
loadSum += (real.getActivePower() * 1000);
}else{
loadSum += real.getActivePower();
}
device.setCapacity(real.getInstalledCapacity()); device.setCapacity(real.getInstalledCapacity());
device.setLoad(real.getActivePower()); device.setLoad(real.getActivePower());
return device; hydropowerDevices.add(device);
}).sorted(Comparator.comparing(AppHydropowerDeviceVo::getOrd)).collect(Collectors.toList())); };
hydropower.setLoadUnit(hydropower.getDevices().get(0).getLoadUnit()); // 设备
hydropower.setDevices(hydropowerDevices.stream().sorted(Comparator.comparing(AppHydropowerDeviceVo::getOrd)).collect(Collectors.toList()));
// 负荷
hydropower.setLoad(loadSum);
}else{
hydropower.setLoad(0.0);
} }
// 出力
if(Math.abs(hydropower.getLoad()) > 0 && Math.abs(hydropower.getCapacity()) > 0){
hydropower.setOutput(BigDecimal.valueOf(hydropower.getLoad() / hydropower.getCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}else{
hydropower.setOutput(0.0);
}
// 负荷单位
hydropower.setLoadUnit("kW");
return hydropower; return hydropower;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java

@ -48,7 +48,7 @@ public class MaintenanceTaskSchedule {
private final IOperMaintenanceTaskService taskService; private final IOperMaintenanceTaskService taskService;
private final IFlowClient flowClient; private final IFlowClient flowClient;
@XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE) /*@XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE)
public ReturnT<String> execute(String param) throws Exception { public ReturnT<String> execute(String param) throws Exception {
Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE); Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE);
Date endDate = DateUtil.parse(DateUtil.formatDate(DateUtil.plusDays(startDate, 1)), DateUtil.PATTERN_DATE); Date endDate = DateUtil.parse(DateUtil.formatDate(DateUtil.plusDays(startDate, 1)), DateUtil.PATTERN_DATE);
@ -60,7 +60,7 @@ public class MaintenanceTaskSchedule {
planList.forEach(this::generateTaskByPlan); planList.forEach(this::generateTaskByPlan);
XxlJobLogger.log("日常维护任务生成完成!"); XxlJobLogger.log("日常维护任务生成完成!");
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }*/
/** /**
* 根据日常维护计划生成日常维护任务 * 根据日常维护计划生成日常维护任务

Loading…
Cancel
Save