|
|
@@ -92,19 +92,21 @@ public class OrganizationManage { |
|
|
|
return pageVo; |
|
|
|
} |
|
|
|
|
|
|
|
public List<OrganizationTreeVO> getChildOrganizationList(String parentCode, String orgName) { |
|
|
|
public List<OrganizationTreeVO> getChildOrganizationList(String parentCode, String orgName, Boolean onlyUnit) { |
|
|
|
List<String> parentCodeList = new ArrayList<>(); |
|
|
|
List<DingOrganization> dingOrganizationList = new ArrayList<>(); |
|
|
|
if (StrUtils.isBlank(parentCode)) { |
|
|
|
parentCodeList = dingOrganizationProperties.getDeptVisibleScopes(); |
|
|
|
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName) |
|
|
|
.notIn(onlyUnit, DingOrganization::getTypeCode, "GOV_INTERNAL_INSTITUTION") |
|
|
|
.in(DingOrganization::getOrganizationCode, parentCodeList)); |
|
|
|
} else { |
|
|
|
parentCodeList = CollectionUtil.toList(parentCode); |
|
|
|
dingOrganizationList = iDingOrganizationService |
|
|
|
.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName) |
|
|
|
.notIn(onlyUnit, DingOrganization::getTypeCode, "GOV_INTERNAL_INSTITUTION") |
|
|
|
.in(DingOrganization::getParentCode, parentCodeList)); |
|
|
|
} |
|
|
|
|
|
|
@@ -173,7 +175,7 @@ public class OrganizationManage { |
|
|
|
keyTreeVO.setType("ORGANIZATION"); |
|
|
|
return keyTreeVO; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
treeVOList(request.getNeedMember(), orgKeyTreeVOList); |
|
|
|
treeVOList(request.getNeedMember(), orgKeyTreeVOList,onlyUnit); |
|
|
|
return orgKeyTreeVOList; |
|
|
|
} |
|
|
|
|
|
|
@@ -232,10 +234,10 @@ public class OrganizationManage { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void treeVOList(Boolean needMember, List<KeyTreeVO> basicOrgKeyTreeVOList) { |
|
|
|
public void treeVOList(Boolean needMember, List<KeyTreeVO> basicOrgKeyTreeVOList, Boolean onlyUnit) { |
|
|
|
for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) { |
|
|
|
String parentCode = basicOrgKeyTreeVO.getKey(); |
|
|
|
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode, null); |
|
|
|
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode, null, onlyUnit); |
|
|
|
|
|
|
|
List<KeyTreeVO> orgKeyTreeVOList = childOrganizationList.stream().map(r -> { |
|
|
|
KeyTreeVO keyTreeVO = new KeyTreeVO(); |
|
|
|