From 36f94593a452ec5fa9950544c39d6cf30dc758d2 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 11 Sep 2024 17:55:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CommonChannelController.java | 21 +++++++++++++++++++ .../gb28181/service/IGbChannelService.java | 2 ++ .../service/impl/GbChannelServiceImpl.java | 8 +++++++ 3 files changed, 31 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/CommonChannelController.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/CommonChannelController.java index b386d56e..ff239c8a 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/CommonChannelController.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/CommonChannelController.java @@ -167,4 +167,25 @@ public class CommonChannelController { Assert.notEmpty(param.getDeviceIds(),"参数异常"); channelService.deleteChannelToGroupByGbDevice(param.getDeviceIds()); } + + @Operation(summary = "获取树节点", security = @SecurityRequirement(name = JwtUtils.HEADER)) + @Parameter(name = "parentId", description = "父节点ID", required = false) + @Parameter(name = "parentDeviceId", description = "父节点国标编号", required = false) + @Parameter(name = "showRegion", description = "显示行政区划", required = false) + @Parameter(name = "showGroup", description = "显示分组", required = false) + @GetMapping("/tree") + public List queryTree( + @RequestParam(required = false) Integer parentId, + @RequestParam(required = false) String parentDeviceId, + @RequestParam(required = false) Boolean showRegion, + @RequestParam(required = false) Boolean showGroup + ){ + if (showRegion == null) { + showRegion = false; + } + if (showGroup == null) { + showRegion = false; + } + return channelService.queryTree(parentId, parentDeviceId, showRegion, showGroup); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java index 967d053f..7a615b83 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java @@ -77,4 +77,6 @@ public interface IGbChannelService { CommonGBChannel queryOneWithPlatform(Integer platformId, String channelDeviceId); void updateCivilCode(String oldCivilCode, String newCivilCode); + + List queryTree(Integer parentId, String parentDeviceId, Boolean showRegion, Boolean showGroup); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java index ffbe6f64..f877767c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java @@ -675,4 +675,12 @@ public class GbChannelServiceImpl implements IGbChannelService { } } } + + @Override + public List queryTree(Integer parentId, String parentDeviceId, Boolean showRegion, Boolean showGroup) { + if (parentId == null || Objects.isNull(parentDeviceId)) { + // 查询顶级节点 + } + return Collections.emptyList(); + } }