From 1be6e6d2bda4b2b086594bd36ba0f5f3398e47a5 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 31 Oct 2022 11:08:04 +0800 Subject: [PATCH] npe --- .../common/controller/CensusController.java | 21 +++++++++++-------- .../service/impl/ResourceServiceImpl.java | 11 +++++----- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index c2f3c9c5..7a7f18b9 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -19,7 +19,6 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; -import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -482,9 +481,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员 +// +// } return new Result().ok(resourceService.selectCensusResourceTable(params)); } @@ -503,9 +503,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } ArrayList resultList = (ArrayList) resourceDao.selectCensusResourceTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); @@ -563,9 +564,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } return new Result().ok(resourceService.selectCensusApplyTable(params)); } @@ -584,9 +586,10 @@ public class CensusController { if (user.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 - } else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 - } +// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 +// +// } ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 73feb0f3..5b8a81c9 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -51,7 +51,6 @@ import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysDeptEntity; -import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; @@ -2082,9 +2081,10 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); @@ -2265,9 +2265,10 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));