临时提交
parent
ae0235c0f8
commit
5169eb66a3
|
@ -10,7 +10,7 @@ import lombok.Data;
|
|||
@Schema(description = "业务分组树")
|
||||
public class GroupTree extends Group{
|
||||
|
||||
@Schema(description = "树节点Id")
|
||||
@Schema(description = "是否有子节点")
|
||||
private String treeId;
|
||||
|
||||
@Schema(description = "是否有子节点")
|
||||
|
|
|
@ -343,7 +343,7 @@ public interface CommonGBChannelMapper {
|
|||
|
||||
@Select("<script>" +
|
||||
" select " +
|
||||
" concat('channel_', id) as tree_id," +
|
||||
" id," +
|
||||
" coalesce(gb_device_id, device_id) as device_id," +
|
||||
" coalesce(gb_name, name) as name, " +
|
||||
" coalesce(gb_parent_id, parent_id) as parent_device_id, " +
|
||||
|
|
|
@ -62,8 +62,7 @@ public interface GroupMapper {
|
|||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" *," +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" * , " +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
|
@ -76,8 +75,7 @@ public interface GroupMapper {
|
|||
|
||||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" *, " +
|
||||
" * , " +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
|
@ -90,7 +88,6 @@ public interface GroupMapper {
|
|||
@Select(" <script>" +
|
||||
" SELECT " +
|
||||
" *," +
|
||||
" concat('group_', id) as tree_id," +
|
||||
" 0 as type," +
|
||||
" false as is_leaf" +
|
||||
" from wvp_common_group " +
|
||||
|
@ -119,7 +116,7 @@ public interface GroupMapper {
|
|||
|
||||
@Update(" UPDATE wvp_common_group " +
|
||||
" SET parent_device_id=#{group.deviceId}, business_group = #{group.businessGroup}" +
|
||||
" WHERE parentId = #{parentId}")
|
||||
" WHERE parent_id = #{parentId}")
|
||||
int updateChild(@Param("parentId") Integer parentId, Group group);
|
||||
|
||||
@Select(" <script>" +
|
||||
|
|
|
@ -140,6 +140,24 @@ public class ChannelProvider {
|
|||
}
|
||||
|
||||
public String queryByGbDeviceIds(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(getBaseSelectSql());
|
||||
sqlBuild.append("where device_db_id in ( ");
|
||||
|
||||
Collection<Integer> ids = (Collection<Integer>)params.get("deviceIds");
|
||||
boolean first = true;
|
||||
for (Integer id : ids) {
|
||||
if (!first) {
|
||||
sqlBuild.append(",");
|
||||
}
|
||||
sqlBuild.append(id);
|
||||
first = false;
|
||||
}
|
||||
sqlBuild.append(" )");
|
||||
return sqlBuild.toString() ;
|
||||
}
|
||||
|
||||
public String queryByDeviceIds(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(getBaseSelectSql());
|
||||
sqlBuild.append("where id in ( ");
|
||||
|
|
|
@ -618,7 +618,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
|||
|
||||
@Override
|
||||
public void deleteChannelToGroup(String parentId, String businessGroup, List<Integer> channelIds) {
|
||||
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByGbDeviceIds(channelIds);
|
||||
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByIds(channelIds);
|
||||
if (channelList.isEmpty()) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "所有通道Id不存在");
|
||||
}
|
||||
|
|
|
@ -165,9 +165,9 @@ public class GroupServiceImpl implements IGroupService {
|
|||
}
|
||||
// 查询含有的通道
|
||||
Group parentGroup = groupManager.queryOne(parentId);
|
||||
if (parentGroup != null && !parentGroup.getDeviceId().equals(parentGroup.getBusinessGroup())) {
|
||||
if (parentGroup != null ) {
|
||||
List<GroupTree> groupTreesForChannel = commonGBChannelMapper.queryForGroupTreeByParentId(query, parentGroup.getDeviceId());
|
||||
if (ObjectUtils.isEmpty(groupTreesForChannel)) {
|
||||
if (!ObjectUtils.isEmpty(groupTreesForChannel)) {
|
||||
groupTrees.addAll(groupTreesForChannel);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<vue-easy-tree
|
||||
class="flow-tree"
|
||||
ref="veTree"
|
||||
node-key="id"
|
||||
node-key="deviceId"
|
||||
height="78vh"
|
||||
lazy
|
||||
style="padding: 2rem 0 2rem 0.5rem"
|
||||
|
@ -55,7 +55,6 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
props: {
|
||||
id: "treeId",
|
||||
label: "name",
|
||||
},
|
||||
showCode: false,
|
||||
|
@ -74,7 +73,7 @@ export default {
|
|||
loadNode: function (node, resolve) {
|
||||
if (node.level === 0) {
|
||||
resolve([{
|
||||
id: "",
|
||||
deviceId: "",
|
||||
name: "根资源组",
|
||||
isLeaf: false,
|
||||
type: 0
|
||||
|
@ -255,7 +254,7 @@ export default {
|
|||
method: 'post',
|
||||
url: `/api/common/channel/group/device/add`,
|
||||
data: {
|
||||
parentId: node.data.id,
|
||||
parentId: node.data.deviceId,
|
||||
businessGroup: node.data.businessGroup,
|
||||
deviceIds: deviceIds,
|
||||
}
|
||||
|
@ -322,8 +321,9 @@ export default {
|
|||
id: 0,
|
||||
name: "",
|
||||
deviceId: "",
|
||||
parentDeviceId: node.level > 2 ? node.data.id:"",
|
||||
businessGroup: node.level > 2 ? node.data.businessGroup: node.data.id,
|
||||
parentDeviceId: node.level > 2 ? node.data.deviceId:"",
|
||||
parentId: node.data.id,
|
||||
businessGroup: node.level > 2 ? node.data.businessGroup: node.data.deviceId,
|
||||
},form => {
|
||||
node.loaded = false
|
||||
node.expand();
|
||||
|
@ -331,13 +331,7 @@ export default {
|
|||
},
|
||||
editGroup: function (id, node) {
|
||||
console.log(node)
|
||||
this.$refs.groupEdit.openDialog({
|
||||
id: node.data.dbId,
|
||||
name: node.data.label,
|
||||
deviceId: node.data.id,
|
||||
parentDeviceId: node.data.parentDeviceId,
|
||||
businessGroup: node.data.businessGroup,
|
||||
},form => {
|
||||
this.$refs.groupEdit.openDialog(node.data,form => {
|
||||
node.parent.loaded = false
|
||||
node.parent.expand();
|
||||
}, id);
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
<el-table-column label="类型" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
<el-table-column label="类型" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||
<el-tag size="medium" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
Loading…
Reference in New Issue