Просмотр исходного кода

fix 专家组织内搜索

master
niohe·erbao 1 год назад
Родитель
Сommit
c63361132a
2 измененных файлов: 24 добавлений и 3 удалений
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  2. +22
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java Просмотреть файл

@@ -45,8 +45,8 @@ public class DingOrganizationController {

@PostMapping("/get-child-list")
@ApiOperation("获取组织架构的树状结构(单位筛选列表)")
public List<OrganizationTreeVO> getChildOrganizationList(@RequestParam(value = "parentCode", required = false) String parentCode,@RequestParam(value = "orgName", required = false) String orgName) {
return organizationManage.getChildOrganizationList(parentCode,orgName,false);
public List<OrganizationTreeVO> getChildOrganizationList(@RequestParam(value = "parentCode", required = false) String parentCode, @RequestParam(value = "orgName", required = false) String orgName) {
return organizationManage.getChildOrganizationList(parentCode, orgName, false);
}

@ApiOperation("组织树状列表筛选(前端定制化接口不可复用)")


+ 22
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java Просмотреть файл

@@ -180,9 +180,15 @@ public class OrganizationManage {
}

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)
.collect(Collectors.toList());

// 获取所有的组织列表
List<String> organizationCodeList = new ArrayList<>();
getChildList(organizationCodeList, parentCodeList);
organizationCodeList = organizationCodeList.stream().distinct().collect(Collectors.toList());

List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService
.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.like(DingEmployeeInfo::getEmployeeName, employeeName)
@@ -213,6 +219,21 @@ public class OrganizationManage {
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) {
Map<String, List<DingEmployeeInfo>> orgCodeEmployeeMap = allDingEmployeeInfoList.stream()
.filter(r -> StringUtils.isNotBlank(r.getOrganizationCode()))


Загрузка…
Отмена
Сохранить