jinpengyong
2020-10-27 d7ee12cb208473741f79b64505adccd0653e4654
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();
@@ -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);
    }