修复NOTIFY消息通道信息的更新
parent
43a2344ad0
commit
f38c86092d
|
@ -501,6 +501,58 @@ public interface DeviceChannelMapper {
|
||||||
"</script>"})
|
"</script>"})
|
||||||
int batchUpdate(List<DeviceChannel> updateChannels);
|
int batchUpdate(List<DeviceChannel> updateChannels);
|
||||||
|
|
||||||
|
|
||||||
|
@Update({"<script>" +
|
||||||
|
"<foreach collection='updateChannels' item='item' separator=';'>" +
|
||||||
|
" UPDATE" +
|
||||||
|
" wvp_device_channel" +
|
||||||
|
" SET update_time=#{item.updateTime}" +
|
||||||
|
", device_id=#{item.deviceId}" +
|
||||||
|
", device_db_id=#{item.deviceDbId}" +
|
||||||
|
", name=#{item.name}" +
|
||||||
|
", manufacturer=#{item.manufacturer}" +
|
||||||
|
", model=#{item.model}" +
|
||||||
|
", owner=#{item.owner}" +
|
||||||
|
", civil_code=#{item.civilCode}" +
|
||||||
|
", block=#{item.block}" +
|
||||||
|
", address=#{item.address}" +
|
||||||
|
", parental=#{item.parental}" +
|
||||||
|
", parent_id=#{item.parentId}" +
|
||||||
|
", safety_way=#{item.safetyWay}" +
|
||||||
|
", register_way=#{item.registerWay}" +
|
||||||
|
", cert_num=#{item.certNum}" +
|
||||||
|
", certifiable=#{item.certifiable}" +
|
||||||
|
", err_code=#{item.errCode}" +
|
||||||
|
", end_time=#{item.endTime}" +
|
||||||
|
", secrecy=#{item.secrecy}" +
|
||||||
|
", ip_address=#{item.ipAddress}" +
|
||||||
|
", port=#{item.port}" +
|
||||||
|
", password=#{item.password}" +
|
||||||
|
", status=#{item.status}" +
|
||||||
|
", longitude=#{item.longitude}" +
|
||||||
|
", latitude=#{item.latitude}" +
|
||||||
|
", ptz_type=#{item.ptzType}" +
|
||||||
|
", position_type=#{item.positionType}" +
|
||||||
|
", room_type=#{item.roomType}" +
|
||||||
|
", use_type=#{item.useType}" +
|
||||||
|
", supply_light_type=#{item.supplyLightType}" +
|
||||||
|
", direction_type=#{item.directionType}" +
|
||||||
|
", resolution=#{item.resolution}" +
|
||||||
|
", business_group_id=#{item.businessGroupId}" +
|
||||||
|
", download_speed=#{item.downloadSpeed}" +
|
||||||
|
", svc_space_support_mod=#{item.svcSpaceSupportMod}" +
|
||||||
|
", svc_time_support_mode=#{item.svcTimeSupportMode}" +
|
||||||
|
", sub_count=#{item.subCount}" +
|
||||||
|
", stream_id=#{item.streamId}" +
|
||||||
|
", has_audio=#{item.hasAudio}" +
|
||||||
|
", gps_time=#{item.gpsTime}" +
|
||||||
|
", stream_identification=#{item.streamIdentification}" +
|
||||||
|
", channel_type=#{item.channelType}" +
|
||||||
|
" WHERE device_id=#{item.deviceId}" +
|
||||||
|
"</foreach>" +
|
||||||
|
"</script>"})
|
||||||
|
int batchUpdateForNotify(List<DeviceChannel> updateChannels);
|
||||||
|
|
||||||
@Update(" update wvp_device_channel" +
|
@Update(" update wvp_device_channel" +
|
||||||
" set sub_count = (select *" +
|
" set sub_count = (select *" +
|
||||||
" from (select count(0)" +
|
" from (select count(0)" +
|
||||||
|
@ -626,6 +678,13 @@ public interface DeviceChannelMapper {
|
||||||
"</script>"})
|
"</script>"})
|
||||||
int batchDel(List<DeviceChannel> deleteChannelList);
|
int batchDel(List<DeviceChannel> deleteChannelList);
|
||||||
|
|
||||||
|
@Delete({"<script>" +
|
||||||
|
"<foreach collection='deleteChannelList' item='item' separator=';'>" +
|
||||||
|
"DELETE FROM wvp_device_channel WHERE device_id=#{item.deviceId}" +
|
||||||
|
"</foreach>" +
|
||||||
|
"</script>"})
|
||||||
|
int batchDelForNotify(List<DeviceChannel> deleteChannelList);
|
||||||
|
|
||||||
@Update({"<script>" +
|
@Update({"<script>" +
|
||||||
"<foreach collection='channels' item='item' separator=';'>" +
|
"<foreach collection='channels' item='item' separator=';'>" +
|
||||||
"UPDATE wvp_device_channel SET status='ON' WHERE device_id=#{item.deviceId}" +
|
"UPDATE wvp_device_channel SET status='ON' WHERE device_id=#{item.deviceId}" +
|
||||||
|
|
|
@ -45,7 +45,7 @@ public interface IDeviceChannelService {
|
||||||
* 批量删除通道
|
* 批量删除通道
|
||||||
* @param deleteChannelList 待删除的通道列表
|
* @param deleteChannelList 待删除的通道列表
|
||||||
*/
|
*/
|
||||||
int deleteChannels(List<DeviceChannel> deleteChannelList);
|
int deleteChannelsForNotify(List<DeviceChannel> deleteChannelList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量上线
|
* 批量上线
|
||||||
|
@ -67,7 +67,7 @@ public interface IDeviceChannelService {
|
||||||
/**
|
/**
|
||||||
* 直接批量更新通道
|
* 直接批量更新通道
|
||||||
*/
|
*/
|
||||||
void batchUpdateChannel(List<DeviceChannel> channels);
|
void batchUpdateChannelForNotify(List<DeviceChannel> channels);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直接批量添加
|
* 直接批量添加
|
||||||
|
|
|
@ -193,8 +193,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteChannels(List<DeviceChannel> deleteChannelList) {
|
public int deleteChannelsForNotify(List<DeviceChannel> deleteChannelList) {
|
||||||
return channelMapper.batchDel(deleteChannelList);
|
return channelMapper.batchDelForNotify(deleteChannelList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -242,7 +242,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void batchUpdateChannel(List<DeviceChannel> channels) {
|
public synchronized void batchUpdateChannelForNotify(List<DeviceChannel> channels) {
|
||||||
String now = DateUtil.getNow();
|
String now = DateUtil.getNow();
|
||||||
for (DeviceChannel channel : channels) {
|
for (DeviceChannel channel : channels) {
|
||||||
channel.setUpdateTime(now);
|
channel.setUpdateTime(now);
|
||||||
|
@ -255,10 +255,10 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
if (i + limitCount > channels.size()) {
|
if (i + limitCount > channels.size()) {
|
||||||
toIndex = channels.size();
|
toIndex = channels.size();
|
||||||
}
|
}
|
||||||
channelMapper.batchUpdate(channels.subList(i, toIndex));
|
channelMapper.batchUpdateForNotify(channels.subList(i, toIndex));
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
channelMapper.batchUpdate(channels);
|
channelMapper.batchUpdateForNotify(channels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
if (!updateChannelMap.values().isEmpty()) {
|
if (!updateChannelMap.values().isEmpty()) {
|
||||||
log.info("[存储收到的更新通道], 数量: {}", updateChannelMap.size());
|
log.info("[存储收到的更新通道], 数量: {}", updateChannelMap.size());
|
||||||
ArrayList<DeviceChannel> deviceChannels = new ArrayList<>(updateChannelMap.values());
|
ArrayList<DeviceChannel> deviceChannels = new ArrayList<>(updateChannelMap.values());
|
||||||
deviceChannelService.batchUpdateChannel(deviceChannels);
|
deviceChannelService.batchUpdateChannelForNotify(deviceChannels);
|
||||||
updateChannelMap.clear();
|
updateChannelMap.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
|
|
||||||
private void executeSaveForDelete(){
|
private void executeSaveForDelete(){
|
||||||
if (!deleteChannelList.isEmpty()) {
|
if (!deleteChannelList.isEmpty()) {
|
||||||
deviceChannelService.deleteChannels(deleteChannelList);
|
deviceChannelService.deleteChannelsForNotify(deleteChannelList);
|
||||||
deleteChannelList.clear();
|
deleteChannelList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue