From 6fe3e9841f25481cf78bd1f102886d4ce35e9e17 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 28 Jul 2023 13:38:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/qa' into qa
---
screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
index 8433ac1..0a57a88 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -62,6 +62,7 @@
QueryWrapper<Device> wrapper = new QueryWrapper();
wrapper.eq("monitor_point_id", monitorPointId);
wrapper.eq("is_delete", Constants.NOT_DELETE);
+ wrapper.orderByAsc("dev_num");
return deviceMapper.selectList(wrapper);
}
@@ -219,7 +220,17 @@
wrapper.between("time", startDate, endDate);
List<HistoryHourly> historyHourlies = multiTableQuery(wrapper, tableNames);
historyHourlies = historyHourlies.stream().distinct().collect(Collectors.toList());
+ List<HistoryHourly> distinctHistoryHourlies = new ArrayList<>();
+ Map<String, Object> disMap = new HashMap<>();
for (HistoryHourly historyHourly:historyHourlies) {
+ Date time = historyHourly.getTime();
+ String timeStr = DateUtils.dateToDateString(time,DateUtils.yyyy_MM_dd_HH_mm_ss_EN);
+ if (!disMap.containsKey(timeStr)){
+ distinctHistoryHourlies.add(historyHourly);
+ disMap.put(timeStr,true);
+ }
+ }
+ for (HistoryHourly historyHourly:distinctHistoryHourlies) {
Map<String,Object> historyHourlyMap = new HashMap<>();
historyHourlyMap.put("mac",mac);
JSONObject value = JSONObject.parseObject(historyHourly.getValue());
--
Gitblit v1.8.0