From faa31774f93329bed293b0c4e255577e206e8f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Tue, 4 Apr 2023 17:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=87=BA=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/organization/manage/OrganizationManage.java | 16 +++++++++++++--- .../pmapi/organization/model/po/ReqSynthesizePO.java | 5 +++-- 2 files changed, 16 insertions(+), 5 deletions(-) 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 2041adb..4e2083b 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 @@ -109,16 +109,26 @@ public class OrganizationManage { public List treeRubbishVOList(ReqSynthesizePO request) { String organizationCode = request.getOrganizationCode(); + String organizationName = request.getOrganizationName(); List dingOrganizationList = new ArrayList<>(); List organizationCodeList = new ArrayList<>(); - if (StrUtils.isBlank(organizationCode)) { + if (StringUtils.isNotBlank(organizationName)) { + dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .like(DingOrganization::getOrganizationName, organizationName)); + if (dingOrganizationList.size() == 0) { + return new ArrayList<>(); + } + } else if (StrUtils.isBlank(organizationCode)) { organizationCodeList = dingOrganizationProperties.getDeptVisibleScopes(); } else { organizationCodeList = CollectionUtil.toList(organizationCode); } - dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) - .in(DingOrganization::getOrganizationCode, organizationCodeList)); + + if (CollectionUtil.isEmpty(dingOrganizationList)) { + dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .in(DingOrganization::getOrganizationCode, organizationCodeList)); + } List orgKeyTreeVOList = dingOrganizationList.stream().map(r -> { KeyTreeVO keyTreeVO = new KeyTreeVO(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java index 0e02e27..189929d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java @@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.validation.constraints.NotBlank; - /** * @author liuxinxin * @date 2023/3/28 上午10:11 @@ -20,4 +18,7 @@ public class ReqSynthesizePO { @ApiModelProperty("是否需要组织成员列表") private Boolean needMember = false; + + @ApiModelProperty("单位名称") + private String organizationName; }