| | |
| | | |
| | | Map<String, List<Double>> result = new LinkedHashMap<>(); |
| | | List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); |
| | | |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, nowDate)); |
| | | Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getAPeriodOfTime(nowDate, -3, Calendar.HOUR_OF_DAY))); |
| | | List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); |
| | | |
| | | List<String> tableNames = new ArrayList<>(); |
| | | for(DictRecord dr : recordList){ |
| | | if (suYuanMapper.isTableExists(dr.getTableName())>0){ |
| | | for (DictRecord dr : recordList) { |
| | | if (suYuanMapper.isTableExists(dr.getTableName()) > 0) { |
| | | tableNames.add(dr.getTableName()); |
| | | } |
| | | } |
| | | if (tableNames.isEmpty()){ |
| | | if (tableNames.isEmpty()) { |
| | | return result; |
| | | } |
| | | |
| | | for(MonitorPointPosition c : checkPoints){ |
| | | for (MonitorPointPosition c : checkPoints) { |
| | | List<Double> values = new ArrayList<>(); |
| | | List<SuYuanMonitorData> data = suYuanMapper.getMonitorData(tableNames, c.getId()); |
| | | data.forEach(v -> { |
| | | values.add(v.getValue()); |
| | | }); |
| | | if (null != data && data.size() > 0) { |
| | | for (SuYuanMonitorData v : data) { |
| | | values.add(v.getValue()); |
| | | } |
| | | } |
| | | result.put(c.getName(), values); |
| | | } |
| | | return result; |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectThisMonthLocationValueDataTop10() { |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | /*List<Map<String, Object>> result = new ArrayList<>(); |
| | | List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); |
| | | Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart())); |
| | | Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd())); |
| | |
| | | } |
| | | result.add(map); |
| | | }); |
| | | return CalculateUtils.sort(result, "value", true).subList(0, 10);*/ |
| | | |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | List<MonitorPointPosition> checkPoints = commonService.getCheckPoints3d(); |
| | | Long startTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthStart())); |
| | | Long endTime = Long.parseLong(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHH, DateUtils.getMonthEnd())); |
| | | List<DictRecord> recordList = dictRecordMapper.selectByTimeDictRecordList(startTime, endTime); |
| | | |
| | | List<String> tableNames = new ArrayList<>(); |
| | | for (DictRecord dr : recordList) { |
| | | if (suYuanMapper.isTableExists(dr.getTableName()) > 0) { |
| | | tableNames.add(dr.getTableName()); |
| | | } |
| | | } |
| | | if (tableNames.isEmpty()) { |
| | | return result; |
| | | } |
| | | |
| | | for (MonitorPointPosition c : checkPoints) { |
| | | Map<String, Object> map = suYuanMapper.getMonthValueDataMax(tableNames, c.getId()); |
| | | if (null != map && map.size() > 0) { |
| | | String suYuanId = map.get("id").toString(); |
| | | map.put("name", commonService.select3dCheckPointById(suYuanId).getName()); |
| | | map.remove("id"); |
| | | } |
| | | result.add(map); |
| | | } |
| | | |
| | | return CalculateUtils.sort(result, "value", true).subList(0, 10); |
| | | } |
| | | |
| | | } |