瀏覽代碼

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang 1 年之前
父節點
當前提交
32906c7e6b
共有 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()))


Loading…
取消
儲存