【8.0】【sys】更新获取机构下职务下的人员id列表api

pull/57/head
fengshuonan 2023-07-15 22:25:57 +08:00
parent 64e34f7635
commit 1ea17b193c
2 changed files with 29 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;
}