Commit 32f82706 authored by fengyasheng's avatar fengyasheng

干线周报4.1排序修改为按拥堵次数

parent 50a30adc
......@@ -263,12 +263,20 @@ public class AnalysisGreenCongestionPeriodServiceImpl implements AnalysisGreenCo
//按拥堵指数降序排序
// List<AnalysisGreenCongestionPeriodVO> periodVOS = voList.stream().sorted(Comparator.comparing(AnalysisGreenCongestionPeriodVO::getCongestIndex).reversed())
// .collect(Collectors.toList());
// List<GreenReportProblemOverallDataVO> overallDataVOS = greenList.stream().sorted(Comparator.comparing(x -> {
// double congestIndexAll = 0;
// for (GreenWaveDirProblemDataVO dataVO : x.getList()) {
// congestIndexAll += dataVO.getCongestIndex();
// }
// return - congestIndexAll/x.getList().size();
// })).collect(Collectors.toList());
//按拥堵次数降序排序
List<GreenReportProblemOverallDataVO> overallDataVOS = greenList.stream().sorted(Comparator.comparing(x -> {
double congestIndexAll = 0;
double congestCountAll = 0;
for (GreenWaveDirProblemDataVO dataVO : x.getList()) {
congestIndexAll += dataVO.getCongestIndex();
congestCountAll += dataVO.getCongestCount();
}
return - congestIndexAll/x.getList().size();
return - congestCountAll;
})).collect(Collectors.toList());
List<Integer> greenIds = new ArrayList<>();
for (GreenReportProblemOverallDataVO periodVO : overallDataVOS) {
......
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