|
|
@@ -1,9 +1,11 @@
|
|
|
package com.inspur.customer.service.org;
|
|
|
|
|
|
+import com.alibaba.cola.dto.PageResponse;
|
|
|
import com.alibaba.cola.dto.Response;
|
|
|
import com.alibaba.cola.dto.SingleResponse;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.inspur.customer.client.keycloak.KeycloakService;
|
|
|
@@ -18,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
+import org.keycloak.representations.idm.UserRepresentation;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@@ -127,14 +130,15 @@ public class SmsbDepartmentServiceImpl extends ServiceImpl<SmsbDepartmentMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Response queryDepartmentUserList(SmsbDepartmentCmd departmentCmd) {
|
|
|
+ public PageResponse<UserRepresentation> queryDepartmentUserList(SmsbDepartmentCmd departmentCmd) {
|
|
|
List<Long> departmentIds = super.list(new LambdaQueryWrapper<>(SmsbDepartmentDO.class)
|
|
|
.eq(SmsbDepartmentDO::getTenant, departmentCmd.getTenant())
|
|
|
.eq(Objects.nonNull(departmentCmd.getDepartmentId()), SmsbDepartmentDO::getId, departmentCmd.getDepartmentId()))
|
|
|
.stream().map(i -> i.getId())
|
|
|
.collect(Collectors.toList());
|
|
|
- List<String> userIds = departmentUserService.queryUserIdByDeprIds(departmentIds);
|
|
|
- return SingleResponse.of(service.getUserListByIds(departmentCmd.getTenant() ,userIds));
|
|
|
+ PageResponse<String> userIds = departmentUserService.queryUserIdByDeprIds(departmentIds, departmentCmd);
|
|
|
+ return PageResponse.of(service.getUserListByIds(departmentCmd.getTenant() ,userIds.getData())
|
|
|
+ ,userIds.getTotalCount() ,userIds.getPageSize() ,userIds.getPageIndex());
|
|
|
}
|
|
|
|
|
|
private List<SmsbDepartmentCO> getChilde(Long id){
|