Commit 762e9980 authored by duanruiming's avatar duanruiming

[add] 绿波子区时段指标

parent dd9fa48e
......@@ -37,14 +37,14 @@ public class GreenBeltServiceImpl implements GreenBeltInfoService {
LocalDate nextDate = currentDate.plusDays(1);
LocalTime endTime = LocalTime.MIDNIGHT; // 00:00 of the next day
LocalDateTime endOfDay = LocalDateTime.of(nextDate, endTime);
long startSecond = startOfDay.toEpochSecond(ZoneOffset.of("+8"));
long startSecond = startOfDay.toEpochSecond(ZoneOffset.of("+8")) + 5 * 600;
long endSecond = endOfDay.toEpochSecond(ZoneOffset.of("+8"));
List<CrossDataHistPO> crossDataHistPOS = crossDataHistMapper.selectByCrossIdsAndTimestamp(crossIds, (int) startSecond, (int) endSecond);
List<CrossDataHistPO> crossDataHistPOS = crossDataHistMapper.selectByCrossIdsAndTimestamp(crossIds, (int) startSecond , (int) endSecond);
if (!CollectionUtils.isEmpty(crossDataHistPOS)) {
List<GreenBeltFlowStopTimeVO> results = new ArrayList<>();
Map<Date, List<CrossDataHistPO>> startTimeMap = crossDataHistPOS.stream().collect(Collectors.groupingBy(CrossDataHistPO::getStartTime));
GreenBeltFlowStopTimeVO greenBeltFlowStopTimeVO = new GreenBeltFlowStopTimeVO();
for (Map.Entry<Date, List<CrossDataHistPO>> entry : startTimeMap.entrySet()) {
GreenBeltFlowStopTimeVO greenBeltFlowStopTimeVO = new GreenBeltFlowStopTimeVO();
Date startDate = entry.getKey();
List<GreenBeltFlowStopTimeVO.FlowStopTimeDetail> crossList = new ArrayList<>();
greenBeltFlowStopTimeVO.setStartTime(startDate);
......@@ -61,6 +61,7 @@ public class GreenBeltServiceImpl implements GreenBeltInfoService {
greenBeltFlowStopTimeVO.setDetailList(crossList);
results.add(greenBeltFlowStopTimeVO);
}
Collections.sort(results, Comparator.comparing(GreenBeltFlowStopTimeVO::getStartTime));
return results;
}
return Collections.EMPTY_LIST;
......
......@@ -68,7 +68,7 @@
<dependency>
<groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId>
<version>0.0.1</version>
<version>0.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......
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