Commit 6e1e4ce7 authored by hezhuozhi's avatar hezhuozhi

修复健康指数分析天和小时不出现问题

parent de8bfc3d
...@@ -62,7 +62,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -62,7 +62,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "5"); idxBizFanWeightQueryWrapper.eq("type", "5");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getPointName() + o.getKks() + o.getOrgCode())); Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getPointName() + o.getKks() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -120,7 +120,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -120,7 +120,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "5"); idxBizFanWeightQueryWrapper.eq("type", "5");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getOrgCode())); Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubSystem() + o.getEquipmentName() + o.getNumber() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -173,7 +173,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -173,7 +173,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "4"); idxBizFanWeightQueryWrapper.eq("type", "4");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizFanWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getNumber() + o.getEquipmentName() + o.getOrgCode())); Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getNumber() + o.getEquipmentName() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -225,7 +225,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -225,7 +225,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "3"); idxBizFanWeightQueryWrapper.eq("type", "3");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); 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, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> 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<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -276,7 +276,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -276,7 +276,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "2"); idxBizFanWeightQueryWrapper.eq("type", "2");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizFanWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode())); Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -325,7 +325,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -325,7 +325,7 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
idxBizFanWeightQueryWrapper.eq("type", "1"); idxBizFanWeightQueryWrapper.eq("type", "1");
idxBizFanWeightQueryWrapper.isNotNull("value"); idxBizFanWeightQueryWrapper.isNotNull("value");
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(idxBizFanWeightQueryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizFanWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode())); Map<String, List<FanHealthIndex>> fanHealthIndicesZxtMap = fanHealthIndicesZxt.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode()));
List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>(); List<FanHealthIndex> fanHealthIndicesZxtNews = new ArrayList<>();
...@@ -354,11 +354,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -354,11 +354,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
public List<HealthIndexDTO> getInfoListByGroupByQy(String startTime, String fanTableName, String pvTableName, String analysisObjectType) { public List<HealthIndexDTO> getInfoListByGroupByQy(String startTime, String fanTableName, String pvTableName, String analysisObjectType) {
List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType); List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType);
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "2").isNotNull("value")); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "2").isNotNull("value"));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae() + o.getStation(), IdxBizFanWeight::getValue)); Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae() + o.getStation(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType); List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType);
List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "2").isNotNull("value")); List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "2").isNotNull("value"));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae() + o.getStation(), IdxBizPvWeight::getValue)); Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae() + o.getStation(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>(); List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>();
healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList())); healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList()));
...@@ -396,11 +396,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService { ...@@ -396,11 +396,11 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
public List<HealthIndexDTO> getInfoListByGroupByQg(String startTime, String fanTableName, String pvTableName, String analysisObjectType) { public List<HealthIndexDTO> getInfoListByGroupByQg(String startTime, String fanTableName, String pvTableName, String analysisObjectType) {
List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType); List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.getInfoList(startTime, fanTableName, analysisObjectType);
List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "1").isNotNull("value")); List<IdxBizFanWeight> idxBizFanWeights = idxBizFanWeightMapper.selectList(new QueryWrapper<IdxBizFanWeight>().eq("type", "1").isNotNull("value"));
Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae(), IdxBizFanWeight::getValue)); Map<String, Float> fanWeightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> "fan" + o.getArae(), IdxBizFanWeight::getValue,(item1, item2) -> item1));
List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType); List<PvHealthIndex> pvHealthIndices = pvHealthIndexMapper.getInfoList(startTime, pvTableName, analysisObjectType);
List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "1").isNotNull("value")); List<IdxBizPvWeight> pvIdxBizFanWeights = idxBizPvWeightMapper.selectList(new QueryWrapper<IdxBizPvWeight>().eq("type", "1").isNotNull("value"));
Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae(), IdxBizPvWeight::getValue)); Map<String, Float> pvWeightMap = pvIdxBizFanWeights.stream().collect(Collectors.toMap(o -> "pv" + o.getArae(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>(); List<HealthIndexDTO> healthIndexDTOS = new ArrayList<>();
healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList())); healthIndexDTOS.addAll(fanHealthIndices.stream().map(this::toHealthIndexDTO).collect(Collectors.toList()));
......
...@@ -50,7 +50,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -50,7 +50,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "5"); queryWrapper.eq("type", "5");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubarray() + o.getManufacturer() + o.getEquipmentName() + o.getPointName() + o.getDeviceType() + o.getKks() + o.getOrgCode())); Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getIndexAddress() + o.getStation() + o.getAnalysisObjType() + o.getAnalysisObjSeq() + o.getWeight() + o.getArea() + o.getSubarray() + o.getManufacturer() + o.getEquipmentName() + o.getPointName() + o.getDeviceType() + o.getKks() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
...@@ -111,7 +111,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -111,7 +111,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "5"); queryWrapper.eq("type", "5");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray() + o.getPointName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode() + o.getEquipmentName())); Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode() + o.getEquipmentName()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
...@@ -165,7 +165,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -165,7 +165,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "4"); queryWrapper.eq("type", "4");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizPvWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName() + o.getSubarray(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode())); Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getGatewayId() + o.getStation() + o.getAnalysisObjType() + o.getArea() + o.getSubarray() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
...@@ -218,7 +218,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -218,7 +218,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "3"); queryWrapper.eq("type", "3");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); 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, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation() + o.getEquipmentName(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> 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<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
...@@ -270,7 +270,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -270,7 +270,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "2"); queryWrapper.eq("type", "2");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizPvWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae() + o.getStation(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode())); Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getArea() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
...@@ -320,7 +320,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService { ...@@ -320,7 +320,7 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
queryWrapper.eq("type", "1"); queryWrapper.eq("type", "1");
queryWrapper.isNotNull("value"); queryWrapper.isNotNull("value");
List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper); List<IdxBizPvWeight> idxBizFanWeights = idxBizPvWeightMapper.selectList(queryWrapper);
Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizPvWeight::getValue)); Map<String, Float> weightMap = idxBizFanWeights.stream().collect(Collectors.toMap(o -> o.getArae(), IdxBizPvWeight::getValue,(item1, item2) -> item1));
// 开始计算加权平均 // 开始计算加权平均
Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode())); Map<String, List<PvHealthIndex>> healthIndicesMap = pvHealthIndices.stream().collect(Collectors.groupingBy(o -> o.getAnalysisObjType() + o.getOrgCode()));
List<PvHealthIndex> pvHealthIndexList = new ArrayList<>(); List<PvHealthIndex> pvHealthIndexList = new ArrayList<>();
......
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