完善目录推送

pull/1642/head
panlinlin 2024-08-17 08:02:39 +08:00
parent 635458d19a
commit 4dd656b29b
4 changed files with 19 additions and 2 deletions

View File

@ -450,7 +450,7 @@ public class CommonGBChannel {
CommonGBChannel commonGBChannel = new CommonGBChannel(); CommonGBChannel commonGBChannel = new CommonGBChannel();
commonGBChannel.setGbDeviceId(region.getDeviceId()); commonGBChannel.setGbDeviceId(region.getDeviceId());
commonGBChannel.setGbName(region.getName()); commonGBChannel.setGbName(region.getName());
return null; return commonGBChannel;
} }
} }

View File

@ -420,7 +420,7 @@ public interface CommonGBChannelMapper {
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" + " coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" + " coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" + " coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" + " coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" + " coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" + " coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" + " coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +

View File

@ -179,4 +179,13 @@ public interface GroupMapper {
" <foreach collection='regionChannelList' item='item' open='(' separator=',' close=')' > #{item.parentDeviceId}</foreach>" + " <foreach collection='regionChannelList' item='item' open='(' separator=',' close=')' > #{item.parentDeviceId}</foreach>" +
" </script>") " </script>")
Set<Group> queryParentInChannelList(Set<Group> regionChannelList); Set<Group> queryParentInChannelList(Set<Group> regionChannelList);
@Select(" <script>" +
" SELECT " +
" * " +
" from wvp_common_group " +
" where device_id in " +
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbBusinessGroupId}</foreach>" +
" </script>")
Set<Group> queryBusinessGroupInChannelList(List<CommonGBChannel> channelList);
} }

View File

@ -329,6 +329,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
if (!regionChannelList.isEmpty()) { if (!regionChannelList.isEmpty()) {
// 获取这些节点的所有父节点, 使用set滤重 // 获取这些节点的所有父节点, 使用set滤重
Set<Region> allRegion = getAllRegion(regionChannelList); Set<Region> allRegion = getAllRegion(regionChannelList);
allRegion.addAll(regionChannelList);
for (Region region : allRegion) { for (Region region : allRegion) {
channelList.add(CommonGBChannel.build(region)); channelList.add(CommonGBChannel.build(region));
} }
@ -336,10 +337,17 @@ public class GbChannelServiceImpl implements IGbChannelService {
} }
// 是否包含分组信息 // 是否包含分组信息
if (platform.getCatalogWithGroup()) { if (platform.getCatalogWithGroup()) {
// 虚拟组织
Set<Group> groupChannelList = groupMapper.queryInChannelList(commonGBChannelList); Set<Group> groupChannelList = groupMapper.queryInChannelList(commonGBChannelList);
// 业务分组
Set<Group> businessGroupChannelList = groupMapper.queryBusinessGroupInChannelList(commonGBChannelList);
if (!groupChannelList.isEmpty()) { if (!groupChannelList.isEmpty()) {
// 获取这些节点的所有父节点 // 获取这些节点的所有父节点
Set<Group> allGroup = getAllGroup(groupChannelList); Set<Group> allGroup = getAllGroup(groupChannelList);
allGroup.addAll(groupChannelList);
if (!businessGroupChannelList.isEmpty()) {
allGroup.addAll(businessGroupChannelList);
}
for (Group group : allGroup) { for (Group group : allGroup) {
channelList.add(CommonGBChannel.build(group)); channelList.add(CommonGBChannel.build(group));
} }