Commit eb593da5 authored by duanruiming's avatar duanruiming

[add] 重点路口时间优化

parent 425c88b0
......@@ -228,7 +228,7 @@ public class TrendServiceImpl implements TrendService {
}
wDirVo.setSpeed(speed / 2);
wDirVo.setStopTimes((int) (stopTimes / 2));
wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2);
wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2);
wDirVo.setTravelTime(travelTime / 2);
wDirVo.setType("双向绿波");
greenwaveListVOList.add(wDirVo);
......@@ -1817,6 +1817,9 @@ public class TrendServiceImpl implements TrendService {
}
}
}
if (StringUtils.isNotBlank(crossId)) {
return hotspotCrossVOS.stream().sorted(Comparator.comparing(HotspotCrossVO::getTimeStamp).reversed()).collect(Collectors.toList());
}
return hotspotCrossVOS.stream().sorted(Comparator.comparing(HotspotCrossVO::getTimeStamp)).collect(Collectors.toList());
} catch (Exception e) {
log.error("重点路口监测异常:", e);
......@@ -2051,6 +2054,7 @@ public class TrendServiceImpl implements TrendService {
/**
* 设置状态时间比例
*
* @param crossStatusTimeRateVO
* @param status
* @param rate
......@@ -2159,7 +2163,7 @@ public class TrendServiceImpl implements TrendService {
resultPojo.setDirName(BaseEnum.SignalDirectionEnum.getNameByCode(dir));
resultPojo.setOverflowId(String.valueOf(dir));
resultPojo.setOverflowNums(overflowNums);
resultPojo.setSpeed( Math.round((meanV / dirList.size()) * 100) / 100.0);
resultPojo.setSpeed(Math.round((meanV / dirList.size()) * 100) / 100.0);
resultPojo.setVehicleLengthRatio(Math.round(vehicleLengthRatio / dirList.size() * 100));
return resultPojo;
}
......
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