bug修改

This commit is contained in:
2023-05-22 20:23:06 +08:00
parent 8e57a6cb20
commit f840ab9774
4 changed files with 34 additions and 23 deletions

View File

@@ -382,13 +382,17 @@
line.sort,
line.pids,
CONCAT(voltage.name, '_', line.name) name,
comFlag.Com_Flag
comFlag.Com_Flag,
detail.pt_type
FROM
pq_line line,
pq_line_detail detail,
pq_line voltage,
pq_line device,
pq_device comFlag
WHERE
line.id = detail.id
AND
line.pid = voltage.id
AND
voltage.pid = device.id

View File

@@ -88,11 +88,12 @@ public class HarmonicServiceImpl implements IHarmonicService {
List<RStatLimitTargetDPO> finalAllData = allData;
deptList.forEach(dept->{
if (!CollectionUtils.isEmpty(dept.getSubIndexes())){
List<PollutionVO> childrenList = new ArrayList<>();
PollutionVO pollutionVO = new PollutionVO();
pollutionVO.setId(dept.getIndex());
pollutionVO.setName(dept.getName());
if (!CollectionUtils.isEmpty(dept.getSubIndexes())){
dept.getSubIndexes().forEach(sub->{
List<PollutionLineDTO> l1 = map.get(sub);
PollutionVO children = new PollutionVO();
@@ -108,7 +109,7 @@ public class HarmonicServiceImpl implements IHarmonicService {
children.setData(handleDataNew(collect,sumList,harmonicPublicParam.getStatisticalType().getCode()).getRatio());
childrenList.add(children);
});
}
if (!CollectionUtils.isEmpty(childrenList)){
pollutionVO.setChildren(childrenList.stream().sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList()));
}
@@ -117,6 +118,8 @@ public class HarmonicServiceImpl implements IHarmonicService {
pollutionVO.setData(NumberUtil.round(childrenList.stream().mapToDouble(PollutionVO::getData).average().orElse(3.14159),2).doubleValue());
}
list.add(pollutionVO);
}
});
if (!CollectionUtils.isEmpty(list)){
return list.stream().sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList());
@@ -145,10 +148,9 @@ public class HarmonicServiceImpl implements IHarmonicService {
List<RStatLimitTargetDPO> finalAllData = allData;
deptList.forEach(item->{
List<String> lineList = item.getLineIndexes();
HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO();
if (!CollectionUtils.isEmpty(lineList)){
HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO();
List<RStatLimitTargetDPO> collect = limitTargetNew.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList());
List<RStatLimitTargetDPO> sumList = finalAllData.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList());
@@ -156,10 +158,11 @@ public class HarmonicServiceImpl implements IHarmonicService {
AreaDTO areaDTO = handleDataNew(collect, sumList, param.getStatisticalType().getCode());
BeanUtil.copyProperties(areaDTO,harmonicDeptVO);
}
harmonicDeptVO.setId(item.getIndex());
harmonicDeptVO.setName(item.getName());
list.add(harmonicDeptVO);
}
});
if (!CollectionUtils.isEmpty(list)){
return list.stream().sorted(Comparator.comparing(HarmonicDeptVO::getRatio).reversed().thenComparing(HarmonicDeptVO::getOnlineCount).thenComparing(HarmonicDeptVO::getOverLineCount)).collect(Collectors.toList());
@@ -586,7 +589,7 @@ public class HarmonicServiceImpl implements IHarmonicService {
sum = targetDMapper.getSumV(lineList, startTime, endTime);
} else if (Objects.equals(type, DicDataEnum.XBDL_ENUM.getCode())){
sum = targetDMapper.getSumV(lineList, startTime, endTime);
sum = targetDMapper.getSumI(lineList, startTime, endTime);
}
if(CollUtil.isNotEmpty(sum)){

View File

@@ -232,10 +232,14 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
harmonicPublicParam.setServerName(generalInfo.getMicroServiceName());
List<GeneralDeviceDTO> sub = generalDeviceInfoClient.getPracticalRunDeviceInfo(harmonicPublicParam).getData();
for (GeneralDeviceDTO temp : sub) {
List<String> subIndexes = temp.getSubIndexes();
if(CollectionUtil.isEmpty(subIndexes)){
continue;
}
PollutionVO pollutionVO = new PollutionVO();
String detpid = temp.getIndex();
String name = temp.getName();
List<String> subIndexes = temp.getSubIndexes();
pollutionVO.setId(detpid);
pollutionVO.setName(name);
pollutionVO.setData(-1.0);

View File

@@ -321,7 +321,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
if (deptVo.getType() == 0) {
deptVo.setName(deptVo.getAreaName());
}
}).collect(Collectors.toList());
}).sorted(Comparator.comparing(DeptTreeVO::getSort)).collect(Collectors.toList());
}
/**