mirror of https://gitee.com/xiaonuobase/snowy
【增强】用户、机构选择器优化
parent
bc813b0ede
commit
43f1137d64
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue