【8.1.3】【system】抽象用户组织机构的获取

dev-8.1.9
fengshuonan 2024-03-21 00:11:11 +08:00
parent fd03e24df8
commit 26ca42eef3
1 changed files with 18 additions and 18 deletions

View File

@ -88,7 +88,8 @@ public class UserIndexInfoService {
this.fillUserBaseInfo(loginUser.getUserId(), userIndexInfo); this.fillUserBaseInfo(loginUser.getUserId(), userIndexInfo);
// 2. 获取用户所有的部门和任职信息,并默认激活(选中)主部门的任职信息 // 2. 获取用户所有的部门和任职信息,并默认激活(选中)主部门的任职信息
this.fillUserOrgInfo(loginUser, userIndexInfo); List<IndexUserOrgInfo> indexUserOrgInfos = this.fillUserOrgInfo(loginUser);
userIndexInfo.setUserOrgInfoList(indexUserOrgInfos);
// 3. 获取用户的权限编码集合 // 3. 获取用户的权限编码集合
List<SysMenu> userMenuList = this.fillUserPermissionCodeList(loginUser, userIndexInfo); List<SysMenu> userMenuList = this.fillUserPermissionCodeList(loginUser, userIndexInfo);
@ -144,19 +145,6 @@ public class UserIndexInfoService {
sessionManagerApi.updateSession(loginUser.getToken(), loginUser); 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());
}
/** /**
* *
* <p> * <p>
@ -167,7 +155,7 @@ public class UserIndexInfoService {
* @author fengshuonan * @author fengshuonan
* @since 2023/6/18 23:33 * @since 2023/6/18 23:33
*/ */
private void fillUserOrgInfo(LoginUser loginUser, UserIndexInfo userIndexInfo) { public List<IndexUserOrgInfo> fillUserOrgInfo(LoginUser loginUser) {
List<IndexUserOrgInfo> resultUserOrg = new ArrayList<>(); List<IndexUserOrgInfo> resultUserOrg = new ArrayList<>();
@ -179,8 +167,7 @@ public class UserIndexInfoService {
// 查询到机构为空,直接返回 // 查询到机构为空,直接返回
if (ObjectUtil.isEmpty(userOrgList)) { if (ObjectUtil.isEmpty(userOrgList)) {
userIndexInfo.setUserOrgInfoList(resultUserOrg); return resultUserOrg;
return;
} }
// 判断用户是否被改过机构判断currentOrgId是否失效 // 判断用户是否被改过机构判断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());
} }
/** /**