mirror of
https://gitee.com/xiaochemgzi/RuoYi-Wvp.git
synced 2025-12-30 04:42:25 +00:00
Merge branch 'master' of https://gitee.com/tangwenzhaoaini/RuoYi-Wvp
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,6 +35,7 @@ nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
snap/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
387
ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue
Normal file
387
ruoyi-ui-vue3/src/views/wvp/thoroughfare/group.vue
Normal file
@@ -0,0 +1,387 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-input v-model="groupName" placeholder="请输入分组名称" clearable prefix-icon="Search"
|
||||
style="margin-bottom: 20px"/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree :data="groupOptions"
|
||||
:props="{label: 'name', children: 'children'}"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="groupTreeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键字" prop="query">
|
||||
<el-input v-model="queryParams.query" placeholder="请输入关键字" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="channelType">
|
||||
<el-select v-model="queryParams.channelType" placeholder="请选择类型" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="国标设备" :value="1"></el-option>
|
||||
<el-option label="推流设备" :value="2"></el-option>
|
||||
<el-option label="拉流代理" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="online">
|
||||
<el-select v-model="queryParams.online" placeholder="请选择在线状态" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="在线" value="true"></el-option>
|
||||
<el-option label="离线" value="false"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete">
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="channelList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column prop="gbName" label="名称" align="center"/>
|
||||
<el-table-column prop="gbDeviceId" label="编号" align="center"/>
|
||||
<el-table-column prop="gbManufacturer" label="厂家" align="center"/>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag effect="plain" v-if="scope.row.dataType === 1">国标设备</el-tag>
|
||||
<el-tag effect="plain" type="success" v-else-if="scope.row.dataType === 2">推流设备</el-tag>
|
||||
<el-tag effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog :title="title" v-model="open" width="1100px" append-to-body>
|
||||
<el-form :model="queryParamsSelect" ref="querySelectRef" :inline="true" v-show="showSearchSelect"
|
||||
label-width="68px">
|
||||
<el-form-item label="关键字" prop="query">
|
||||
<el-input v-model="queryParamsSelect.query" placeholder="请输入关键字" clearable style="width: 240px"
|
||||
@keyup.enter="handleSelectQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="channelType">
|
||||
<el-select v-model="queryParamsSelect.channelType" placeholder="请选择类型" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="国标设备" :value="1"></el-option>
|
||||
<el-option label="推流设备" :value="2"></el-option>
|
||||
<el-option label="拉流代理" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="online">
|
||||
<el-select v-model="queryParamsSelect.online" placeholder="请选择在线状态" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="在线" value="true"></el-option>
|
||||
<el-option label="离线" value="false"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSelectQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetSelectQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary"
|
||||
plain
|
||||
icon="Select"
|
||||
:disabled="multipleSelect"
|
||||
@click="handleSelect">
|
||||
选择
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearchSelect" @queryTable="getChannelList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loadingSelect" :data="channelSelectList" @selection-change="handleSelectionSelectChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column prop="gbName" label="名称" align="center"/>
|
||||
<el-table-column prop="gbDeviceId" label="编号" align="center"/>
|
||||
<el-table-column prop="gbManufacturer" label="厂家" align="center"/>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag effect="plain" v-if="scope.row.dataType === 1">国标设备</el-tag>
|
||||
<el-tag effect="plain" type="success" v-else-if="scope.row.dataType === 2">推流设备</el-tag>
|
||||
<el-tag effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="totalSelect > 0"
|
||||
:total="totalSelect"
|
||||
v-model:page="queryParamsSelect.pageNum"
|
||||
v-model:limit="queryParamsSelect.pageSize"
|
||||
@pagination="getChannelList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Group">
|
||||
import {queryForTree} from "../../../api/wvp/group.js";
|
||||
import {
|
||||
addChannelToGroup,
|
||||
deleteChannelToGroup,
|
||||
queryListByCivilCode,
|
||||
queryListByParentId
|
||||
} from "../../../api/wvp/channel.js";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
|
||||
const groupName = ref('')
|
||||
const groupOptions = ref([]);
|
||||
const channelList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
const showSearch = ref(true);
|
||||
const groupDeviceId = ref('');
|
||||
const businessGroup = ref('');
|
||||
const selectionList = ref([]);
|
||||
const multiple = ref(true);
|
||||
const open = ref(false);
|
||||
const title = ref("");
|
||||
const dataType = ref('group');
|
||||
|
||||
const channelSelectList = ref([]);
|
||||
const loadingSelect = ref(true);
|
||||
const totalSelect = ref(0);
|
||||
const showSearchSelect = ref(true);
|
||||
const multipleSelect = ref(true);
|
||||
const selectionSelectList = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
query: undefined,
|
||||
online: undefined,
|
||||
channelType: undefined,
|
||||
groupDeviceId: ' '
|
||||
},
|
||||
rules: {},
|
||||
|
||||
queryParamsSelect: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
query: undefined,
|
||||
online: undefined,
|
||||
channelType: undefined,
|
||||
groupDeviceId: undefined,
|
||||
}
|
||||
});
|
||||
|
||||
const {queryParams, form, rules, queryParamsSelect} = toRefs(data);
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
queryListByParentId(queryParams.value).then((res) => {
|
||||
channelList.value = res.rows
|
||||
total.value = res.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据名称筛选树 */
|
||||
watch(groupName, val => {
|
||||
proxy.$refs["groupTreeRef"].filter(val);
|
||||
});
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
selectionList.value = selection
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
let channels = []
|
||||
for (let i = 0; i < selectionList.value.length; i++) {
|
||||
channels.push(selectionList.value[i].gbId)
|
||||
}
|
||||
proxy.$modal.confirm('是否删除选择的数据?').then(function () {
|
||||
return deleteChannelToGroup({channelIds: channels});
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
if (data.deviceId) {
|
||||
queryParams.value.groupDeviceId = data.deviceId;
|
||||
} else {
|
||||
queryParams.value.groupDeviceId = ' ';
|
||||
}
|
||||
|
||||
groupDeviceId.value = queryParams.value.groupDeviceId;
|
||||
businessGroup.value = data.businessGroup;
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (groupDeviceId.value === "" || groupDeviceId.value === ' ') {
|
||||
proxy.$modal.msgError("请选择左侧业务分组");
|
||||
return;
|
||||
}
|
||||
|
||||
title.value = "添加国标通道";
|
||||
open.value = true;
|
||||
|
||||
getChannelList()
|
||||
}
|
||||
|
||||
function getChannelList() {
|
||||
if (dataType.value === "civilCode") {
|
||||
loadingSelect.value = true
|
||||
queryListByCivilCode(queryParamsSelect.value).then((res) => {
|
||||
channelSelectList.value = res.rows
|
||||
totalSelect.value = res.total
|
||||
loadingSelect.value = false
|
||||
})
|
||||
} else {
|
||||
loadingSelect.value = true
|
||||
queryListByParentId(queryParamsSelect.value).then((res) => {
|
||||
channelSelectList.value = res.rows
|
||||
totalSelect.value = res.total
|
||||
loadingSelect.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleSelectQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getChannelList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetSelectQuery() {
|
||||
proxy.resetForm("querySelectRef");
|
||||
handleSelectQuery();
|
||||
}
|
||||
|
||||
function handleSelectionSelectChange(selection) {
|
||||
selectionSelectList.value = selection;
|
||||
multipleSelect.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleSelect() {
|
||||
proxy.$modal.msgSuccess("选择成功");
|
||||
open.value = false;
|
||||
addChannelToCivilCode(groupDeviceId.value, businessGroup.value, selectionSelectList.value)
|
||||
}
|
||||
|
||||
function addChannelToCivilCode(groupDeviceId, businessGroup, data) {
|
||||
let channels = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
channels.push(data[i].gbId)
|
||||
}
|
||||
addChannelToGroup({
|
||||
parentId: groupDeviceId,
|
||||
businessGroup: businessGroup,
|
||||
channelIds: channels
|
||||
}).then(() => {
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryForTree({}).then((res) => {
|
||||
let data = [
|
||||
{
|
||||
name: "根资源组",
|
||||
children: []
|
||||
}
|
||||
]
|
||||
data[0].children = proxy.handleTree(res.data, "id")
|
||||
groupOptions.value = data
|
||||
})
|
||||
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
29
ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue
Normal file
29
ruoyi-ui-vue3/src/views/wvp/thoroughfare/index.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="行政区划" name="region">
|
||||
<Region/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="业务分组" name="group">
|
||||
<Group/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Thoroughfare">
|
||||
import Region from "./region.vue"
|
||||
import Group from "./group.vue"
|
||||
|
||||
const activeName = ref('region')
|
||||
|
||||
const handleClick = () => {
|
||||
nextTick(() => {
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
381
ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue
Normal file
381
ruoyi-ui-vue3/src/views/wvp/thoroughfare/region.vue
Normal file
@@ -0,0 +1,381 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-input v-model="regionName" placeholder="请输入区域名称" clearable prefix-icon="Search"
|
||||
style="margin-bottom: 20px"/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree :data="regionOptions"
|
||||
:props="{label: 'name', children: 'children'}"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="regionTreeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键字" prop="query">
|
||||
<el-input v-model="queryParams.query" placeholder="请输入关键字" clearable style="width: 240px"
|
||||
@keyup.enter="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="channelType">
|
||||
<el-select v-model="queryParams.channelType" placeholder="请选择类型" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="国标设备" :value="1"></el-option>
|
||||
<el-option label="推流设备" :value="2"></el-option>
|
||||
<el-option label="拉流代理" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="online">
|
||||
<el-select v-model="queryParams.online" placeholder="请选择在线状态" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="在线" value="true"></el-option>
|
||||
<el-option label="离线" value="false"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete">
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="channelList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column prop="gbName" label="名称" align="center"/>
|
||||
<el-table-column prop="gbDeviceId" label="编号" align="center"/>
|
||||
<el-table-column prop="gbManufacturer" label="厂家" align="center"/>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag effect="plain" v-if="scope.row.dataType === 1">国标设备</el-tag>
|
||||
<el-tag effect="plain" type="success" v-else-if="scope.row.dataType === 2">推流设备</el-tag>
|
||||
<el-tag effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog :title="title" v-model="open" width="1100px" append-to-body>
|
||||
<el-form :model="queryParamsSelect" ref="querySelectRef" :inline="true" v-show="showSearchSelect"
|
||||
label-width="68px">
|
||||
<el-form-item label="关键字" prop="query">
|
||||
<el-input v-model="queryParamsSelect.query" placeholder="请输入关键字" clearable style="width: 240px"
|
||||
@keyup.enter="handleSelectQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="channelType">
|
||||
<el-select v-model="queryParamsSelect.channelType" placeholder="请选择类型" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="国标设备" :value="1"></el-option>
|
||||
<el-option label="推流设备" :value="2"></el-option>
|
||||
<el-option label="拉流代理" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="online">
|
||||
<el-select v-model="queryParamsSelect.online" placeholder="请选择在线状态" style="width: 250px;"
|
||||
default-first-option>
|
||||
<el-option label="在线" value="true"></el-option>
|
||||
<el-option label="离线" value="false"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSelectQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetSelectQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary"
|
||||
plain
|
||||
icon="Select"
|
||||
:disabled="multipleSelect"
|
||||
@click="handleSelect">
|
||||
选择
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearchSelect" @queryTable="getChannelList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loadingSelect" :data="channelSelectList" @selection-change="handleSelectionSelectChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column prop="gbName" label="名称" align="center"/>
|
||||
<el-table-column prop="gbDeviceId" label="编号" align="center"/>
|
||||
<el-table-column prop="gbManufacturer" label="厂家" align="center"/>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag effect="plain" v-if="scope.row.dataType === 1">国标设备</el-tag>
|
||||
<el-tag effect="plain" type="success" v-else-if="scope.row.dataType === 2">推流设备</el-tag>
|
||||
<el-tag effect="plain" type="warning" v-else-if="scope.row.dataType === 3">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="totalSelect > 0"
|
||||
:total="totalSelect"
|
||||
v-model:page="queryParamsSelect.pageNum"
|
||||
v-model:limit="queryParamsSelect.pageSize"
|
||||
@pagination="getChannelList"
|
||||
/>
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Region">
|
||||
import {queryForTree} from "../../../api/wvp/region.js";
|
||||
import {
|
||||
addChannelToRegion,
|
||||
deleteChannelToRegion,
|
||||
queryListByCivilCode,
|
||||
queryListByParentId
|
||||
} from "../../../api/wvp/channel.js";
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
|
||||
const regionName = ref('')
|
||||
const regionOptions = ref([]);
|
||||
const channelList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
const showSearch = ref(true);
|
||||
const regionDeviceId = ref('');
|
||||
const selectionList = ref([]);
|
||||
const multiple = ref(true);
|
||||
const open = ref(false);
|
||||
const title = ref("");
|
||||
const dataType = ref('civilCode');
|
||||
|
||||
const channelSelectList = ref([]);
|
||||
const loadingSelect = ref(true);
|
||||
const totalSelect = ref(0);
|
||||
const showSearchSelect = ref(true);
|
||||
const multipleSelect = ref(true);
|
||||
const selectionSelectList = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
query: undefined,
|
||||
online: undefined,
|
||||
channelType: undefined,
|
||||
civilCode: ' ',
|
||||
},
|
||||
rules: {},
|
||||
|
||||
queryParamsSelect: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
query: undefined,
|
||||
online: undefined,
|
||||
channelType: undefined,
|
||||
civilCode: undefined,
|
||||
}
|
||||
});
|
||||
|
||||
const {queryParams, form, rules, queryParamsSelect} = toRefs(data);
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
queryListByCivilCode(queryParams.value).then((res) => {
|
||||
channelList.value = res.rows
|
||||
total.value = res.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据名称筛选树 */
|
||||
watch(regionName, val => {
|
||||
proxy.$refs["regionTreeRef"].filter(val);
|
||||
});
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
selectionList.value = selection
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
let channels = []
|
||||
for (let i = 0; i < selectionList.value.length; i++) {
|
||||
channels.push(selectionList.value[i].gbId)
|
||||
}
|
||||
proxy.$modal.confirm('是否删除选择的数据?').then(function () {
|
||||
return deleteChannelToRegion({channelIds: channels});
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 节点单击事件 */
|
||||
function handleNodeClick(data) {
|
||||
if (data.deviceId) {
|
||||
queryParams.value.civilCode = data.deviceId;
|
||||
} else {
|
||||
queryParams.value.civilCode = ' ';
|
||||
}
|
||||
|
||||
regionDeviceId.value = queryParams.value.civilCode;
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (regionDeviceId.value === "" || regionDeviceId.value === ' ') {
|
||||
proxy.$modal.msgError("请选择左侧行政区划");
|
||||
return;
|
||||
}
|
||||
|
||||
title.value = "添加国标通道";
|
||||
open.value = true;
|
||||
|
||||
getChannelList()
|
||||
}
|
||||
|
||||
function getChannelList() {
|
||||
if (dataType.value === "civilCode") {
|
||||
loadingSelect.value = true
|
||||
queryListByCivilCode(queryParamsSelect.value).then((res) => {
|
||||
channelSelectList.value = res.rows
|
||||
totalSelect.value = res.total
|
||||
loadingSelect.value = false
|
||||
})
|
||||
} else {
|
||||
loadingSelect.value = true
|
||||
queryListByParentId(queryParamsSelect.value).then((res) => {
|
||||
channelSelectList.value = res.rows
|
||||
totalSelect.value = res.total
|
||||
loadingSelect.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleSelectQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getChannelList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetSelectQuery() {
|
||||
proxy.resetForm("querySelectRef");
|
||||
handleSelectQuery();
|
||||
}
|
||||
|
||||
function handleSelectionSelectChange(selection) {
|
||||
selectionSelectList.value = selection;
|
||||
multipleSelect.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleSelect() {
|
||||
proxy.$modal.msgSuccess("选择成功");
|
||||
open.value = false;
|
||||
addChannelToCivilCode(regionDeviceId.value, selectionSelectList.value)
|
||||
}
|
||||
|
||||
function addChannelToCivilCode(regionDeviceId, data) {
|
||||
let channels = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
channels.push(data[i].gbId)
|
||||
}
|
||||
addChannelToRegion({civilCode: regionDeviceId, channelIds: channels}).then(() => {
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryForTree({}).then((res) => {
|
||||
let data = [
|
||||
{
|
||||
name: "根资源组",
|
||||
children: []
|
||||
}
|
||||
]
|
||||
data[0].children = proxy.handleTree(res.data, "id")
|
||||
regionOptions.value = data
|
||||
})
|
||||
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -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<CommonGBChannel> 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<CommonGBChannel> 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<CommonGBChannel> 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<CommonGBChannel> 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")
|
||||
|
||||
@@ -41,9 +41,9 @@ public interface IGbChannelService {
|
||||
|
||||
void reset(int id);
|
||||
|
||||
PageInfo<CommonGBChannel> queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode);
|
||||
List<CommonGBChannel> queryListByCivilCode(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String civilCode);
|
||||
|
||||
PageInfo<CommonGBChannel> queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId);
|
||||
List<CommonGBChannel> queryListByParentId(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String groupDeviceId);
|
||||
|
||||
void removeCivilCode(List<Region> allChildren);
|
||||
|
||||
|
||||
@@ -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<CommonGBChannel> 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<CommonGBChannel> queryListByCivilCode(int page, int count, String query, Boolean online, Integer channelType, String civilCode) {
|
||||
PageHelper.startPage(page, count);
|
||||
public List<CommonGBChannel> queryListByCivilCode(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String civilCode) {
|
||||
if (query != null) {
|
||||
query = query.replaceAll("/", "//")
|
||||
.replaceAll("%", "/%")
|
||||
.replaceAll("_", "/_");
|
||||
}
|
||||
List<CommonGBChannel> all = commonGBChannelMapper.queryListByCivilCode(query, online, channelType, civilCode);
|
||||
return new PageInfo<>(all);
|
||||
return commonGBChannelMapper.queryListByCivilCode(query, online, channelType, civilCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<CommonGBChannel> queryListByParentId(int page, int count, String query, Boolean online, Integer channelType, String groupDeviceId) {
|
||||
PageHelper.startPage(page, count);
|
||||
public List<CommonGBChannel> queryListByParentId(int pageNum, int pageSize, String query, Boolean online, Integer channelType, String groupDeviceId) {
|
||||
if (query != null) {
|
||||
query = query.replaceAll("/", "//")
|
||||
.replaceAll("%", "/%")
|
||||
.replaceAll("_", "/_");
|
||||
}
|
||||
List<CommonGBChannel> 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<Region> 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<Group> groupList = new ArrayList<>();
|
||||
groupList.add(group);
|
||||
platformChannelService.checkGroupRemove(channelList, groupList);
|
||||
@@ -678,7 +673,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
List<CommonGBChannel> 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<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType);
|
||||
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType);
|
||||
return new PageInfo<>(all);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,14 +241,14 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryByIds")
|
||||
List<CommonGBChannel> queryByIds(Collection<Integer> ids);
|
||||
List<CommonGBChannel> queryByIds(@Param("ids") Collection<Integer> ids);
|
||||
|
||||
@Delete(value = {" <script>" +
|
||||
" delete from wvp_device_channel" +
|
||||
" where 1 = 1 and id in " +
|
||||
" <foreach collection='channelListInDb' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
"</script>"})
|
||||
void batchDelete(List<CommonGBChannel> channelListInDb);
|
||||
void batchDelete(@Param("channelListInDb") List<CommonGBChannel> channelListInDb);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCode")
|
||||
List<CommonGBChannel> queryListByCivilCode(@Param("query") String query, @Param("online") Boolean online,
|
||||
@@ -305,7 +305,7 @@ public interface CommonGBChannelMapper {
|
||||
" WHERE id in "+
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
int removeCivilCodeByChannels(List<CommonGBChannel> channelList);
|
||||
int removeCivilCodeByChannels(@Param("channelList") List<CommonGBChannel> channelList);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryByCivilCode")
|
||||
List<CommonGBChannel> queryByCivilCode(@Param("civilCode") String civilCode);
|
||||
@@ -329,7 +329,7 @@ public interface CommonGBChannelMapper {
|
||||
" WHERE id in "+
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
int removeParentIdByChannels(List<CommonGBChannel> channelList);
|
||||
int removeParentIdByChannels(@Param("channelList") List<CommonGBChannel> channelList);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryByBusinessGroup")
|
||||
List<CommonGBChannel> queryByBusinessGroup(@Param("businessGroup") String businessGroup);
|
||||
@@ -378,7 +378,7 @@ public interface CommonGBChannelMapper {
|
||||
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
|
||||
" </script>"})
|
||||
int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup,
|
||||
List<CommonGBChannel> channelList);
|
||||
@Param("channelList") List<CommonGBChannel> channelList);
|
||||
|
||||
@Update({"<script>" +
|
||||
"<foreach collection='commonGBChannels' item='item' separator=';'>" +
|
||||
|
||||
@@ -404,7 +404,7 @@ public interface PlatformChannelMapper {
|
||||
" pgc.device_channel_id IN" +
|
||||
"<foreach collection='ids' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
"</script> ")
|
||||
List<Platform> queryPlatFormListByChannelList(Collection<Integer> ids);
|
||||
List<Platform> queryPlatFormListByChannelList(@Param("ids") Collection<Integer> ids);
|
||||
|
||||
@Select("<script> " +
|
||||
" SELECT " +
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 44 KiB |
BIN
snap/34020000001400000001_34020000001320000001.jpg
Normal file
BIN
snap/34020000001400000001_34020000001320000001.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user