|  |  |  | 
|---|
|  |  |  | return new ResultBean<Map<String, Object>>(map); | 
|---|
|  |  |  | }*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*@GetMapping("getSensorByMonitorPointId") | 
|---|
|  |  |  | @GetMapping("getSensorByMonitorPointId") | 
|---|
|  |  |  | @ApiOperation(value = "返回单位", notes = "返回单位") | 
|---|
|  |  |  | @ApiImplicitParams(value = { | 
|---|
|  |  |  | @ApiImplicitParam(name = "monitor_point_id", value = "监测站点id", required = true, paramType = "query", dataType = "String") | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ResultBean<Map<String, Object>> getSensorByMonitorPointId(HttpServletRequest request) throws Exception { | 
|---|
|  |  |  | public ResultBean<Map<String, 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); | 
|---|
|  |  |  | Map<String, Object> map = sensorUnitService.getSensorsByMonitPointId(monitor_point_id); | 
|---|
|  |  |  | Map<String, Map<String, Object>> map = sensorUnitService.getSensorsByMonitPointId(monitor_point_id); | 
|---|
|  |  |  | System.out.println("ScreenController-----getSensorByMonitorPointId-----map:"+map); | 
|---|
|  |  |  | return new ResultBean<Map<String, Object>>(map); | 
|---|
|  |  |  | }*/ | 
|---|
|  |  |  | return new ResultBean<Map<String, Map<String, Object>>>(map); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("AIForecast") | 
|---|
|  |  |  | @ApiOperation(value = "AI预测", notes = "AI预测") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取单位信息 | 
|---|
|  |  |  | Map<String, Map<String, Object>> sensorUnitMap = sensorUnitService.getSensorsByMonitPointId(monitor_point_id); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*if(sensorUnitMap!=null && !sensorUnitMap.isEmpty()) { | 
|---|
|  |  |  | for (Map<String, Object> map : list) { | 
|---|
|  |  |  | String time = map.get("time").toString(); | 
|---|
|  |  |  | time = time.substring(time.length() - 2); | 
|---|
|  |  |  | map.put("time", Integer.valueOf(time)); | 
|---|
|  |  |  | List<Number> values = new ArrayList<Number>(); | 
|---|
|  |  |  | for (String string : sensorKeys) { | 
|---|
|  |  |  | values.add((Number) map.remove(string)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("values", values); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | for (Map<String, Object> map : list) { | 
|---|
|  |  |  | String time = map.get("time").toString(); | 
|---|
|  |  |  | time = time.substring(time.length() - 2); | 
|---|
|  |  |  | map.put("time", Integer.valueOf(time)); | 
|---|
|  |  |  | List<Number> values = new ArrayList<Number>(); | 
|---|
|  |  |  | for (String string : sensorKeys) { | 
|---|
|  |  |  | values.add((Number) map.remove(string)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("values", values); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Map<String, Object> map : list) { | 
|---|
|  |  |  | String time = map.get("time").toString(); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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)); | 
|---|