mirror of https://gitee.com/stylefeng/roses
【8.0】【sys】更新获取机构下职务下的人员id列表api
parent
64e34f7635
commit
1ea17b193c
|
@ -51,4 +51,12 @@ public interface SysUserOrgServiceApi {
|
|||
*/
|
||||
boolean validateUserOrgAuth(Long orgId, Long userId);
|
||||
|
||||
/**
|
||||
* 获取某个机构某个职务下的所有用户id列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/7/15 22:24
|
||||
*/
|
||||
List<Long> getPositionUserList(Long orgId, Long positionId);
|
||||
|
||||
}
|
||||
|
|
|
@ -211,6 +211,24 @@ public class SysUserOrgServiceImpl extends ServiceImpl<SysUserOrgMapper, SysUser
|
|||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getPositionUserList(Long orgId, Long positionId) {
|
||||
|
||||
SysUserOrgRequest sysUserOrgRequest = new SysUserOrgRequest();
|
||||
sysUserOrgRequest.setOrgId(orgId);
|
||||
sysUserOrgRequest.setPositionId(positionId);
|
||||
|
||||
LambdaQueryWrapper<SysUserOrg> wrapper = this.createWrapper(sysUserOrgRequest);
|
||||
wrapper.select(SysUserOrg::getUserId);
|
||||
List<SysUserOrg> list = this.list(wrapper);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
return list.stream().map(SysUserOrg::getUserId).collect(Collectors.toList());
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
|
@ -237,6 +255,9 @@ public class SysUserOrgServiceImpl extends ServiceImpl<SysUserOrgMapper, SysUser
|
|||
Long orgId = sysUserOrgRequest.getOrgId();
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(orgId), SysUserOrg::getOrgId, orgId);
|
||||
|
||||
Long positionId = sysUserOrgRequest.getPositionId();
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(positionId), SysUserOrg::getPositionId, positionId);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue