From 0dc29fd8adb991059b0a601379db62baa5a6fc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Thu, 13 Apr 2023 16:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=88=97=E8=A1=A8fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/controller/DingOrganizationController.java | 4 ++-- .../ningdatech/pmapi/organization/manage/OrganizationManage.java | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java index a7b8d73..f4e66cd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java +++ b/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 getChildOrganizationList(@RequestParam(value = "parentCode", required = false) String parentCode) { - return organizationManage.getChildOrganizationList(parentCode); + public List getChildOrganizationList(@RequestParam(value = "parentCode", required = false) String parentCode,@RequestParam(value = "orgName", required = false) String orgName) { + return organizationManage.getChildOrganizationList(parentCode,orgName); } @ApiOperation("组织树状列表筛选(前端定制化接口不可复用)") 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 77a692b..d9d9106 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 @@ -92,17 +92,20 @@ public class OrganizationManage { return pageVo; } - public List getChildOrganizationList(String parentCode) { + public List getChildOrganizationList(String parentCode, String orgName) { List parentCodeList = new ArrayList<>(); List dingOrganizationList = new ArrayList<>(); if (StrUtils.isBlank(parentCode)) { parentCodeList = dingOrganizationProperties.getDeptVisibleScopes(); dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName) .in(DingOrganization::getOrganizationCode, parentCodeList)); } else { parentCodeList = CollectionUtil.toList(parentCode); dingOrganizationList = iDingOrganizationService - .list(Wrappers.lambdaQuery(DingOrganization.class).in(DingOrganization::getParentCode, parentCodeList)); + .list(Wrappers.lambdaQuery(DingOrganization.class) + .like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName) + .in(DingOrganization::getParentCode, parentCodeList)); } if (CollectionUtils.isEmpty(dingOrganizationList)) { @@ -232,7 +235,7 @@ public class OrganizationManage { public void treeVOList(Boolean needMember, List basicOrgKeyTreeVOList) { for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) { String parentCode = basicOrgKeyTreeVO.getKey(); - List childOrganizationList = getChildOrganizationList(parentCode); + List childOrganizationList = getChildOrganizationList(parentCode, null); List orgKeyTreeVOList = childOrganizationList.stream().map(r -> { KeyTreeVO keyTreeVO = new KeyTreeVO();