diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/UserServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/UserServiceImpl.java index e55bb1a..8d235cd 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/UserServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/UserServiceImpl.java @@ -769,15 +769,27 @@ public class UserServiceImpl implements UserService { } } user.setProjectIds(projectIds); + + List roleNames = new ArrayList<>(); List roles = roleRepository.listByUser(user.getId()); if (!roles.isEmpty()) { - List roleNames = new ArrayList<>(); for (Role role : roles) { roleNames.add(role.getName()); } - // 给用户设置角色名 - user.setRoleNames(roleNames); } + + //给用户设置管理端的角色名 + List managerRoles = roleRepository.listByManager(user.getId()); + if (!ListTool.isEmpty(roles)) { + for (Role role : managerRoles) { + if(!roleNames.contains(role.getName())){ + roleNames.add(role.getName()); + } + } + } + // 给用户设置角色名 + user.setRoleNames(roleNames); + Department department = departmentRepository.query(user.getDepartId()); if (department != null) { user.setDepartmentName(department.getName());