Commit c767f094 by zhangdaiscott

我的部门下面的用户分配角色报错(无角色的情况下)

parent 42e0a938
......@@ -205,7 +205,10 @@ public class SysDepartRoleController extends JeecgController<SysDepartRole, ISys
List<SysDepartRole> roleList = sysDepartRoleService.list(new QueryWrapper<SysDepartRole>().eq("depart_id",departId));
List<String> roleIds = roleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
//根据角色id,用户id查询已授权角色
List<SysDepartRoleUser> roleUserList = departRoleUserService.list(new QueryWrapper<SysDepartRoleUser>().eq("user_id",userId).in("drole_id",roleIds));
List<SysDepartRoleUser> roleUserList = null;
if(roleIds!=null && roleIds.size()>0){
roleUserList = departRoleUserService.list(new QueryWrapper<SysDepartRoleUser>().eq("user_id",userId).in("drole_id",roleIds));
}
result.setSuccess(true);
result.setResult(roleUserList);
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment