From e52c9c1282f7035decbd714f674d4cbd6da31a80 Mon Sep 17 00:00:00 2001 From: fengcheng <2929004360@qq.com> Date: Mon, 14 Apr 2025 11:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E9=81=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ruoyi-ui-vue3/src/api/wvp/channel.js | 56 +++ .../src/views/wvp/thoroughfare/group.vue | 387 ++++++++++++++++++ .../src/views/wvp/thoroughfare/index.vue | 29 ++ .../src/views/wvp/thoroughfare/region.vue | 381 +++++++++++++++++ .../controller/CommonChannelController.java | 98 +++-- .../gb28181/service/IGbChannelService.java | 4 +- .../service/impl/GbChannelServiceImpl.java | 35 +- .../wvp/mapper/CommonGBChannelMapper.java | 10 +- .../wvp/mapper/PlatformChannelMapper.java | 2 +- ...20000001320000001_34020000001310000001.jpg | Bin 61756 -> 61907 bytes ...20000001350000001_34020000001310000001.jpg | Bin 47744 -> 44651 bytes ...20000001400000001_34020000001320000001.jpg | Bin 0 -> 24713 bytes 13 files changed, 944 insertions(+), 59 deletions(-) create mode 100644 ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue create mode 100644 ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue create mode 100644 ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue create mode 100644 snap/34020000001400000001_34020000001320000001.jpg diff --git a/.gitignore b/.gitignore index 1b6817e..620cdbb 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ nbbuild/ dist/ nbdist/ .nb-gradle/ +snap/ ###################################################################### # Others diff --git a/ruoyi-ui-vue3/src/api/wvp/channel.js b/ruoyi-ui-vue3/src/api/wvp/channel.js index 60addcf..c8b4e61 100644 --- a/ruoyi-ui-vue3/src/api/wvp/channel.js +++ b/ruoyi-ui-vue3/src/api/wvp/channel.js @@ -67,3 +67,59 @@ export function addChannelData(data) { data: data, }) } + +// 获取通道列表 +export function queryListByCivilCode(query) { + return request({ + url: `/api/common/channel/civilcode/list`, + method: 'get', + params: query + }) +} + + +// 根据ParentId获取通道列表 +export function queryListByParentId(query) { + return request({ + url: `/api/common/channel/parent/list`, + method: 'get', + params: query + }) +} + +// 添加通道 +export function addChannelToRegion(data) { + return request({ + url: `/api/common/channel/region/add`, + method: 'post', + data: data + }) +} + +// 删除通道 +export function deleteChannelToRegion(data) { + return request({ + url: `/api/common/channel/region/delete`, + method: 'post', + data: data + }) +} + +// 删除通道 +export function deleteChannelToGroup(data) { + return request({ + url: `/api/common/channel/group/delete`, + method: 'post', + data: data + }) +} + +// 添加通道信息 +export function addChannelToGroup(data) { + return request({ + url: `/api/common/channel/group/add`, + method: 'post', + data: data + }) +} + diff --git a/ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue new file mode 100644 index 0000000..b52b60d --- /dev/null +++ b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue @@ -0,0 +1,387 @@ + + + + + diff --git a/ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue new file mode 100644 index 0000000..6fc5f69 --- /dev/null +++ b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue new file mode 100644 index 0000000..dd7c9bd --- /dev/null +++ b/ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue @@ -0,0 +1,381 @@ + + + + + diff --git a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/controller/CommonChannelController.java b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/controller/CommonChannelController.java index 223ae94..4c91d7b 100644 --- a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/controller/CommonChannelController.java +++ b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/controller/CommonChannelController.java @@ -4,12 +4,10 @@ package com.ruoyi.wvp.gb28181.controller; import com.github.pagehelper.PageInfo; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.wvp.common.StreamInfo; import com.ruoyi.wvp.conf.UserSetting; import com.ruoyi.wvp.gb28181.bean.CommonGBChannel; -import com.ruoyi.wvp.gb28181.bean.DeviceType; -import com.ruoyi.wvp.gb28181.bean.IndustryCodeType; -import com.ruoyi.wvp.gb28181.bean.NetworkIdentificationType; import com.ruoyi.wvp.gb28181.controller.bean.ChannelToGroupByGbDeviceParam; import com.ruoyi.wvp.gb28181.controller.bean.ChannelToGroupParam; import com.ruoyi.wvp.gb28181.controller.bean.ChannelToRegionByGbDeviceParam; @@ -151,53 +149,79 @@ public class CommonChannelController extends BaseController { return channelService.queryList(page, count, query, online, hasRecordPlan, channelType); } - @Parameter(name = "page", description = "当前页", required = true) - @Parameter(name = "count", description = "每页查询数量", required = true) - @Parameter(name = "query", description = "查询内容") - @Parameter(name = "online", description = "是否在线") - @Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理") - @Parameter(name = "civilCode", description = "行政区划") + /** + * 获取通道列表 + * + * @param pageNum 当前页 + * @param pageSize 每页查询数量 + * @param query 查询内容 + * @param online 是否在线 + * @param channelType 通道类型, 0:国标设备,1:推流设备,2:拉流代理 + * @param civilCode 行政区划 + * @return + */ @GetMapping("/civilcode/list") - public PageInfo queryListByCivilCode(int page, int count, - @RequestParam(required = false) String query, - @RequestParam(required = false) Boolean online, - @RequestParam(required = false) Integer channelType, - @RequestParam(required = false) String civilCode) { + public TableDataInfo queryListByCivilCode(int pageNum, int pageSize, + @RequestParam(required = false) String query, + @RequestParam(required = false) Boolean online, + @RequestParam(required = false) Integer channelType, + @RequestParam(required = false) String civilCode) { + startPage(); if (ObjectUtils.isEmpty(query)) { query = null; } - return channelService.queryListByCivilCode(page, count, query, online, channelType, civilCode); + List list = channelService.queryListByCivilCode(pageNum, pageSize, query, online, channelType, civilCode); + return getDataTable(list); } - @Parameter(name = "page", description = "当前页", required = true) - @Parameter(name = "count", description = "每页查询数量", required = true) - @Parameter(name = "query", description = "查询内容") - @Parameter(name = "online", description = "是否在线") - @Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理") - @Parameter(name = "groupDeviceId", description = "业务分组下的父节点ID") + /** + * 根据ParentId获取通道列表 + * + * @param pageNum 当前页 + * @param pageSize 每页查询数量 + * @param query 查询内容 + * @param online 是否在线 + * @param channelType 通道类型, 0:国标设备,1:推流设备,2:拉流代理 + * @param groupDeviceId 业务分组下的父节点ID + * @return + */ @GetMapping("/parent/list") - public PageInfo queryListByParentId(int page, int count, - @RequestParam(required = false) String query, - @RequestParam(required = false) Boolean online, - @RequestParam(required = false) Integer channelType, - @RequestParam(required = false) String groupDeviceId) { + public TableDataInfo queryListByParentId(int pageNum, int pageSize, + @RequestParam(required = false) String query, + @RequestParam(required = false) Boolean online, + @RequestParam(required = false) Integer channelType, + @RequestParam(required = false) String groupDeviceId) { + startPage(); if (ObjectUtils.isEmpty(query)) { query = null; } - return channelService.queryListByParentId(page, count, query, online, channelType, groupDeviceId); + List list = channelService.queryListByParentId(pageNum, pageSize, query, online, channelType, groupDeviceId); + return getDataTable(list); } + /** + * 添加通道 + * + * @param param + */ @PostMapping("/region/add") - public void addChannelToRegion(@RequestBody ChannelToRegionParam param) { + public AjaxResult addChannelToRegion(@RequestBody ChannelToRegionParam param) { Assert.notEmpty(param.getChannelIds(), "通道ID不可为空"); Assert.hasLength(param.getCivilCode(), "未添加行政区划"); channelService.addChannelToRegion(param.getCivilCode(), param.getChannelIds()); + return success(); } + /** + * 删除通道 + * + * @param param + */ @PostMapping("/region/delete") - public void deleteChannelToRegion(@RequestBody ChannelToRegionParam param) { + public AjaxResult deleteChannelToRegion(@RequestBody ChannelToRegionParam param) { Assert.isTrue(!param.getChannelIds().isEmpty() || !ObjectUtils.isEmpty(param.getCivilCode()), "参数异常"); channelService.deleteChannelToRegion(param.getCivilCode(), param.getChannelIds()); + return success(); } @PostMapping("/region/device/add") @@ -213,20 +237,32 @@ public class CommonChannelController extends BaseController { channelService.deleteChannelToRegionByGbDevice(param.getDeviceIds()); } + /** + * 添加通道信息 + * + * @param param + */ @PostMapping("/group/add") - public void addChannelToGroup(@RequestBody ChannelToGroupParam param) { + public AjaxResult addChannelToGroup(@RequestBody ChannelToGroupParam param) { Assert.notEmpty(param.getChannelIds(), "通道ID不可为空"); Assert.hasLength(param.getParentId(), "未添加上级分组编号"); Assert.hasLength(param.getBusinessGroup(), "未添加业务分组"); channelService.addChannelToGroup(param.getParentId(), param.getBusinessGroup(), param.getChannelIds()); + return success(); } + /** + * 删除通道 + * + * @param param + */ @PostMapping("/group/delete") - public void deleteChannelToGroup(@RequestBody ChannelToGroupParam param) { + public AjaxResult deleteChannelToGroup(@RequestBody ChannelToGroupParam param) { Assert.isTrue(!param.getChannelIds().isEmpty() || (!ObjectUtils.isEmpty(param.getParentId()) && !ObjectUtils.isEmpty(param.getBusinessGroup())), "参数异常"); channelService.deleteChannelToGroup(param.getParentId(), param.getBusinessGroup(), param.getChannelIds()); + return success(); } @PostMapping("/group/device/add") diff --git a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/IGbChannelService.java b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/IGbChannelService.java index e5b86a7..0f3cb2d 100644 --- a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/IGbChannelService.java +++ b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/IGbChannelService.java @@ -41,9 +41,9 @@ public interface IGbChannelService { void reset(int id); - PageInfo queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode); + List queryListByCivilCode(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String civilCode); - PageInfo queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId); + List queryListByParentId(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String groupDeviceId); void removeCivilCode(List allChildren); diff --git a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/impl/GbChannelServiceImpl.java b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/impl/GbChannelServiceImpl.java index 00bd225..67db3f9 100644 --- a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/impl/GbChannelServiceImpl.java +++ b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/gb28181/service/impl/GbChannelServiceImpl.java @@ -5,14 +5,14 @@ import com.github.pagehelper.PageInfo; import com.ruoyi.wvp.common.enums.ChannelDataType; import com.ruoyi.wvp.conf.exception.ControllerException; import com.ruoyi.wvp.gb28181.bean.*; -import com.ruoyi.wvp.mapper.CommonGBChannelMapper; -import com.ruoyi.wvp.mapper.GroupMapper; -import com.ruoyi.wvp.mapper.PlatformChannelMapper; -import com.ruoyi.wvp.mapper.RegionMapper; import com.ruoyi.wvp.gb28181.event.EventPublisher; import com.ruoyi.wvp.gb28181.event.subscribe.catalog.CatalogEvent; import com.ruoyi.wvp.gb28181.service.IGbChannelService; import com.ruoyi.wvp.gb28181.service.IPlatformChannelService; +import com.ruoyi.wvp.mapper.CommonGBChannelMapper; +import com.ruoyi.wvp.mapper.GroupMapper; +import com.ruoyi.wvp.mapper.PlatformChannelMapper; +import com.ruoyi.wvp.mapper.RegionMapper; import com.ruoyi.wvp.streamPush.bean.StreamPush; import com.ruoyi.wvp.utils.DateUtil; import com.ruoyi.wvp.vmanager.bean.ErrorCode; @@ -60,7 +60,7 @@ public class GbChannelServiceImpl implements IGbChannelService { if (commonGBChannel.getDataType() == null || commonGBChannel.getDataDeviceId() == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "缺少通道数据类型或通道数据关联设备ID"); } - CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId()); + CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId()); if (commonGBChannelInDb != null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "此推流已经关联通道"); } @@ -75,7 +75,7 @@ public class GbChannelServiceImpl implements IGbChannelService { // 移除国标级联关联的信息 try { platformChannelService.removeChannel(gbId); - }catch (Exception e) { + } catch (Exception e) { log.error("[移除通道国标级联共享失败]", e); } @@ -98,7 +98,7 @@ public class GbChannelServiceImpl implements IGbChannelService { // 移除国标级联关联的信息 try { platformChannelService.removeChannels(new ArrayList<>(ids)); - }catch (Exception e) { + } catch (Exception e) { log.error("[移除通道国标级联共享失败]", e); } List channelListInDb = commonGBChannelMapper.queryByIds(ids); @@ -323,7 +323,6 @@ public class GbChannelServiceImpl implements IGbChannelService { } - @Override public CommonGBChannel getOne(int id) { return commonGBChannelMapper.queryById(id); @@ -387,27 +386,23 @@ public class GbChannelServiceImpl implements IGbChannelService { } @Override - public PageInfo queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode) { - PageHelper.startPage(page, count); + public List queryListByCivilCode(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String civilCode) { if (query != null) { query = query.replaceAll("/", "//") .replaceAll("%", "/%") .replaceAll("_", "/_"); } - List all = commonGBChannelMapper.queryListByCivilCode(query, online, channelType, civilCode); - return new PageInfo<>(all); + return commonGBChannelMapper.queryListByCivilCode(query, online, channelType, civilCode); } @Override - public PageInfo queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId) { - PageHelper.startPage(page, count); + public List queryListByParentId(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String groupDeviceId) { if (query != null) { query = query.replaceAll("/", "//") .replaceAll("%", "/%") .replaceAll("_", "/_"); } - List all = commonGBChannelMapper.queryListByParentId(query, online, channelType, groupDeviceId); - return new PageInfo<>(all); + return commonGBChannelMapper.queryListByParentId(query, online, channelType, groupDeviceId); } @Override @@ -460,7 +455,7 @@ public class GbChannelServiceImpl implements IGbChannelService { Region region = regionMapper.queryByDeviceId(civilCode); if (region == null) { platformChannelService.checkRegionRemove(channelList, null); - }else { + } else { List regionList = new ArrayList<>(); regionList.add(region); platformChannelService.checkRegionRemove(channelList, regionList); @@ -626,7 +621,7 @@ public class GbChannelServiceImpl implements IGbChannelService { Group group = groupMapper.queryOneByDeviceId(parentId, businessGroup); if (group == null) { platformChannelService.checkGroupRemove(channelList, null); - }else { + } else { List groupList = new ArrayList<>(); groupList.add(group); platformChannelService.checkGroupRemove(channelList, groupList); @@ -678,7 +673,7 @@ public class GbChannelServiceImpl implements IGbChannelService { List channelList = platformChannelMapper.queryOneWithPlatform(platformId, channelDeviceId); if (!channelList.isEmpty()) { return channelList.get(channelList.size() - 1); - }else { + } else { return null; } } @@ -722,7 +717,7 @@ public class GbChannelServiceImpl implements IGbChannelService { .replaceAll("%", "/%") .replaceAll("_", "/_"); } - List all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType); + List all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType); return new PageInfo<>(all); } } diff --git a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/mapper/CommonGBChannelMapper.java b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/mapper/CommonGBChannelMapper.java index e1c8f80..e3a70cd 100644 --- a/ruoyi-wvp/src/main/java/com/ruoyi/wvp/mapper/CommonGBChannelMapper.java +++ b/ruoyi-wvp/src/main/java/com/ruoyi/wvp/mapper/CommonGBChannelMapper.java @@ -241,14 +241,14 @@ public interface CommonGBChannelMapper { @SelectProvider(type = ChannelProvider.class, method = "queryByIds") - List queryByIds(Collection ids); + List queryByIds(@Param("ids") Collection ids); @Delete(value = {" "}) - void batchDelete(List channelListInDb); + void batchDelete(@Param("channelListInDb") List channelListInDb); @SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCode") List queryListByCivilCode(@Param("query") String query, @Param("online") Boolean online, @@ -305,7 +305,7 @@ public interface CommonGBChannelMapper { " WHERE id in "+ " #{item.gbId}" + " "}) - int removeCivilCodeByChannels(List channelList); + int removeCivilCodeByChannels(@Param("channelList") List channelList); @SelectProvider(type = ChannelProvider.class, method = "queryByCivilCode") List queryByCivilCode(@Param("civilCode") String civilCode); @@ -329,7 +329,7 @@ public interface CommonGBChannelMapper { " WHERE id in "+ " #{item.gbId}" + " "}) - int removeParentIdByChannels(List channelList); + int removeParentIdByChannels(@Param("channelList") List channelList); @SelectProvider(type = ChannelProvider.class, method = "queryByBusinessGroup") List queryByBusinessGroup(@Param("businessGroup") String businessGroup); @@ -378,7 +378,7 @@ public interface CommonGBChannelMapper { " #{item.gbId}" + " "}) int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup, - List channelList); + @Param("channelList") List channelList); @Update({" ") - List queryPlatFormListByChannelList(Collection ids); + List queryPlatFormListByChannelList(@Param("ids") Collection ids); @Select("