From e514dcba96063515c4efd9f8f493cef3a2ccd5b8 Mon Sep 17 00:00:00 2001 From: 20918 <2091823062@qq.com> Date: Tue, 21 May 2024 11:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=89=E5=AF=86=E4=BA=BA=E5=91=98=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/count/SysUsernumController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java index 74d92bc..3fe2df3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.SysPost; +import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; @@ -98,12 +99,16 @@ public class SysUsernumController extends BaseController { { List sysUsers = userService.selectUserList(user); List list = new ArrayList<>(); + List sysRoles = new ArrayList<>(); for (SysUser User : sysUsers){ if (User.getDeptId().equals(deptId)){ - List sysRoles = roleService.selectRolesByUserId(User.getUserId()); - mmap.put("sysRoles", sysRoles); + List sysUserRoles = userService.selectUserRoleByUserId(User.getUserId()); + for (SysUserRole UserRole : sysUserRoles){ + SysRole sysRole = roleService.selectRoleById(UserRole.getRoleId()); + sysRoles.add(sysRole); + } + User.setRoles(sysRoles); list.add(User); - } } mmap.put("list", list);