From d7ee12cb208473741f79b64505adccd0653e4654 Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Tue, 27 Oct 2020 13:44:28 +0800 Subject: [PATCH] vue页面增加误差率参数,沧州剔除非本公司设备显示,报表接口更新 --- src/main/java/com/moral/controller/ScreenController.java | 99 ++++++++++++++++++++++++++++++------------------- 1 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index 1589d0b..1b6ff2b 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(); @@ -2227,7 +2254,6 @@ } - @GetMapping("/contrastFactor") @ApiOperation(value = "������������", notes = "������������") @ApiImplicitParams(value = { @@ -2262,13 +2288,9 @@ } - @GetMapping("/tellAlarm") + @PostMapping("/tellAlarm") @ResponseBody - public List<List> tellAlarm(@Param("states") String states, - @Param("orgId") String orgId, - @Param("accountId") String accountId, - @Param("states1") String states1, - @Param("regionCode") String regionCode) { + public List<List> tellAlarm(String states, String orgId, String accountId, String states1, String regionCode) { JSONArray stateList = JSONArray.parseArray(states);//��������������������� JSONArray stateList1 = JSONArray.parseArray(states1);//���10������������������ List<List> lookList = new ArrayList<>(); @@ -2443,7 +2465,7 @@ } String state = (String) dataMap.get("state"); String state1 = (String) dataMap.get("state1"); - List<Map> mapList=new ArrayList(); + List<Map> mapList = new ArrayList(); for (String key : list) { if (((Map) aEMap.get("eMap")).containsKey(key)) { Double val = Double.valueOf(sensorMap.get(key).toString()); @@ -2455,23 +2477,23 @@ if ((state1.equals("0") || state1.equals("1")) && Integer.parseInt(state) > 1) { if (val > Double.valueOf(String.valueOf(valueList.get(1)))) { Map lookMap = new HashMap(); - lookMap.put("time",time); - lookMap.put("name",device.getName()); - lookMap.put("sensor",sensors.get("description")); - lookMap.put("value",val + ""+sensors.get("unit")); + lookMap.put("time", time); + lookMap.put("name", device.getName()); + lookMap.put("sensor", sensors.get("description")); + lookMap.put("value", val + "" + sensors.get("unit")); mapList.add(lookMap); - //lookString = time+" "+device.getName()+sensors.get("description")+"="+val + sensors.get("unit")+"������"; - //System.out.println(time + "====" + device.getName() + "=====" + sensors.get("description") + "======" + val + sensors.get("unit")); + //lookString = time+" "+device.getName()+sensors.get("description")+"="+val + sensors.get("unit")+"������"; + //System.out.println(time + "====" + device.getName() + "=====" + sensors.get("description") + "======" + val + sensors.get("unit")); } } - }else {//��������������������������� + } else {//��������������������������� if (state1.equals("0")) { if (val > Double.valueOf(String.valueOf(valueList.get(0)))) { Map lookMap = new HashMap(); - lookMap.put("time",time); - lookMap.put("name",device.getName()); - lookMap.put("sensor",sensors.get("description")); - lookMap.put("value",val + ""+sensors.get("unit")); + lookMap.put("time", time); + lookMap.put("name", device.getName()); + lookMap.put("sensor", sensors.get("description")); + lookMap.put("value", val + "" + sensors.get("unit")); mapList.add(lookMap); } } @@ -2479,9 +2501,9 @@ } } - if (mapList.size()>0){ + if (mapList.size() > 0) { lookList.add(mapList); - }else { + } else { continue; } } @@ -2491,24 +2513,24 @@ return lookList; } - /* @GetMapping("/lianxian") - @ApiOperation(value = "������", notes = "������" ) - @GetMapping("multiDeviceContrast") - @ApiOperation(value = "���������������������", notes = "���������������������") - @ApiImplicitParams(value = { - @ApiImplicitParam(name = "macs", value = "������mac,���������������������������", required = true, paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "sensorKey", value = "���������key", required = true, paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "time", value = "������,������(���������2018-03-12)", required = true, paramType = "query", dataType = "String"),}) - public ResultBean<List<Map<String, Object>>> multiDeviceSensor(HttpServletRequest request) throws Exception { - Map<String, Object> parameters = getParametersStartingWith(request, null); - ParameterUtils.getTimeType4Time(parameters); - List<Map<String, Object>> list = historyMinutelyService.getMultiDeviceSensorData(parameters); - return new ResultBean<List<Map<String, Object>>>(list); - } + /* @GetMapping("/lianxian") + @ApiOperation(value = "������", notes = "������" ) + @GetMapping("multiDeviceContrast") + @ApiOperation(value = "���������������������", notes = "���������������������") + @ApiImplicitParams(value = { + @ApiImplicitParam(name = "macs", value = "������mac,���������������������������", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "sensorKey", value = "���������key", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "time", value = "������,������(���������2018-03-12)", required = true, paramType = "query", dataType = "String"),}) + public ResultBean<List<Map<String, Object>>> multiDeviceSensor(HttpServletRequest request) throws Exception { + Map<String, Object> parameters = getParametersStartingWith(request, null); + ParameterUtils.getTimeType4Time(parameters); + List<Map<String, Object>> list = historyMinutelyService.getMultiDeviceSensorData(parameters); + return new ResultBean<List<Map<String, Object>>>(list); + } - /* - * ��������������������������������������������� - */ + /* + * ��������������������������������������������� + */ @GetMapping("screenVersion") public Map<String, Object> getScreenVersion(HttpServletRequest request) { Map<String, Object> parameters = getParametersStartingWith(request, null); @@ -2525,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