|
|
@@ -696,22 +696,32 @@ public class KwsEnterpriseService {
|
|
|
list.add(queryCurrentOrganizationResVo);
|
|
|
|
|
|
List<KwsEntDept> kwsEntDepts = kwsEntDeptDao.selectByEntPid(entId);
|
|
|
- if (CollectionUtils.isEmpty(kwsEntDepts)) {
|
|
|
- return list;
|
|
|
+ if (CollectionUtils.isNotEmpty(kwsEntDepts)) {
|
|
|
+ List<Long> entIdList = kwsEntDepts.stream().map(KwsEntDept::getEntId).toList();
|
|
|
+ Map<Long, EntCacheResDto> entCacheResDtoMap = remoteSystemService.queryEntCacheMapByIds(entIdList);
|
|
|
+ for (KwsEntDept kwsEntDept : kwsEntDepts) {
|
|
|
+ EntCacheResDto entCacheResDto1 = entCacheResDtoMap.get(kwsEntDept.getEntId());
|
|
|
+ if (Objects.nonNull(entCacheResDto1)) {
|
|
|
+ QueryCurrentOrganizationResVo queryCurrentOrganizationResVo1 = new QueryCurrentOrganizationResVo();
|
|
|
+ queryCurrentOrganizationResVo1.setEntId(entCacheResDto1.getId());
|
|
|
+ queryCurrentOrganizationResVo1.setEntName(entCacheResDto1.getFirmName());
|
|
|
+ queryCurrentOrganizationResVo1.setPId(kwsEntDept.getEntPid());
|
|
|
+ list.add(queryCurrentOrganizationResVo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- List<Long> entIdList = kwsEntDepts.stream().map(KwsEntDept::getEntId).toList();
|
|
|
- Map<Long, EntCacheResDto> entCacheResDtoMap = remoteSystemService.queryEntCacheMapByIds(entIdList);
|
|
|
- for (KwsEntDept kwsEntDept : kwsEntDepts) {
|
|
|
- EntCacheResDto entCacheResDto1 = entCacheResDtoMap.get(kwsEntDept.getEntId());
|
|
|
- if (Objects.isNull(entCacheResDto1)) {
|
|
|
- continue;
|
|
|
+ //填充企业属性
|
|
|
+ List<Long> entIds = list.stream().map(QueryCurrentOrganizationResVo::getEntId).toList();
|
|
|
+ List<KwsEntType> listByEntIds = kwsEntTypeDao.findListByEntIds(entIds);
|
|
|
+ if (CollectionUtils.isNotEmpty(listByEntIds)) {
|
|
|
+ Map<Long, List<KwsEntType>> collect = listByEntIds.stream().collect(Collectors.groupingBy(KwsEntType::getEntId));
|
|
|
+ for (QueryCurrentOrganizationResVo queryCurrentOrganizationResVo1 : list) {
|
|
|
+ List<KwsEntType> kwsEntTypes = collect.get(queryCurrentOrganizationResVo1.getEntId());
|
|
|
+ if (CollectionUtils.isNotEmpty(kwsEntTypes)) {
|
|
|
+ queryCurrentOrganizationResVo1.setEntTypes(String.join(Global.COMMA, kwsEntTypes.stream().map(KwsEntType::getType).map(String::valueOf).distinct().toList()));
|
|
|
+ }
|
|
|
}
|
|
|
- QueryCurrentOrganizationResVo queryCurrentOrganizationResVo1 = new QueryCurrentOrganizationResVo();
|
|
|
- queryCurrentOrganizationResVo1.setEntId(entCacheResDto1.getId());
|
|
|
- queryCurrentOrganizationResVo1.setEntName(entCacheResDto1.getFirmName());
|
|
|
- queryCurrentOrganizationResVo1.setPId(kwsEntDept.getEntPid());
|
|
|
- list.add(queryCurrentOrganizationResVo1);
|
|
|
}
|
|
|
|
|
|
return list;
|