临时提交

This commit is contained in:
648540858
2024-08-16 17:59:53 +08:00
parent 326025ee85
commit aeb3cd6a22
5 changed files with 202 additions and 75 deletions

View File

@@ -328,15 +328,20 @@ public class GbChannelServiceImpl implements IGbChannelService {
// 是否包含行政区划信息
if (platform.getCatalogWithRegion()) {
List<CommonGBChannel> regionChannelList = regionMapper.queryInChannelList(commonGBChannelList);
List<Region> regionChannelList = regionMapper.queryInChannelList(commonGBChannelList);
if (!regionChannelList.isEmpty()) {
channelList.addAll(regionChannelList);
// 获取这些节点的所有父节点
List<Region> allRegion = getAllRegion(regionChannelList);
for (Region region : allRegion) {
channelList.add(CommonGBChannel.build(region));
}
}
}
// 是否包含分组信息
if (platform.getCatalogWithGroup()) {
List<CommonGBChannel> groupChannelList = groupMapper.queryInChannelList(commonGBChannelList);
if (!groupChannelList.isEmpty()) {
// 获取这些节点的所有父节点
channelList.addAll(groupChannelList);
}
}
@@ -344,6 +349,19 @@ public class GbChannelServiceImpl implements IGbChannelService {
return channelList;
}
private List<Region> getAllRegion(List<Region> regionChannelList ) {
if (regionChannelList.isEmpty()) {
return new ArrayList<>();
}
List<Region> channelList = regionMapper.queryParentInChannelList(regionChannelList);
if (channelList.isEmpty()) {
return channelList;
}
List<Region> allParentRegion = getAllRegion(channelList);
channelList.addAll(allParentRegion);
return channelList;
}
@Override
public CommonGBChannel getOne(int id) {