diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatalog.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatalog.java index 38ba2f03..3d5ebaf8 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatalog.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformCatalog.java @@ -23,6 +23,9 @@ public class PlatformCatalog { @Schema(description = "行政区划") private String civilCode; + @Schema(description = "为所关联的通道缓存的行政区划") + private String civilCodeForChannel; + @Schema(description = "目录分组") private String businessGroupId; @@ -102,6 +105,15 @@ public class PlatformCatalog { return civilCode; } + + public String getCivilCodeForChannel() { + return civilCodeForChannel; + } + + public void setCivilCodeForChannel(String civilCodeForChannel) { + this.civilCodeForChannel = civilCodeForChannel; + } + public void setCivilCode(String civilCode) { this.civilCode = civilCode; } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java index c2c9d725..8f20acdf 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java @@ -117,7 +117,7 @@ public class GbStreamServiceImpl implements IGbStreamService { PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId); if (catalog != null) { - deviceChannel.setCivilCode(catalog.getCivilCode()); + deviceChannel.setCivilCode(catalog.getCivilCodeForChannel()); deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId()); }else { @@ -219,7 +219,7 @@ public class GbStreamServiceImpl implements IGbStreamService { deviceChannel.setRegisterWay(1); PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId); if (catalog != null) { - deviceChannel.setCivilCode(catalog.getCivilCode()); + deviceChannel.setCivilCode(catalog.getCivilCodeForChannel()); deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId()); }else { diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java index 35028dff..21a53748 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java @@ -126,7 +126,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { private List getDeviceChannelListByChannelReduceList(List channelReduces, String catalogId, ParentPlatform platform) { List deviceChannelList = new ArrayList<>(); - if (channelReduces.size() > 0){ + if (!channelReduces.isEmpty()){ PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId); if (catalog == null && catalogId.equals(platform.getDeviceGBId())) { for (ChannelReduce channelReduce : channelReduces) { @@ -143,7 +143,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { for (ChannelReduce channelReduce : channelReduces) { DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId()); deviceChannel.setParental(0); - deviceChannel.setCivilCode(catalog.getCivilCode()); + deviceChannel.setCivilCode(catalog.getCivilCodeForChannel()); deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId()); deviceChannelList.add(deviceChannel); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index 74efad6a..fc555088 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -486,10 +486,10 @@ public interface DeviceChannelMapper { @Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}") List getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode); - @Select("select dc.id, dc.channel_id, dc.device_id, COALESCE(dc.custom_name, dc.name) AS name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " + + @Select("select dc.id, dc.channel_id, dc.device_id, COALESCE(dc.custom_name, dc.name) AS name, dc.manufacture,dc.model,dc.owner, pc.civil_code_for_channel as civil_code,dc.block, " + " dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " + " dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, dc.password, dc.status, " + - " COALESCE(dc.custom_longitude, dc.longitude) AS longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " + + " COALESCE(dc.custom_longitude, dc.longitude) A S longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " + " from wvp_device_channel dc" + " LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" + " LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" + diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java index 3790bdab..5fe3980f 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java @@ -78,7 +78,7 @@ public interface GbStreamMapper { @Select(""}) List selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId); @Update(value = {"