提交 4a188955 authored 作者: gongwenjie's avatar gongwenjie

代码修改

上级 522d296d
...@@ -308,6 +308,27 @@ public class UserServiceImpl implements IUserService { ...@@ -308,6 +308,27 @@ public class UserServiceImpl implements IUserService {
if(all!=null){ if(all!=null){
for (User user : all) { for (User user : all) {
List<String> departmentIds = user.getDepartmentIds(); List<String> departmentIds = user.getDepartmentIds();
List<UserRole> userRoles = userRoleDao.findAllByUserId(user.getId());
List<String> roleIds = new ArrayList<>();
if(userRoles!=null){
for (UserRole userRole : userRoles) {
roleIds.add(userRole.getRoleId());
}
}
List<Role> roles = roleDao.findAllByIdIn(roleIds);
if(roles!=null){
for (Role role : roles) {
List<RoleAuthority> roleAuthorities = roleAuthorityDao.findAllByRoleId(role.getId());
List<String> authorityIds = new ArrayList<>();
for (RoleAuthority roleAuthority : roleAuthorities) {
authorityIds.add(roleAuthority.getAuthorityId());
}
List<Authority> authorities = authorityDao.findAllByIdIn(authorityIds);
role.setAuthorities(authorities);
}
}
user.setRoles(roles);
if(departmentIds!=null){ if(departmentIds!=null){
for (String departId : departmentIds) { for (String departId : departmentIds) {
if(departmentList.contains(departId)){ if(departmentList.contains(departId)){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论