From 35d08fe63fab52f6e45e6c0979d486f0ea9143a0 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 17:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=9C=A8=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E7=BB=84=E5=86=85=E7=9A=84=E5=AE=A1=E6=A0=B8=E7=BB=84?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8E=E5=8E=BB=E9=87=8D=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/controller/SysUserController.java | 14 +++++++++++++- .../src/main/resources/mapper/sys/SysUserDao.xml | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index a82beef5..fc580934 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -11,6 +11,8 @@ import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.audit_team.dto.SysAuditTeamDTO; +import io.renren.modules.audit_team.service.SysAuditTeamService; import io.renren.modules.security.password.PasswordUtils; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; @@ -36,6 +38,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 用户管理 @@ -56,6 +59,8 @@ public class SysUserController { private SysDeptService sysDeptService; @Autowired private SysRoleService sysRoleService; + @Autowired + private SysAuditTeamService sysAuditTeamService; @Value("${big_date.assignee_role_name}") private String roleName0; // 具备审批的角色名称(普通) @@ -272,6 +277,13 @@ public class SysUserController { } add(Long.parseLong(defaultAssigneeRoleId)); }}; - return new Result>().ok(new PageData<>(sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit), sysUserService.getUserByRoleListCount(roleId))); + List temp = sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit); + temp = temp.stream().map(index -> { + List sysAuditTeamDTOList = sysAuditTeamService.selectByMemberOne(index.get("id").toString()); + index.put("inAuditTeam", !sysAuditTeamDTOList.isEmpty()); + index.put("auditTeamName", sysAuditTeamDTOList.stream().findFirst().isPresent() ? sysAuditTeamDTOList.stream().findFirst().get().getName() : ""); + return index; + }).collect(Collectors.toList()); + return new Result>().ok(new PageData<>(temp, sysUserService.getUserByRoleListCount(roleId))); } } \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml index 333dde6e..23ba470e 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml @@ -200,6 +200,7 @@