| | |
| | | */ |
| | | |
| | | @GetMapping("fiveMinuteAvgData") |
| | | public ResultBean<List<Map<String, Object>>> getSensorFiveMinuteAvgData(HttpServletRequest request) { |
| | | public ResultBean<Map<String,Object>> getSensorFiveMinuteAvgData(HttpServletRequest request) { |
| | | //获取参数,传感器和monitorpointId |
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); |
| | | if ((!parameters.containsKey("sensorKey")) || (!parameters.containsKey("monitorPointId"))) |
| | |
| | | parameters.put("time", time); |
| | | datas = historyFiveMinutelyService.getFiveMinutesDataByMacsAndTime(parameters); |
| | | } |
| | | |
| | | datas = insertDeviceInfo(datas, devices); |
| | | return new ResultBean<List<Map<String, Object>>>(datas); |
| | | |
| | | //根据monitorPointId获取国控站坐标 |
| | | List<Map<String,Object>> coordinate = new ArrayList<>(); |
| | | MonitorPoint monitorPoint = monitorPointService.queryMonitorPointById(monitorPointId); |
| | | Integer orgId = monitorPoint.getOrganizationId(); |
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByOrganizationId(orgId); |
| | | monitorPoints.forEach(value->{ |
| | | if("国控站".equals(value.getDescription())) { |
| | | List list = LatLngTransformation.Convert_BD09_To_GCJ02(value.getLatitude(), value.getLongitude()); |
| | | Map<String,Object> controlStation = new HashMap<>(); |
| | | controlStation.put("name",value.getName()); |
| | | controlStation.put("longitude", list.get(0)); |
| | | controlStation.put("latitude", list.get(1)); |
| | | coordinate.add(controlStation); |
| | | } |
| | | }); |
| | | |
| | | Map<String,Object> datasMap = new HashMap<>(); |
| | | datasMap.put("coordinate",coordinate); |
| | | datasMap.put("device",datas); |
| | | |
| | | return new ResultBean<Map<String,Object>>(datasMap); |
| | | } |
| | | |
| | | /** |
| | | * @Description: 根据mac号获取单台设备信息,特殊客户只显示客户需要的传感器信息 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map<java.lang.String,java.lang.Object>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/22 |
| | | */ |
| | | @GetMapping("fiveMinuteAvgDataByMac") |
| | | public ResultBean<Map<String, Object>> fiveMinuteAvgDataByMac(HttpServletRequest request) { |
| | | //获取参数,mac号 |
| | |
| | | }); |
| | | |
| | | //添加设备名称 |
| | | Map<String, Object> sortDatas = new LinkedHashMap<>(); |
| | | Map<String, Object> sortDatas = new LinkedHashMap<>();//排序后的数据,用于发送前端 |
| | | Device device = deviceService.getDeviceByMac(mac, true); |
| | | sortDatas.put("名称", device.getName()); |
| | | |