|
|
@@ -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<ProvincialGovBusinessStripVO> getProvincialGovBusinessStripList(String businessStripName) { |
|
|
|
if(Objects.nonNull(canSearch) && canSearch){ |
|
|
|
List<ProvincialGovBusinessStripVO> vos = joinReviewProvincialBureauService.searchGovUnits(); |
|
|
|
return vos.stream() |
|
|
|
.filter(b -> StringUtils.isBlank(businessStripName) || b.getBusinessStripName().contains(businessStripName)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
List<ProvincialGovBusinessStrip> 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()); |
|
|
|