From 11999481fbcdacd6425217cd89c21ac17579ea7a Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Thu, 17 Dec 2020 15:57:31 +0800 Subject: [PATCH] 删除打印 --- src/main/java/com/moral/controller/ScreenController.java | 30 ++++++++++++++++++++---------- 1 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index a617066..5521008 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -3013,6 +3013,7 @@ @ApiImplicitParams(value = { @ApiImplicitParam(name = "monitorPointId", value = "������Id", required = true, paramType = "query", dataType = "String"), @ApiImplicitParam(name = "sensorKey", value = "������", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "realTime", value = "������", required = true, paramType = "query", dataType = "String"), @ApiImplicitParam(name = "accountId", value = "������id", required = false, paramType = "query", dataType = "String")}) public ModelAndView unorganizedEmissionsBackupsV2(HttpServletRequest request, ModelAndView model) { Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); @@ -3023,9 +3024,18 @@ List<Device> deviceList = deviceService.getDevicesByMonitorPointId(539); //��������������������� Map<String,Object> pa = new HashMap<>(); + //��������������������������������� + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Calendar beforeTime = Calendar.getInstance(); + Date newTime = beforeTime.getTime(); + beforeTime.add(Calendar.MINUTE,-5); + Date startTime = beforeTime.getTime(); + beforeTime.add(Calendar.MINUTE,6); + Date endTime = beforeTime.getTime(); //pa.put("sensorKey","e1"); - pa.put("yearAndMonth","202012"); - pa.put("time","2020-12-03 10:10:00"); + pa.put("yearAndMonth",sdf.format(newTime).substring(0,7).replace("-","")); + pa.put("startTime",startTime); + pa.put("endTime",endTime); List<String> macs = new ArrayList<>(); List<String> sensorKeys = new ArrayList<>(); for (Device device:deviceList) { @@ -3036,15 +3046,18 @@ sensorKeys.add("e23"); pa.put("macs",macs); pa.put("sensorKeys",sensorKeys); - List<Map<String, Object>> fiveMinuteDataList = historyFiveMinutelyService.getFiveMinutesSersorDataByMacsAndTime(pa); + pa.put("macNumber",macs.size()); + List<Map<String, Object>> fiveMinuteDataList = historyFiveMinutelyService.getFiveMinutesDataByMacsAndTimeSolt(pa); //������������������������������������������ double[] allDeviceData = new double[fiveMinuteDataList.size()]; - System.out.println(fiveMinuteDataList); int i = 0; //������������ List<Map<String,Object>> windList = new ArrayList<>(); for (Map map:fiveMinuteDataList) { String[] wind_speed = map.get("e18").toString().split(","); + if (!map.containsKey("e23")){ + continue; + } String[] wind_direction = map.get("e23").toString().split(","); Map<String,Object> windMap = new HashMap<>(); windMap.put("wind_speed",wind_speed[0].substring(1,wind_speed[0].length())); @@ -3111,15 +3124,13 @@ //��������������������������������������������� double distance = mapUtils.getDistance(pollutionSourcePoint.getLongitude(),pollutionSourcePoint.getLatitude(),referenceDevice.getLongitude(),referenceDevice.getLatitude()); //���������������������������x,y - double x = Math.cos(minDisparity.get().getValue())*distance; - double y = Math.sin(minDisparity.get().getValue())*distance; + double x = Math.cos(Math.toRadians(minDisparity.get().getValue()))*distance; + double y = Math.sin(Math.toRadians(minDisparity.get().getValue()))*distance; //��������������������� - String[] fiveMinuteData = fiveMinuteDataMap.get("e21").toString().split(","); + String[] fiveMinuteData = fiveMinuteDataMap.get(sensorKey).toString().split(","); double c = Double.parseDouble(fiveMinuteData[0].substring(1,fiveMinuteData[0].length()))-deviceDataAvg; - System.out.println(c); //������������ double pollutionSourceIntensity = EmissionDataUtil.getPollutionSourceIntensity(c,x,y,res.get("wind_speed")); - System.out.println(pollutionSourceIntensity); //��������������������� Map<String,Object> center = new HashMap<>(); @@ -3163,7 +3174,6 @@ numericalValueMap7.put("lat",31.450588); numericalValueMap7.put("count",0.10); numericalValueList.add(numericalValueMap7); - System.out.println(numericalValueList.toString()); JSONObject params = new JSONObject(); -- Gitblit v1.8.0