Commit d44136f3 authored by duanruiming's avatar duanruiming

[update] 态势监测-转向数据优化数据结构

parent 80e7f51d
......@@ -1750,9 +1750,10 @@ public class TrendServiceImpl implements TrendService {
.between(CrossTurnDataHistPO::getBatchTime, dateTime - 3600, dateTime);
List<CrossTurnDataHistPO> turnDataHistPOList = crossTurnDataHistMapper.selectList(turnQuery);
if (!CollectionUtils.isEmpty(turnDataHistPOList)) {
Map<Date, List<CrossTurnDataHistPO>> collect = turnDataHistPOList.stream().collect(Collectors.groupingBy(CrossTurnDataHistPO::getStartTime));
for (Map.Entry<Date, List<CrossTurnDataHistPO>> entry : collect.entrySet()) {
Date key = entry.getKey();
Map<Integer, List<CrossTurnDataHistPO>> collect = turnDataHistPOList.stream().collect(Collectors.groupingBy(CrossTurnDataHistPO::getBatchTime));
for (Map.Entry<Integer, List<CrossTurnDataHistPO>> entry : collect.entrySet()) {
HotspotCrossTurnVO hotspotCrossTurnVO = new HotspotCrossTurnVO();
Integer timeStamp = entry.getKey();
List<CrossTurnDataHistPO> value = entry.getValue();
if (!CollectionUtils.isEmpty(value)) {
Map<Integer, List<CrossTurnDataHistPO>> dirMap = value.stream().collect(Collectors.groupingBy(CrossTurnDataHistPO::getInDir));
......@@ -1767,10 +1768,9 @@ public class TrendServiceImpl implements TrendService {
turnDetail.setFlow(crossTurnDataHistPO.getFlow());
turnDetails.add(turnDetail);
}
HotspotCrossTurnVO hotspotCrossTurnVO = new HotspotCrossTurnVO();
hotspotCrossTurnVO.setCrossId(crossId);
hotspotCrossTurnVO.setDir(dir);
hotspotCrossTurnVO.setTimeStamp(key);
hotspotCrossTurnVO.setTimeStamp(new Date(timeStamp));
hotspotCrossTurnVO.setTurnList(turnDetails);
results.add(hotspotCrossTurnVO);
}
......
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