diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java index 214615d..27842f6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java @@ -166,23 +166,24 @@ public class OrganizationManage { return keyTreeVO; }).collect(Collectors.toList()); - List dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) - .eq(DingEmployeeInfo::getMainJob, "true") - .eq(DingEmployeeInfo::getOrganizationCode, parentCode)); - - List memberChildren = dingEmployeeInfoList.stream().map(r -> { - KeyTreeVO child = new KeyTreeVO(); - child.setKey(r.getEmployeeCode()); - child.setTitle(r.getEmployeeName()); - child.setType("MEMBER"); - return child; - }).collect(Collectors.toList()); + if (StringUtils.isNotBlank(parentCode) && !needMember){ + List dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) + .eq(DingEmployeeInfo::getMainJob, "true") + .eq(DingEmployeeInfo::getOrganizationCode, parentCode)); + + List memberChildren = dingEmployeeInfoList.stream().map(r -> { + KeyTreeVO child = new KeyTreeVO(); + child.setKey(r.getEmployeeCode()); + child.setTitle(r.getEmployeeName()); + child.setType("MEMBER"); + return child; + }).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(memberChildren)) { - orgKeyTreeVOList.addAll(memberChildren); + if (CollUtil.isNotEmpty(memberChildren)) { + orgKeyTreeVOList.addAll(memberChildren); + } } - // if (needMember && orgKeyTreeVOList.size() > 0) { // List organizationCodeList = orgKeyTreeVOList.stream() // .map(KeyTreeVO::getKey).collect(Collectors.toList());