diff --git a/src/main/java/com/lz/modules/app/controller/TestController.java b/src/main/java/com/lz/modules/app/controller/TestController.java index 08db18ad..06241cca 100644 --- a/src/main/java/com/lz/modules/app/controller/TestController.java +++ b/src/main/java/com/lz/modules/app/controller/TestController.java @@ -266,7 +266,7 @@ public class TestController { R r = resultRecordService.initFlowRecord(resultRecordId); } - // http://localhost:8080/lz_management/test/getAuth?userId=314 + // http://localhost:8080/lz_management/test/getAuth?userId=298 @RequestMapping("/test/getAuth") public R getAuth(Long userId) throws Exception{ Map map = staffRoleService.getRoleByUserId(userId); diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java index c40b9aa8..02b35589 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java @@ -491,13 +491,13 @@ public class StaffRoleServiceImpl extends ServiceImpl map = new HashMap<>(); List staffRoleList = staffRoleMapper.selectAllByStaffId(userId); List staffMenus = new ArrayList<>(); - DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId); + List commonStaffList= staffMenuService.selectByParentId( RoleMenuEnums.COMMON_STAFF.getType()); if(CollectionUtils.isNotEmpty(commonStaffList)){ staffMenus.addAll(commonStaffList); } - - if(new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){ + DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId); + if(departmentsStaffRelateEntity !=null && new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){ List staffMenuDepartmentList= staffMenuService.selectByParentId( RoleMenuEnums.DEPARTMENT_PM.getType()); if(CollectionUtils.isNotEmpty(staffMenuDepartmentList)){ staffMenus.addAll(staffMenuDepartmentList); diff --git a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java index a7f404ec..6421ba46 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java @@ -103,8 +103,17 @@ public class AssessServiceImpl implements AssessService { public List roleDepartments(Long staffId) { StaffRole staffRole = staffRoleService.selectByStaffId(staffId); if(staffRole == null){ - log.info("staffRole 为空"); - return Collections.EMPTY_LIST; + log.info("staffRole 为空,不存在次人员权限配置信息,staffId:" + staffId); + //判断是否是领导 + DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(staffId); + if(entity == null || 0 == entity.getIsLeader()){ + log.info("非 leader,此人员无管理部门权限"); + return Collections.EMPTY_LIST; + } + + List depIds = staffService.selectAllDeparmentIdsByDepartmentParentId(entity.getDepartmentId()); + log.info("获取部门领导管理部门ids: " + JSON.toJSONString(depIds)); + return depIds; } log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole)); // 0 标识全部部门