修复分组更新BUG
parent
2f9bd859f4
commit
6fb820e49c
|
@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.service;
|
||||||
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -49,4 +50,6 @@ public interface ICommonGbChannelService {
|
||||||
PageInfo<CommonGbChannel> queryChannelListInGroup(String groupDeviceId, String query, int page, int count);
|
PageInfo<CommonGbChannel> queryChannelListInGroup(String groupDeviceId, String query, int page, int count);
|
||||||
|
|
||||||
PageInfo<CommonGbChannel> queryChannelList(String query, int page, int count);
|
PageInfo<CommonGbChannel> queryChannelList(String query, int page, int count);
|
||||||
|
|
||||||
|
String getRandomCode(Gb28181CodeType type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,4 +621,10 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
|
||||||
List<CommonGbChannel> all = commonGbChannelMapper.query(query);
|
List<CommonGbChannel> all = commonGbChannelMapper.query(query);
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRandomCode(Gb28181CodeType type) {
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.service.IGroupService;
|
||||||
import com.genersoft.iot.vmp.service.bean.Group;
|
import com.genersoft.iot.vmp.service.bean.Group;
|
||||||
import com.genersoft.iot.vmp.storager.dao.GroupMapper;
|
import com.genersoft.iot.vmp.storager.dao.GroupMapper;
|
||||||
import com.genersoft.iot.vmp.storager.dao.CommonGbChannelMapper;
|
import com.genersoft.iot.vmp.storager.dao.CommonGbChannelMapper;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
|
@ -67,6 +68,8 @@ public class GroupServiceImpl implements IGroupService {
|
||||||
public boolean add(Group group) {
|
public boolean add(Group group) {
|
||||||
assert group.getCommonGroupDeviceId() != null;
|
assert group.getCommonGroupDeviceId() != null;
|
||||||
assert group.getCommonGroupDeviceId() != null;
|
assert group.getCommonGroupDeviceId() != null;
|
||||||
|
group.setCommonGroupCreateTime(DateUtil.getNow());
|
||||||
|
group.setCommonGroupUpdateTime(DateUtil.getNow());
|
||||||
return groupMapper.add(group) > 0;
|
return groupMapper.add(group) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +97,9 @@ public class GroupServiceImpl implements IGroupService {
|
||||||
groupMapper.updateParentDeviceId(groupInDb.getCommonGroupDeviceId(), group.getCommonGroupDeviceId());
|
groupMapper.updateParentDeviceId(groupInDb.getCommonGroupDeviceId(), group.getCommonGroupDeviceId());
|
||||||
// 修改所有通用通道中分组编号
|
// 修改所有通用通道中分组编号
|
||||||
commonGbChannelDao.updateChanelGroup(groupInDb.getCommonGroupDeviceId(), group.getCommonGroupDeviceId());
|
commonGbChannelDao.updateChanelGroup(groupInDb.getCommonGroupDeviceId(), group.getCommonGroupDeviceId());
|
||||||
}else if (groupInDb.getCommonGroupParentId().equals(group.getCommonGroupParentId())
|
}else if (
|
||||||
|
((groupInDb.getCommonGroupParentId() == null && group.getCommonGroupParentId() == null)
|
||||||
|
|| groupInDb.getCommonGroupParentId().equals(group.getCommonGroupParentId()))
|
||||||
&& groupInDb.getCommonGroupName().equals(group.getCommonGroupName())) {
|
&& groupInDb.getCommonGroupName().equals(group.getCommonGroupName())) {
|
||||||
// 数据无变化
|
// 数据无变化
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -53,15 +53,15 @@ public interface GroupMapper {
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
"UPDATE wvp_common_group " +
|
"UPDATE wvp_common_group " +
|
||||||
"SET common_group_update_time=#{commonGroupUpdateTime}" +
|
"SET common_group_update_time=#{group.commonGroupUpdateTime}" +
|
||||||
"<if test='commonGroupName != null'>, common_group_name=#{commonGroupName}</if>" +
|
"<if test='group.commonGroupName != null'>, common_group_name=#{group.commonGroupName}</if>" +
|
||||||
"<if test='commonGroupDeviceId != null'>, common_group_device_id=#{commonGroupDeviceId}</if>" +
|
"<if test='group.commonGroupDeviceId != null'>, common_group_device_id=#{group.commonGroupDeviceId}</if>" +
|
||||||
"<if test='commonGroupParentId != null'>, common_group_parent_id=#{commonGroupParentId}</if>" +
|
"<if test='group.commonGroupParentId != null'>, common_group_parent_id=#{group.commonGroupParentId}</if>" +
|
||||||
"<if test='commonGroupTopId != null'>, common_group_top_id=#{commonGroupTopId}</if>" +
|
"<if test='group.commonGroupTopId != null'>, common_group_top_id=#{group.commonGroupTopId}</if>" +
|
||||||
"<if test='commonGroupUpdateTime != null'>, common_group_update_time=#{commonGroupUpdateTime}</if>" +
|
"<if test='group.commonGroupUpdateTime != null'>, common_group_update_time=#{group.commonGroupUpdateTime}</if>" +
|
||||||
"WHERE common_group_id=#{commonGroupId}" +
|
"WHERE common_group_id=#{group.commonGroupId}" +
|
||||||
" </script>"})
|
" </script>"})
|
||||||
int update(@Param("Group") Group Group);
|
int update(@Param("group") Group group);
|
||||||
|
|
||||||
|
|
||||||
@Insert(value = "<script>" +
|
@Insert(value = "<script>" +
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.genersoft.iot.vmp.vmanager.channel;
|
package com.genersoft.iot.vmp.vmanager.channel;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
|
||||||
import com.genersoft.iot.vmp.service.ICommonGbChannelService;
|
import com.genersoft.iot.vmp.service.ICommonGbChannelService;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
@ -103,4 +104,20 @@ public class CommonChannelController {
|
||||||
commonGbChannelService.update(commonGbChannel);
|
commonGbChannelService.update(commonGbChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取一个随机的可用国标编号")
|
||||||
|
@Parameter(name = "type", description = "类型: " +
|
||||||
|
"CIVIL_CODE_PROVINCE 省级编号 " +
|
||||||
|
"CIVIL_CODE_CIT 市级编号" +
|
||||||
|
"CIVIL_CODE_GRASS_ROOTS 区级编号" +
|
||||||
|
"CIVIL_CODE_GRASS_ROOTS 基层接入单位编号 " +
|
||||||
|
"BUSINESS_GROUP 业务分组 " +
|
||||||
|
"VIRTUAL_ORGANIZATION 虚拟组织 ", required = true)
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/code/random")
|
||||||
|
public String getRandomCode(
|
||||||
|
@RequestParam(required = true) Gb28181CodeType type
|
||||||
|
){
|
||||||
|
return commonGbChannelService.getRandomCode(type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ user-settings:
|
||||||
# 国标是否录制
|
# 国标是否录制
|
||||||
record-sip: true
|
record-sip: true
|
||||||
# 是否将日志存储进数据库
|
# 是否将日志存储进数据库
|
||||||
logInDatabase: true
|
log-in-database: true
|
||||||
# 使用推流状态作为推流通道状态
|
# 使用推流状态作为推流通道状态
|
||||||
use-pushing-as-status: true
|
use-pushing-as-status: true
|
||||||
# 使用来源请求ip作为streamIp,当且仅当你只有zlm节点它与wvp在一起的情况下开启
|
# 使用来源请求ip作为streamIp,当且仅当你只有zlm节点它与wvp在一起的情况下开启
|
||||||
|
|
Loading…
Reference in New Issue