| | |
| | | |
| | | @Override |
| | | public Map<String, List<Double>> selectEachLocationDataChange() { |
| | | Map<String, List<Double>> result = new LinkedHashMap<>(); |
| | | /*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)); |
| | |
| | | result.put(c.getName(), values); |
| | | } |
| | | }); |
| | | return result;*/ |
| | | |
| | | 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){ |
| | | tableNames.add(dr.getTableName()); |
| | | } |
| | | } |
| | | if (tableNames.isEmpty()){ |
| | | return result; |
| | | } |
| | | |
| | | for(MonitorPointPosition c : checkPoints){ |
| | | List<Double> values = new ArrayList<>(); |
| | | List<SuYuanMonitorData> data = suYuanMapper.getMonitorData(tableNames, c.getId()); |
| | | data.forEach(v -> { |
| | | values.add(v.getValue()); |
| | | }); |
| | | result.put(c.getName(), values); |
| | | } |
| | | return result; |
| | | } |
| | | |