浏览代码

同步省级单位状态

master
PoffyZhang 1年前
父节点
当前提交
93f96c07ba
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. +6
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java

+ 6
- 7
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<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());


正在加载...
取消
保存