|
@@ -180,9 +180,15 @@ public class OrganizationManage { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<KeyTreeVO> treeEmployeeQuery(String employeeName, String organizationCode) { |
|
|
public List<KeyTreeVO> treeEmployeeQuery(String employeeName, String organizationCode) { |
|
|
List<String> organizationCodeList = CollUtil.toList(organizationCode).stream() |
|
|
|
|
|
|
|
|
List<String> parentCodeList = CollUtil.toList(organizationCode).stream() |
|
|
.filter(StringUtils::isNotBlank) |
|
|
.filter(StringUtils::isNotBlank) |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有的组织列表 |
|
|
|
|
|
List<String> organizationCodeList = new ArrayList<>(); |
|
|
|
|
|
getChildList(organizationCodeList, parentCodeList); |
|
|
|
|
|
organizationCodeList = organizationCodeList.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService |
|
|
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService |
|
|
.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
.like(DingEmployeeInfo::getEmployeeName, employeeName) |
|
|
.like(DingEmployeeInfo::getEmployeeName, employeeName) |
|
@@ -213,6 +219,21 @@ public class OrganizationManage { |
|
|
return orgKeyTreeVOList; |
|
|
return orgKeyTreeVOList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void getChildList(List<String> orgCodeList, List<String> parentCodeList) { |
|
|
|
|
|
if (CollUtil.isEmpty(parentCodeList)) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
orgCodeList.addAll(parentCodeList); |
|
|
|
|
|
// orgCodeList = orgCodeList.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
for (String parentCode : parentCodeList) { |
|
|
|
|
|
List<DingOrganization> childOrgList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
|
|
.in(DingOrganization::getParentCode, parentCode)); |
|
|
|
|
|
List<String> newParentCodeList = childOrgList.stream().map(DingOrganization::getOrganizationCode).collect(Collectors.toList()); |
|
|
|
|
|
getChildList(orgCodeList, newParentCodeList); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void employeeNameSearcheTreeVOList(List<KeyTreeVO> basicOrgKeyTreeVOList, List<DingEmployeeInfo> allDingEmployeeInfoList) { |
|
|
private void employeeNameSearcheTreeVOList(List<KeyTreeVO> basicOrgKeyTreeVOList, List<DingEmployeeInfo> allDingEmployeeInfoList) { |
|
|
Map<String, List<DingEmployeeInfo>> orgCodeEmployeeMap = allDingEmployeeInfoList.stream() |
|
|
Map<String, List<DingEmployeeInfo>> orgCodeEmployeeMap = allDingEmployeeInfoList.stream() |
|
|
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode())) |
|
|
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode())) |
|
|