From 2b3c06ae70b16b83063158d092094619579a4d7b Mon Sep 17 00:00:00 2001 From: 于紫祥_1901 <email@yuzixiang_1910> Date: Tue, 27 Oct 2020 14:40:12 +0800 Subject: [PATCH] 风场更新 --- src/main/java/com/moral/controller/ScreenController.java | 34 ++++++++++++++++++++++++++++++---- 1 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index da6a8cc..e7459a2 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -1060,7 +1060,34 @@ public ResultBean<List<MonitorPoint>> getMonitorPointsAndDevicesByRegion(HttpServletRequest request) throws Exception { Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); + String regionCode = parameters.get("regionCode").toString(); List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(parameters); + + //������������������������������ + if (regionCode.startsWith("1309")) { + List<Integer> orgIds = new ArrayList<>(); + Collections.addAll(orgIds, 60, 65, 159, 165, 166); + Iterator<MonitorPoint> iter = monitorPoints.iterator(); + while (iter.hasNext()) { + MonitorPoint next = iter.next(); + Integer mpId = next.getId(); + Integer orgId = next.getOrganizationId(); + if (!orgIds.contains(orgId)) { + iter.remove(); + } else { + if (orgId == 60) { + if (mpId != 56) { + iter.remove(); + } + } else if (orgId == 65) { + if (mpId != 83 && mpId != 84) { + iter.remove(); + } + } + } + } + } + //������������monitorPoint������������������device.getName()������������ for (MonitorPoint monitorPoint : monitorPoints) { List<Device> deviceList = monitorPoint.getDevices(); @@ -1996,7 +2023,7 @@ Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MINUTE, (calendar.get(Calendar.MINUTE) - 2)); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - String time = df.format(calendar.getTime()) + ":00"; + //String time = df.format(calendar.getTime()) + ":00"; int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; String mon; @@ -2006,7 +2033,7 @@ mon = "" + month; } String table = "history_minutely_" + year + mon; - List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId, time, table); + List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId,table); return list; } @@ -2027,7 +2054,7 @@ mon = "" + month; } String table = "history_minutely_" + year + mon; - List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId, time, table); + List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId,table); return list; } @@ -2520,7 +2547,6 @@ @ApiImplicitParam(name = "endTime", value = "������������(���������2020-08-04)", required = false, paramType = "query", dataType = "String")}) public ResultBean<List<Map<String, Object>>> getAllDeviceDataToExcel(HttpServletRequest request) throws Exception { Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); - ParameterUtils.getTimeType4Time(parameters); List<Map<String, Object>> list = historyMinutelyService.getAllDeviceDataToExcel(parameters); return new ResultBean<List<Map<String, Object>>>(list); } -- Gitblit v1.8.0