From 8a447052fc1408a321c4aa3cc2c4ee2a7c45941e Mon Sep 17 00:00:00 2001 From: ZhuDongming <773644075@qq.com> Date: Wed, 04 Dec 2019 14:18:02 +0800 Subject: [PATCH] 更新重新触发弹窗清空infowindow --- src/main/java/com/moral/controller/ScreenController.java | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index 9a4183f..0fd3457 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -544,6 +544,12 @@ } } + @GetMapping("/getSensorsMap") + public List<Map<String, String>> getSensorsMapOnly(String mac) { + List<Map<String, String>> sensorsMapList = sensorService.getSensorsMaps(mac); + return sensorsMapList; + } + @RequestMapping(value = "/get-monitorpoints", method = RequestMethod.GET) @ResponseBody public ResultBean getMonitorpointList(@RequestParam("orgId") String orgId, MapBounds mapBounds, @@ -1031,8 +1037,8 @@ 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("list:"+list); - System.out.println("sensorUnitList:"+sensorUnitList); + System.out.println("list:" + list); + System.out.println("sensorUnitList:" + sensorUnitList); for (Map<String, Object> sensorMap : list) { for (Map<String, Object> sensorUnitMap : sensorUnitList) { if (sensorUnitMap.get("sensor_key").equals(sensorMap.get("sensorKey"))) { @@ -1058,7 +1064,7 @@ String intoTime = parameters.get("time").toString(); Date date = new SimpleDateFormat("yy-MM-dd").parse(intoTime); DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd"); - String alterTime = df1.format(date.getTime()-15*24*60*60*1000); + String alterTime = df1.format(date.getTime() - 15 * 24 * 60 * 60 * 1000); parameters.put("time", alterTime); ParameterUtils.getTimeType4Time(parameters); String monitor_point_id = (String) parameters.get("monitorPoint"); @@ -1077,15 +1083,15 @@ Map<String, Object> weatherMap = new HashMap<>(); Map<String, Object> tempMap = new HashMap<>(); Boolean tf = false; - for(int i=0;i<sensorKeys.length;i++) { - if(sensorKeys[i].equals("e7")) { - tf = true; - } + for (int i = 0; i < sensorKeys.length; i++) { + if (sensorKeys[i].equals("e7")) { + tf = true; + } } if (tf) { weatherMap = weatherService.get15DayWeatherDataByRegion(weatherParameters); tempMap = TempAllocationUtils.tempAllocation(weatherMap); - } + } //������������������ Map<String, Map<String, Object>> sensorUnitMap = sensorUnitService.getSensorsByMonitPointId(monitor_point_id); @@ -1093,9 +1099,9 @@ String time = map.get("time").toString(); time = time.substring(time.length() - 2); map.put("time", Integer.valueOf(time)); - if (tempMap!=null) { - map.put("temp", tempMap.get(map.get("time").toString())); - } + if (tempMap != null) { + map.put("temp", tempMap.get(map.get("time").toString())); + } List<Number> values = new ArrayList<Number>(); List<String> units = new ArrayList<String>(); for (String string : sensorKeys) { @@ -1215,6 +1221,9 @@ if (MapUtils.isEmpty(getPollutionSourceData)) { getPollutionSourceData = historyHourlyService.getPollutionSourceDataAll(parameters); } + if (MapUtils.isEmpty(getPollutionSourceData)) { + getPollutionSourceData = new HashMap<>(); + } String mac = parameters.get("mac").toString(); Device device = deviceService.getDeviceByMac(mac, false); JSONObject params = new JSONObject(); -- Gitblit v1.8.0