| | |
| | | } |
| | | |
| | | parameters.put("sensors1", sensorKey1); |
| | | |
| | | List<Map<String, Object>> areaList = historyMinutelyService.getAreaAvgDataByAreaCode(parameters); |
| | | |
| | | if (areaList.isEmpty()) { |
| | | Integer areaCode = Integer.valueOf(request.getParameter("areaCode")); |
| | | areaCode = hangzhouAqiService.queryCityCode(areaCode); |
| | |
| | | String time = areaMap.get("time").toString(); |
| | | time = time.substring(time.length() - 2); |
| | | areaMap.put("time", Integer.valueOf(time)); |
| | | } |
| | | |
| | | ArrayList<Map<String, Object>> resultList = new ArrayList<>(); |
| | | if (areaList.isEmpty()) { |
| | | resultList.addAll(monitorList); |
| | | for (Map<String, Object> map : monitorList) { |
| | | ArrayList<String> values = new ArrayList<>(); |
| | | values.add(null); |
| | | values.add(map.remove(s).toString()); |
| | | map.put("values", values); |
| | | } |
| | | return new ResultBean<List<Map<String, Object>>>(resultList); |
| | | |
| | | } |
| | | |
| | | Integer max = 0; |
| | |
| | | } else { |
| | | maxTime = max; |
| | | } |
| | | |
| | | ArrayList<Map<String, Object>> resultList = new ArrayList<>(); |
| | | |
| | | for (int i = 0; i <= maxTime; i++) { |
| | | resultList.add(null); |
| | |
| | | } |
| | | return new ResultBean<List<Map<String, Object>>>(list); |
| | | } |
| | | |
| | | } |