From bee911fa09d3133ff8e0d68a089720d365c800c1 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Wed, 24 Sep 2025 17:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E9=81=93=E5=A2=9E=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=B1=9E=E6=80=A7=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BA=91=E5=8F=B0=E6=8E=A7=E5=88=B6=E5=92=8C?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=94=AF=E6=8C=81=E8=AF=AD=E9=9F=B3=E5=AF=B9?= =?UTF-8?q?=E8=AE=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/bean/CommonGBChannel.java | 12 ++++++++++ .../iot/vmp/gb28181/bean/DeviceChannel.java | 11 +++++++++ .../gb28181/dao/CommonGBChannelMapper.java | 20 ++++++++++++---- .../gb28181/dao/provider/ChannelProvider.java | 6 +++++ web/src/views/common/CommonChannelEdit.vue | 9 +++++++ 数据库/2.7.4/初始化-mysql-2.7.4.sql | 2 ++ .../2.7.4/初始化-postgresql-kingbase-2.7.4.sql | 2 ++ 数据库/2.7.4/更新-mysql-2.7.4.sql | 24 +++++++++++++++++++ .../2.7.4/更新-postgresql-kingbase-2.7.4.sql | 3 +++ 9 files changed, 85 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java index 4d302fec4..cbbb95788 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java @@ -153,6 +153,12 @@ public class CommonGBChannel { @Schema(description = "流唯一编号,存在表示正在直播") private String streamId; + @Schema(description = "是否支持云台控制 1支持,0不支持") + private Integer enablePtz; + + @Schema(description = "是否支持对讲 1支持,0不支持") + private Integer enableBroadcast; + public String encode(String serverDeviceId) { return encode(null, serverDeviceId); } @@ -340,6 +346,12 @@ public class CommonGBChannel { if (this.getGbSvcTimeSupportMode() != null) { content.append(" " + this.getGbSvcTimeSupportMode() + "\n"); } + if (this.getEnablePtz() != null) { + content.append(" " + this.getEnablePtz() + "\n"); + } + if (this.getEnableBroadcast() != null) { + content.append(" " + this.getEnableBroadcast() + "\n"); + } content.append("\n"); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java index 94010da63..865521ca3 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java @@ -236,7 +236,18 @@ public class DeviceChannel extends CommonGBChannel { GbCode gbCode = GbCode.decode(deviceChannel.getDeviceId()); if (gbCode != null && "138".equals(gbCode.getTypeCode())) { deviceChannel.setHasAudio(true); + if (deviceChannel.getEnableBroadcast() == null && "138".equals(gbCode.getTypeCode())) { + deviceChannel.setEnableBroadcast(1); + } + if (deviceChannel.getEnablePtz() == null && ( + deviceChannel.getPtzType() == 1 + || deviceChannel.getPtzType() == 4 + || deviceChannel.getPtzType() == 5 + )) { + deviceChannel.setEnablePtz(1); + } } + return deviceChannel; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/CommonGBChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/CommonGBChannelMapper.java index 3f21f7e38..c39191d02 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/CommonGBChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/CommonGBChannelMapper.java @@ -57,7 +57,9 @@ public interface CommonGBChannelMapper { "gb_business_group_id," + "gb_download_speed," + "gb_svc_space_support_mod," + - "gb_svc_time_support_mode ) " + + "gb_svc_time_support_mode," + + "enable_ptz," + + "enable_broadcast ) " + "VALUES (" + "#{gbDeviceId}, " + "#{dataType}, " + @@ -96,7 +98,9 @@ public interface CommonGBChannelMapper { "#{gbBusinessGroupId},"+ "#{gbDownloadSpeed},"+ "#{gbSvcSpaceSupportMod},"+ - "#{gbSvcTimeSupportMode}"+ + "#{gbSvcTimeSupportMode},"+ + "#{enablePtz},"+ + "#{enableBroadcast}"+ ")" + " ") @Options(useGeneratedKeys = true, keyProperty = "gbId", keyColumn = "id") @@ -144,6 +148,8 @@ public interface CommonGBChannelMapper { ", gb_download_speed = #{gbDownloadSpeed}" + ", gb_svc_space_support_mod = #{gbSvcSpaceSupportMod}" + ", gb_svc_time_support_mode = #{gbSvcTimeSupportMode}" + + ", enable_ptz = #{enablePtz}" + + ", enable_broadcast = #{enableBroadcast}" + " WHERE id = #{gbId}"+ " "}) int update(CommonGBChannel commonGBChannel); @@ -205,7 +211,9 @@ public interface CommonGBChannelMapper { "gb_business_group_id," + "gb_download_speed," + "gb_svc_space_support_mod," + - "gb_svc_time_support_mode ) " + + "gb_svc_time_support_mode," + + "enable_ptz," + + "enable_broadcast ) " + "VALUES" + " " + "(#{item.gbDeviceId}, #{item.dataType}, #{item.dataDeviceId},#{item.createTime},#{item.updateTime}," + @@ -214,7 +222,7 @@ public interface CommonGBChannelMapper { "#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," + "#{item.gbPort},#{item.gbPassword},#{item.gbStatus},#{item.gbLongitude}, #{item.gbLatitude},#{item.gbPtzType},#{item.gbPositionType},#{item.gbRoomType}," + "#{item.gbUseType},#{item.gbSupplyLightType},#{item.gbDirectionType},#{item.gbResolution},#{item.gbBusinessGroupId},#{item.gbDownloadSpeed}," + - "#{item.gbSvcSpaceSupportMod},#{item.gbSvcTimeSupportMode})" + + "#{item.gbSvcSpaceSupportMod},#{item.gbSvcTimeSupportMode},#{item.enablePtz},#{item.enableBroadcast})" + " " + " ") int batchAdd(List commonGBChannels); @@ -424,6 +432,8 @@ public interface CommonGBChannelMapper { ", gb_download_speed=#{item.gbDownloadSpeed}" + ", gb_svc_space_support_mod=#{item.gbSvcSpaceSupportMod}" + ", gb_svc_time_support_mode=#{item.gbSvcTimeSupportMode}" + + ", enable_ptz = #{enablePtz}" + + ", enable_broadcast = #{enableBroadcast}" + " WHERE id=#{item.gbId}" + "" + ""}) @@ -505,6 +515,8 @@ public interface CommonGBChannelMapper { " wdc.create_time,\n" + " wdc.update_time,\n" + " wdc.record_plan_id,\n" + + " wdc.enable_ptz,\n" + + " wdc.enable_broadcast,\n" + " coalesce( wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce( wdc.gb_name, wdc.name) as gb_name,\n" + " coalesce( wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" + diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/provider/ChannelProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/provider/ChannelProvider.java index 4f0340eb9..657c7cb92 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/provider/ChannelProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/provider/ChannelProvider.java @@ -18,6 +18,8 @@ public class ChannelProvider { " update_time,\n" + " stream_id,\n" + " record_plan_id,\n" + + " enable_ptz,\n" + + " enable_broadcast,\n" + " coalesce(gb_device_id, device_id) as gb_device_id,\n" + " coalesce(gb_name, name) as gb_name,\n" + " coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" + @@ -63,6 +65,8 @@ public class ChannelProvider { " wdc.update_time,\n" + " wdc.stream_id,\n" + " wdc.record_plan_id,\n" + + " wdc.enable_ptz,\n" + + " wdc.enable_broadcast,\n" + " coalesce(wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wdc.gb_name, wdc.name) as gb_name,\n" + " coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" + @@ -107,6 +111,8 @@ public class ChannelProvider { " wdc.data_device_id,\n" + " wdc.create_time,\n" + " wdc.update_time,\n" + + " wdc.enable_ptz,\n" + + " wdc.enable_broadcast,\n" + " coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" + " coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" + " coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" + diff --git a/web/src/views/common/CommonChannelEdit.vue b/web/src/views/common/CommonChannelEdit.vue index bc1a972fe..5b6c08710 100644 --- a/web/src/views/common/CommonChannelEdit.vue +++ b/web/src/views/common/CommonChannelEdit.vue @@ -203,6 +203,11 @@ + + 云台控制(非标属性) + 语音对讲(非标属性) + +
保存 取消 @@ -254,6 +259,8 @@ export default { if (this.form.gbDownloadSpeedArray) { this.form.gbDownloadSpeed = this.form.gbDownloadSpeedArray.join('/') } + this.form.enablePtz = this.form.enablePtzForBool ? 1 : 0 + this.form.enableBroadcast = this.form.enableBroadcastForBool ? 1 : 0 if (this.form.gbId) { this.$store.dispatch('commonChanel/update', this.form) .then(data => { @@ -321,6 +328,8 @@ export default { data.gbDownloadSpeedArray = data.gbDownloadSpeed.split('/') } this.form = data + this.$set(this.form, 'enablePtzForBool', this.form.enablePtz === 1) + this.$set(this.form, 'enableBroadcastForBool', this.form.enableBroadcast === 1) }) .finally(() => { this.loading = false diff --git a/数据库/2.7.4/初始化-mysql-2.7.4.sql b/数据库/2.7.4/初始化-mysql-2.7.4.sql index d35c952d4..315bcfbff 100644 --- a/数据库/2.7.4/初始化-mysql-2.7.4.sql +++ b/数据库/2.7.4/初始化-mysql-2.7.4.sql @@ -159,6 +159,8 @@ create table IF NOT EXISTS wvp_device_channel gps_speed double precision, gps_altitude double precision, gps_direction double precision, + enable_ptz integer default 0, + enable_broadcast integer default 0, index (data_type), index (data_device_id), constraint uk_wvp_unique_channel unique (gb_device_id) diff --git a/数据库/2.7.4/初始化-postgresql-kingbase-2.7.4.sql b/数据库/2.7.4/初始化-postgresql-kingbase-2.7.4.sql index ff8d72eab..3224f0903 100644 --- a/数据库/2.7.4/初始化-postgresql-kingbase-2.7.4.sql +++ b/数据库/2.7.4/初始化-postgresql-kingbase-2.7.4.sql @@ -159,6 +159,8 @@ create table IF NOT EXISTS wvp_device_channel gps_speed double precision, gps_altitude double precision, gps_direction double precision, + enable_ptz integer default 0, + enable_broadcast integer default 0, constraint uk_wvp_unique_channel unique (gb_device_id) ); diff --git a/数据库/2.7.4/更新-mysql-2.7.4.sql b/数据库/2.7.4/更新-mysql-2.7.4.sql index d09a6daed..0557943a7 100644 --- a/数据库/2.7.4/更新-mysql-2.7.4.sql +++ b/数据库/2.7.4/更新-mysql-2.7.4.sql @@ -73,6 +73,30 @@ call wvp_20250917(); DROP PROCEDURE wvp_20250917; DELIMITER ; +/* +* 20250924 +*/ +DELIMITER // -- 重定义分隔符避免分号冲突 +CREATE PROCEDURE `wvp_20250924`() +BEGIN + IF NOT EXISTS (SELECT column_name FROM information_schema.columns + WHERE TABLE_SCHEMA = (SELECT DATABASE()) and table_name = 'wvp_device_channel' and column_name = 'enable_ptz') + THEN + ALTER TABLE wvp_device_channel ADD enable_ptz integer default 0; + END IF; + + IF NOT EXISTS (SELECT column_name FROM information_schema.columns + WHERE TABLE_SCHEMA = (SELECT DATABASE()) and table_name = 'wvp_device_channel' and column_name = 'enable_broadcast') + THEN + ALTER TABLE wvp_device_channel ADD enable_broadcast integer default 0; + END IF; +END; // +call wvp_20250924(); +DROP PROCEDURE wvp_20250924; +DELIMITER ; + + + diff --git a/数据库/2.7.4/更新-postgresql-kingbase-2.7.4.sql b/数据库/2.7.4/更新-postgresql-kingbase-2.7.4.sql index 6a87a736d..b584fea2b 100644 --- a/数据库/2.7.4/更新-postgresql-kingbase-2.7.4.sql +++ b/数据库/2.7.4/更新-postgresql-kingbase-2.7.4.sql @@ -37,3 +37,6 @@ create table IF NOT EXISTS wvp_jt_channel ( ALTER table wvp_media_server ADD COLUMN IF NOT EXISTS jtt_proxy_port integer; ALTER table wvp_media_server ADD COLUMN IF NOT EXISTS mp4_port integer; ALTER table wvp_media_server ADD COLUMN IF NOT EXISTS mp4_ssl_port integer; + +ALTER table wvp_device_channel ADD COLUMN IF NOT EXISTS enable_broadcast integer default 0; +ALTER table wvp_device_channel ADD COLUMN IF NOT EXISTS enable_broadcast integer default 0;