作者 RuoYi

用户修改减少一次角色列表关联查询

@@ -104,9 +104,10 @@ public class SysUserController extends BaseController @@ -104,9 +104,10 @@ public class SysUserController extends BaseController
104 ajax.put("posts", postService.selectPostAll()); 104 ajax.put("posts", postService.selectPostAll());
105 if (StringUtils.isNotNull(userId)) 105 if (StringUtils.isNotNull(userId))
106 { 106 {
  107 + SysUser sysUser = userService.selectUserById(userId);
107 ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId)); 108 ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
108 ajax.put("postIds", postService.selectPostListByUserId(userId)); 109 ajax.put("postIds", postService.selectPostListByUserId(userId));
109 - ajax.put("roleIds", roleService.selectRoleListByUserId(userId)); 110 + ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
110 } 111 }
111 return ajax; 112 return ajax;
112 } 113 }