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.sort,
line.pids, line.pids,
CONCAT(voltage.name, '_', line.name) name, CONCAT(voltage.name, '_', line.name) name,
comFlag.Com_Flag comFlag.Com_Flag,
detail.pt_type
FROM FROM
pq_line line, pq_line line,
pq_line_detail detail,
pq_line voltage, pq_line voltage,
pq_line device, pq_line device,
pq_device comFlag pq_device comFlag
WHERE WHERE
line.id = detail.id
AND
line.pid = voltage.id line.pid = voltage.id
AND AND
voltage.pid = device.id voltage.pid = device.id
@@ -399,9 +403,9 @@
#{item} #{item}
</foreach> </foreach>
</select> </select>
<!--根据监测点索引集合获取监测点详细参数--> <!--根据监测点索引集合获取监测点详细参数-->
<select id="getDetailedParametersForLine" resultType="com.njcn.device.pq.pojo.vo.LineIntegrityDataVO"> <select id="getDetailedParametersForLine" resultType="com.njcn.device.pq.pojo.vo.LineIntegrityDataVO">
select * select *

View File

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

View File

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

View File

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