Commit d6d18d80 authored by hezhuozhi's avatar hezhuozhi

解决区域重复问题、及处理分数为0显示安全问题

parent 6c4cd2a6
......@@ -227,7 +227,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizFanWeight::getValue));
// 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
fanHealthIndicesZxtMap.forEach((k, v) -> {
FanHealthIndex fanHealthIndex = new FanHealthIndex();
......
......@@ -220,7 +220,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizPvWeight::getValue));
// 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
healthIndicesMap.forEach((k, v) -> {
PvHealthIndex pvHealthIndex = new PvHealthIndex();
......
......@@ -274,7 +274,6 @@ public class TdengineTimeServiceImpl {
healthStatusIndicatorServiceImpl.healthWarningDayGF();
}
private String getHealthLevelByScore(List<IdxBizFanHealthLevel> levelList, Double healthIndex) {
String levelDesc = "安全";
for (IdxBizFanHealthLevel item : levelList) {
......@@ -282,7 +281,7 @@ public class TdengineTimeServiceImpl {
levelDesc = item.getHealthLevel();
break;
}
if (healthIndex == 0 && item.getGroupLowerLimit() == healthIndex){
if (healthIndex == 0 && item.getGroupLowerLimit().equals(healthIndex)){
levelDesc = item.getHealthLevel();
break;
}
......@@ -460,6 +459,10 @@ public class TdengineTimeServiceImpl {
levelDesc = item.getHealthLevel();
break;
}
if (healthIndex == 0 && item.getGroupLowerLimit().equals(healthIndex)){
levelDesc = item.getHealthLevel();
break;
}
}
return levelDesc;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment