根据角色查询用户列表

This commit is contained in:
sxu 2025-03-19 14:24:30 +08:00
parent 3725c912b1
commit 6c4da0d728
1 changed files with 7 additions and 6 deletions

View File

@ -358,13 +358,14 @@ public class SysRoleServiceImpl implements ISysRoleService
int rows = 1; int rows = 1;
// 新增用户与角色管理 // 新增用户与角色管理
List<SysRoleMenu> list = new ArrayList<SysRoleMenu>(); List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
for (Long menuId : role.getMenuIds()) if (role.getMenuIds() != null && role.getMenuIds().length > 0) {
{ for (Long menuId : role.getMenuIds()) {
SysRoleMenu rm = new SysRoleMenu(); SysRoleMenu rm = new SysRoleMenu();
rm.setRoleId(role.getRoleId()); rm.setRoleId(role.getRoleId());
rm.setMenuId(menuId); rm.setMenuId(menuId);
list.add(rm); list.add(rm);
} }
}
if (list.size() > 0) if (list.size() > 0)
{ {
rows = roleMenuMapper.batchRoleMenu(list); rows = roleMenuMapper.batchRoleMenu(list);