|
|
@@ -1,10 +1,13 @@ |
|
|
|
package com.ningdatech.pmapi.organization.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.pmapi.organization.entity.GovBusinessStrip; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip; |
|
|
|
import com.ningdatech.pmapi.organization.model.vo.GovBusinessStripTreeVO; |
|
|
|
import com.ningdatech.pmapi.organization.model.vo.ProvincialGovBusinessStripVO; |
|
|
|
import com.ningdatech.pmapi.organization.service.IGovBusinessStripService; |
|
|
|
import com.ningdatech.pmapi.organization.service.IProvincialGovBusinessStripService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
@@ -25,6 +28,7 @@ public class GovBusinessStripManage { |
|
|
|
|
|
|
|
private final IGovBusinessStripService iGovBusinessStripService; |
|
|
|
|
|
|
|
private final IProvincialGovBusinessStripService provincialGovBusinessStripService; |
|
|
|
|
|
|
|
public List<GovBusinessStripTreeVO> getChildOrganizationList(String parentCode) { |
|
|
|
if (Objects.isNull(parentCode)) { |
|
|
@@ -44,15 +48,12 @@ public class GovBusinessStripManage { |
|
|
|
} |
|
|
|
|
|
|
|
public List<ProvincialGovBusinessStripVO> getProvincialGovBusinessStripList(String businessStripName) { |
|
|
|
List<ProvincialGovBusinessStripVO> provincialGovBusinessStripVOList = new ArrayList<>(); |
|
|
|
ProvincialGovBusinessStripVO provincialGovBusinessStripVO = new ProvincialGovBusinessStripVO(); |
|
|
|
provincialGovBusinessStripVO.setBusinessStripCode("test_provincial_manage_org_code"); |
|
|
|
provincialGovBusinessStripVO.setBusinessStripName("测试省局条线主管单位"); |
|
|
|
provincialGovBusinessStripVOList.add(provincialGovBusinessStripVO); |
|
|
|
List<ProvincialGovBusinessStrip> strips = provincialGovBusinessStripService.list(Wrappers.lambdaQuery(ProvincialGovBusinessStrip.class) |
|
|
|
.orderByAsc(ProvincialGovBusinessStrip::getBusinessStripName)); |
|
|
|
|
|
|
|
provincialGovBusinessStripVOList = provincialGovBusinessStripVOList.stream() |
|
|
|
return strips.stream() |
|
|
|
.filter(b -> StringUtils.isBlank(businessStripName) || b.getBusinessStripName().contains(businessStripName)) |
|
|
|
.map(p -> BeanUtil.copyProperties(p,ProvincialGovBusinessStripVO.class)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return provincialGovBusinessStripVOList; |
|
|
|
} |
|
|
|
} |