cjl
2023-08-02 0a15ced309df3fb76f1af4ee656d79a46e66bc92
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());