From 1d8dd248a54f64bd9acd62601192b29a75624245 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 15 Sep 2023 09:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/bean/DeviceChannel.java | 2 +- .../vmp/service/impl/CommonGbChannelServiceImpl.java | 4 ++-- .../iot/vmp/vmanager/gb28181/device/DeviceQuery.java | 11 ++++++++--- src/main/resources/all-application.yml | 2 +- src/main/resources/application-dev.yml | 2 +- src/main/resources/application-docker.yml | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) 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 e01f31de..abbdc8b4 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 @@ -4,7 +4,7 @@ import com.genersoft.iot.vmp.common.CommonGbChannel; import io.swagger.v3.oas.annotations.media.Schema; @Schema(description = "通道信息") -public class DeviceChannel extends CommonGbChannel { +public class DeviceChannel { /** diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java index 59c8e461..dc83d809 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java @@ -140,7 +140,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService { commonGbChannel.setCommonGbLongitude(deviceChannel.getLongitude()); commonGbChannel.setCommonGbLatitude(deviceChannel.getLatitude()); commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType()); - commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); +// commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); commonGbChannel.setCommonGbBusinessGroupID(deviceChannel.getBusinessGroupId()); } else { for (String key : syncKeys) { @@ -217,7 +217,7 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService { commonGbChannel.setCommonGbPtzType(deviceChannel.getPTZType()); break; case "commonGbPositionType": - commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); +// commonGbChannel.setCommonGbPositionType(deviceChannel.getCommonGbPositionType()); break; case "commonGbRoomType": break; diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index b182b265..4a161c0e 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java @@ -139,7 +139,6 @@ public class DeviceQuery { if (ObjectUtils.isEmpty(query)) { query = null; } - return storager.queryChannelsByDeviceId(deviceId, query, channelType, online, catalogUnderDevice, page, count); } @@ -257,8 +256,14 @@ public class DeviceQuery { @Parameter(name = "deviceId", description = "设备国标编号", required = true) @Parameter(name = "channel", description = "通道信息", required = true) @PostMapping("/channel/update/{deviceId}") - public void updateChannel(@PathVariable String deviceId,DeviceChannel channel){ - deviceChannelService.updateChannel(deviceId, channel); + public void updateChannel(@PathVariable String deviceId, DeviceChannel channel, @RequestBody DeviceChannel channelJSON){ + DeviceChannel deviceChannel; + if (!ObjectUtils.isEmpty(channel) && !ObjectUtils.isEmpty(channel.getChannelId()) ) { + deviceChannel = channel; + }else { + deviceChannel = channelJSON; + } + deviceChannelService.updateChannel(deviceId, deviceChannel); } /** diff --git a/src/main/resources/all-application.yml b/src/main/resources/all-application.yml index 595f629c..e0123793 100644 --- a/src/main/resources/all-application.yml +++ b/src/main/resources/all-application.yml @@ -36,7 +36,7 @@ spring: datasource: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true + url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true username: root password: root123 hikari: diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index e149886e..0a7a4908 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -26,7 +26,7 @@ spring: datasource: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true + url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true username: root password: root hikari: diff --git a/src/main/resources/application-docker.yml b/src/main/resources/application-docker.yml index 0e0c0ad3..fbb55f08 100644 --- a/src/main/resources/application-docker.yml +++ b/src/main/resources/application-docker.yml @@ -20,7 +20,7 @@ spring: datasource: # 使用mysql 打开23-28行注释, 删除29-36行 name: wvp - url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false&allowMultiQueries=true + url: jdbc:mysql://127.0.0.1:3306/wvp2?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true username: root password: root type: com.zaxxer.hikari.HikariDataSource