【增强】用户、机构选择器优化

pull/124/head
徐玉祥 2023-06-29 23:36:16 +08:00
parent bc813b0ede
commit 43f1137d64
4 changed files with 21 additions and 7 deletions

View File

@ -370,8 +370,15 @@ public class BizOrgServiceImpl extends ServiceImpl<BizOrgMapper, BizOrg> impleme
// 只查询部分字段
lambdaQueryWrapper.select(BizUser::getId, BizUser::getAvatar, BizUser::getOrgId, BizUser::getPositionId, BizUser::getAccount,
BizUser::getName, BizUser::getSortCode, BizUser::getGender, BizUser::getEntryDate);
if(ObjectUtil.isNotEmpty(bizOrgSelectorUserParam.getOrgId())) {
lambdaQueryWrapper.eq(BizUser::getOrgId, bizOrgSelectorUserParam.getOrgId());
if (ObjectUtil.isNotEmpty(bizOrgSelectorUserParam.getOrgId())) {
// 如果机构id不为空则查询该机构及其子机构下的所有人
List<String> childOrgIdList = CollStreamUtil.toList(this.getChildListById(this
.getAllOrgList(), bizOrgSelectorUserParam.getOrgId(), true), BizOrg::getId);
if (ObjectUtil.isNotEmpty(childOrgIdList)) {
lambdaQueryWrapper.in(BizUser::getOrgId, childOrgIdList);
} else {
return new Page<>();
}
}
if(ObjectUtil.isNotEmpty(bizOrgSelectorUserParam.getSearchKey())) {
lambdaQueryWrapper.like(BizUser::getName, bizOrgSelectorUserParam.getSearchKey());

View File

@ -705,8 +705,15 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
// 只查询部分字段
lambdaQueryWrapper.select(BizUser::getId, BizUser::getAvatar, BizUser::getOrgId, BizUser::getPositionId, BizUser::getAccount,
BizUser::getName, BizUser::getSortCode, BizUser::getGender, BizUser::getEntryDate);
if(ObjectUtil.isNotEmpty(bizUserSelectorUserParam.getOrgId())) {
lambdaQueryWrapper.eq(BizUser::getOrgId, bizUserSelectorUserParam.getOrgId());
if (ObjectUtil.isNotEmpty(bizUserSelectorUserParam.getOrgId())) {
// 如果机构id不为空则查询该机构及其子机构下的所有人
List<String> childOrgIdList = CollStreamUtil.toList(bizOrgService.getChildListById(bizOrgService
.getAllOrgList(), bizUserSelectorUserParam.getOrgId(), true), BizOrg::getId);
if (ObjectUtil.isNotEmpty(childOrgIdList)) {
lambdaQueryWrapper.in(BizUser::getOrgId, childOrgIdList);
} else {
return new Page<>();
}
}
if(ObjectUtil.isNotEmpty(bizUserSelectorUserParam.getSearchKey())) {
lambdaQueryWrapper.like(BizUser::getName, bizUserSelectorUserParam.getSearchKey());

View File

@ -460,8 +460,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
return sysUserService.getAllUserSelectorList();
} else {
if (ObjectUtil.isNotEmpty(sysRoleSelectorUserParam.getOrgId())) {
// 如果机构id不为空则查询该机构所在顶级机构下的所有人
List<String> parentAndChildOrgIdList = CollStreamUtil.toList(sysOrgService.getParentAndChildListById(sysOrgService
// 如果组织id不为空则查询该组织及其子极其子下的所有人
List<String> childOrgIdList = CollStreamUtil.toList(sysOrgService.getChildListById(sysOrgService
.getCachedAllOrgList(), sysRoleSelectorUserParam.getOrgId(), true), SysOrg::getId);
if (ObjectUtil.isNotEmpty(parentAndChildOrgIdList)) {
lambdaQueryWrapper.in(SysUser::getOrgId, parentAndChildOrgIdList);

View File

@ -1501,7 +1501,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return this.getAllUserSelectorList();
} else {
if (ObjectUtil.isNotEmpty(sysUserSelectorUserParam.getOrgId())) {
// 如果机构id不为空则查询该机构极其子机构下的所有人
// 如果组织id不为空则查询该组织及其子组织下的所有人
List<String> childOrgIdList = CollStreamUtil.toList(sysOrgService.getChildListById(sysOrgService
.getCachedAllOrgList(), sysUserSelectorUserParam.getOrgId(), true), SysOrg::getId);
if (ObjectUtil.isNotEmpty(childOrgIdList)) {