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; }