Browse Source

同步省级单位状态

tags/24080901
PoffyZhang 1 year ago
parent
commit
93f96c07ba
1 changed files with 6 additions and 7 deletions
  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 View File

@@ -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());


Loading…
Cancel
Save