From 93f96c07bae93926baa5bc32af55d994faa85021 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 6 Nov 2023 15:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=9C=81=E7=BA=A7=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/organization/manage/GovBusinessStripManage.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java index 14ea6cf..be0d63e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java @@ -1,6 +1,7 @@ package com.ningdatech.pmapi.organization.manage; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.organization.entity.GovBusinessStrip; import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip; @@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -55,17 +57,14 @@ public class GovBusinessStripManage { } public List getProvincialGovBusinessStripList(String businessStripName) { - if(Objects.nonNull(canSearch) && canSearch){ - List vos = joinReviewProvincialBureauService.searchGovUnits(); - return vos.stream() - .filter(b -> StringUtils.isBlank(businessStripName) || b.getBusinessStripName().contains(businessStripName)) - .collect(Collectors.toList()); - } - List strips = provincialGovBusinessStripService.list(Wrappers.lambdaQuery(ProvincialGovBusinessStrip.class) .like(StringUtils.isNotBlank(businessStripName),ProvincialGovBusinessStrip::getBusinessStripName,businessStripName) .orderByAsc(ProvincialGovBusinessStrip::getBusinessStripName)); + if(CollUtil.isEmpty(strips)){ + return Collections.emptyList(); + } + return strips.stream() .map(p -> BeanUtil.copyProperties(p,ProvincialGovBusinessStripVO.class)) .collect(Collectors.toList());