| | |
| | | List<Map<String, Object>> map = sensorUnitService.getSensorsByMonitPointId2(monitor_point_id);
|
| | | return new ResultBean<List<Map<String, Object>>>(map);
|
| | | }
|
| | | |
| | | @GetMapping("getSensorByDeviceId")
|
| | | @ApiOperation(value = "通过设备获取因子", notes = "通过设备获取因子")
|
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "id", value = "设备id", required = true, paramType = "query", dataType = "String")
|
| | | })
|
| | | public ResultBean<List<Map<String, Object>>> getSensorByDeviceId(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
|
| | | String id = (String) parameters.get("id");
|
| | | List<Map<String, Object>> list = sensorService.getSensorByDeviceId(id);
|
| | | Map<String,Object> map = list.get(0);
|
| | | String monitor_point_id = map.get("monitor_point_id").toString();
|
| | | List<Map<String, Object>> sensorUnitList = sensorUnitService.getSensorsByMonitPointId2(monitor_point_id);
|
| | | System.out.println(sensorUnitList);
|
| | | for (Map<String, Object> sensorMap : list) {
|
| | | for (Map<String, Object> sensorUnitMap : sensorUnitList) {
|
| | | if (sensorUnitMap.get("sensor_key").equals(sensorMap.get("sensor_key"))) {
|
| | | sensorMap.put("unit", sensorUnitMap.get("name"));
|
| | | }
|
| | | }
|
| | | }
|
| | | return new ResultBean<List<Map<String, Object>>>(list);
|
| | | }
|
| | | |
| | | @GetMapping("getSensorWithUnitByMonitorPointId")
|
| | | @ApiOperation(value = "通过站点获取因子", notes = "通过站点获取因子")
|
| | | @ApiImplicitParams(value = {
|
| | | @ApiImplicitParam(name = "monitor_point_id", value = "站点id", required = true, paramType = "query", dataType = "String")
|
| | | })
|
| | | public ResultBean<List<Map<String, Object>>> getSensorWithUnitByMonitorPointId(HttpServletRequest request) throws Exception {
|
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
|
| | | String monitor_point_id = (String) parameters.get("monitor_point_id");
|
| | | List<Map<String, Object>> list = sensorService.getSensorByMonitorPointId(monitor_point_id);
|
| | | List<Map<String, Object>> sensorUnitList = sensorUnitService.getSensorsByMonitPointId2(monitor_point_id);
|
| | | System.out.println(sensorUnitList);
|
| | | for (Map<String, Object> sensorMap : list) {
|
| | | for (Map<String, Object> sensorUnitMap : sensorUnitList) {
|
| | | if (sensorUnitMap.get("sensor_key").equals(sensorMap.get("sensor_key"))) {
|
| | | sensorMap.put("unit", sensorUnitMap.get("name"));
|
| | | }
|
| | | }
|
| | | }
|
| | | return new ResultBean<List<Map<String, Object>>>(list);
|
| | | }
|
| | |
|
| | | @GetMapping("AIForecast")
|
| | | @ApiOperation(value = "AI预测", notes = "AI预测")
|