| | |
| | | public ResultBean<List<Map<String, Object>>> getSensorByMonitorPointId(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
|
| | | String monitor_point_id = (String) parameters.get("monitor_point_id");
|
| | | System.out.println("ScreenController-----getSensorByMonitorPointId-----monitor_point_id:"+monitor_point_id);
|
| | | List<Map<String, Object>> map = sensorUnitService.getSensorsByMonitPointId2(monitor_point_id);
|
| | | System.out.println("ScreenController-----getSensorByMonitorPointId-----map:"+map);
|
| | | return new ResultBean<List<Map<String, Object>>>(map);
|
| | | }
|
| | |
|
| | |
| | | String monitor_point_id = (String) parameters.get("monitorPoint");
|
| | | parameters.put("monitorPointId", parameters.remove("monitorPoint"));
|
| | | String[] sensorKeys = parameters.remove("sensorKey").toString().split(",");
|
| | | System.out.println("ScreenController-----AIForecast-----sensorKeys:"+sensorKeys.toString());
|
| | | parameters.put("sensors", Arrays.asList(sensorKeys));
|
| | | // monitorPointService.isCompensateCalculation(parameters);
|
| | | List<Map<String, Object>> list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters);
|
| | | System.out.println("ScreenController-----AIForecast-----list:"+list);
|
| | |
|
| | | //获取单位信息
|
| | | Map<String, Map<String, Object>> sensorUnitMap = sensorUnitService.getSensorsByMonitPointId(monitor_point_id);
|
| | |
| | | units.add(sensorUnitMap.get(string).get("name").toString());
|
| | | }else {
|
| | | Map<String, Object> sensorMap = sensorService.getSensorBySensorKey(string);
|
| | | System.out.println("ScreenController-----AIForecast-----sensorMap:"+sensorMap);
|
| | | units.add(sensorMap.get("unit").toString());
|
| | | }
|
| | | }else {
|
| | | Map<String, Object> sensorMap = sensorService.getSensorBySensorKey(string);
|
| | | System.out.println("ScreenController-----AIForecast-----sensorMap:"+sensorMap);
|
| | | units.add(sensorMap.get("unit").toString());
|
| | | }
|
| | | values.add((Number) map.remove(string));
|
| | |
| | | map.put("values", values);
|
| | | map.put("units", units);
|
| | | }
|
| | | |
| | | |
| | | /*
|
| | | if(sensorMap!=null && !sensorMap.isEmpty()) {
|
| | | for (Map<String, Object> map : list) {
|
| | | System.out.println("ScreenController-----AIForecast-----map:"+map);
|
| | | String time = map.get("time").toString();
|
| | | time = time.substring(time.length() - 2);
|
| | | map.put("time", Integer.valueOf(time));
|
| | | map.put("value", map.remove(sensorKey));
|
| | | System.out.println("ScreenController-----AIForecast-----map:"+map);
|
| | | System.out.println(sensorMap.get("unit"));
|
| | | //String sensor = map.get("sensorKey").toString();
|
| | | if(sensorMap.get(sensorKey)!=null) {
|
| | | map.put("unit", sensorMap.get(sensorKey).get("name"));
|
| | | }else {
|
| | | map.put("unit", "mg/m³");
|
| | | }
|
| | | }
|
| | | }*/
|
| | | //return null;
|
| | | System.out.println("ScreenController-----AIForecast-----list:"+list);
|
| | | return new ResultBean<List<Map<String, Object>>>(list);
|
| | | }
|