jinpengyong
2023-06-15 dbb8355061b6f60976d410fe475157c6e82f5593
screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -219,7 +219,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());