From 26ca42eef38816b1deb833a4bf5f6f8a3cb26880 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Thu, 21 Mar 2024 00:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.1.3=E3=80=91=E3=80=90system=E3=80=91?= =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E7=94=A8=E6=88=B7=E7=BB=84=E7=BB=87=E6=9C=BA?= =?UTF-8?q?=E6=9E=84=E7=9A=84=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../login/service/UserIndexInfoService.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/login/service/UserIndexInfoService.java b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/login/service/UserIndexInfoService.java index 15ab31e5a..f132d319c 100644 --- a/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/login/service/UserIndexInfoService.java +++ b/kernel-s-system/system-business-permission/src/main/java/cn/stylefeng/roses/kernel/sys/modular/login/service/UserIndexInfoService.java @@ -88,7 +88,8 @@ public class UserIndexInfoService { this.fillUserBaseInfo(loginUser.getUserId(), userIndexInfo); // 2. 获取用户所有的部门和任职信息,并默认激活(选中)主部门的任职信息 - this.fillUserOrgInfo(loginUser, userIndexInfo); + List indexUserOrgInfos = this.fillUserOrgInfo(loginUser); + userIndexInfo.setUserOrgInfoList(indexUserOrgInfos); // 3. 获取用户的权限编码集合 List userMenuList = this.fillUserPermissionCodeList(loginUser, userIndexInfo); @@ -144,19 +145,6 @@ public class UserIndexInfoService { sessionManagerApi.updateSession(loginUser.getToken(), loginUser); } - /** - * 填充用户的基本姓名和头像信息 - * - * @author fengshuonan - * @since 2023/6/18 23:01 - */ - private void fillUserBaseInfo(Long userId, UserIndexInfo userIndexInfo) { - SimpleUserDTO simpleUserDTO = sysUserServiceApi.getUserInfoByUserId(userId); - userIndexInfo.setUserId(simpleUserDTO.getUserId()); - userIndexInfo.setRealName(simpleUserDTO.getRealName()); - userIndexInfo.setAvatarUrl(simpleUserDTO.getAvatarUrl()); - } - /** * 获取用户的任职信息,包含了机构的详细描述 *

@@ -167,7 +155,7 @@ public class UserIndexInfoService { * @author fengshuonan * @since 2023/6/18 23:33 */ - private void fillUserOrgInfo(LoginUser loginUser, UserIndexInfo userIndexInfo) { + public List fillUserOrgInfo(LoginUser loginUser) { List resultUserOrg = new ArrayList<>(); @@ -179,8 +167,7 @@ public class UserIndexInfoService { // 查询到机构为空,直接返回 if (ObjectUtil.isEmpty(userOrgList)) { - userIndexInfo.setUserOrgInfoList(resultUserOrg); - return; + return resultUserOrg; } // 判断用户是否被改过机构,判断currentOrgId是否失效 @@ -245,7 +232,20 @@ public class UserIndexInfoService { } // 填充用户组织机构信息 - userIndexInfo.setUserOrgInfoList(resultUserOrg); + return resultUserOrg; + } + + /** + * 填充用户的基本姓名和头像信息 + * + * @author fengshuonan + * @since 2023/6/18 23:01 + */ + private void fillUserBaseInfo(Long userId, UserIndexInfo userIndexInfo) { + SimpleUserDTO simpleUserDTO = sysUserServiceApi.getUserInfoByUserId(userId); + userIndexInfo.setUserId(simpleUserDTO.getUserId()); + userIndexInfo.setRealName(simpleUserDTO.getRealName()); + userIndexInfo.setAvatarUrl(simpleUserDTO.getAvatarUrl()); } /**