临时提交

This commit is contained in:
648540858
2024-08-24 00:18:54 +08:00
parent d2654660cb
commit 5a259aaa63
10 changed files with 122 additions and 191 deletions

View File

@@ -262,7 +262,10 @@ public interface CommonGBChannelMapper {
@Select("<script>" +
" select " +
" *, " +
" 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, " +
" 1 as type, " +
" true as is_leaf " +
" from wvp_device_channel " +

View File

@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Group;
import com.genersoft.iot.vmp.gb28181.bean.Region;
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
import org.apache.ibatis.annotations.*;
@@ -104,4 +105,14 @@ public interface RegionMapper {
" </script>")
List<CommonGBChannel> queryByPlatform(@Param("platformId") Integer platformId);
@Update(" <script>" +
" update wvp_common_region w1 " +
" inner join (select * from wvp_common_region ) w2 on w1.parent_device_id = w2.device_id " +
" set w1.parent_id = w2.id" +
" where w1.id in " +
" <foreach collection='regionListForAdd' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
" </script>")
void updateParentId(List<Region> regionListForAdd);
}

View File

@@ -511,10 +511,10 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
if (i + limitCount > addChannels.size()) {
toIndex = addChannels.size();
}
result = result || channelMapper.batchAdd(addChannels.subList(i, toIndex)) < 0;
result = result || channelMapper.batchAdd(addChannels.subList(i, toIndex)) > 0;
}
}else {
result = result || channelMapper.batchAdd(addChannels) < 0;
result = channelMapper.batchAdd(addChannels) > 0;
}
}
if (!result && !updateChannels.isEmpty()) {
@@ -524,14 +524,13 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
if (i + limitCount > updateChannels.size()) {
toIndex = updateChannels.size();
}
result = result || channelMapper.batchUpdate(updateChannels.subList(i, toIndex)) < 0;
result = result || channelMapper.batchUpdate(updateChannels.subList(i, toIndex)) > 0;
}
}else {
result = result || channelMapper.batchUpdate(updateChannels) < 0;
result = channelMapper.batchUpdate(updateChannels) > 0;
}
}
if (!result && !deleteChannels.isEmpty()) {
System.out.println("删除: " + deleteChannels.size());
if (deleteChannels.size() > limitCount) {
for (int i = 0; i < deleteChannels.size(); i += limitCount) {
int toIndex = i + limitCount;
@@ -541,11 +540,10 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
result = result || channelMapper.batchDel(deleteChannels.subList(i, toIndex)) < 0;
}
}else {
result = result || channelMapper.batchDel(deleteChannels) < 0;
result = channelMapper.batchDel(deleteChannels) < 0;
}
}
return true;
return result;
}

View File

@@ -640,7 +640,6 @@ public class PlatformServiceImpl implements IPlatformService {
inviteInfo.setStatus(InviteSessionStatus.ok);
ResponseEvent responseEvent = (ResponseEvent) eventResult.event;
String contentString = new String(responseEvent.getResponse().getRawContent());
System.out.println(contentString);
String ssrcInResponse = SipUtils.getSsrcFromSdp(contentString);
// 兼容回复的消息中缺少ssrc(y字段)的情况
if (ssrcInResponse == null) {

View File

@@ -175,6 +175,7 @@ public class RegionServiceImpl implements IRegionService {
}
@Override
@Transactional
public boolean batchAdd(List<Region> regionList) {
if (regionList== null || regionList.isEmpty()) {
return false;
@@ -190,7 +191,12 @@ public class RegionServiceImpl implements IRegionService {
regionMapForVerification.remove(region.getDeviceId());
}
}
regionMapper.batchAdd(new ArrayList<>(regionMapForVerification.values()));
return false;
if (!regionMapForVerification.isEmpty()) {
List<Region> regions = new ArrayList<>(regionMapForVerification.values());
regionMapper.batchAdd(regions);
regionMapper.updateParentId(regions);
}
return true;
}
}

View File

@@ -74,7 +74,6 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
@Transactional
public void handForDevice(RequestEvent evt, Device device, Element element) {
taskQueue.offer(new HandlerCatchData(evt, device, element));
System.out.println(evt.getRequest());
// 回复200 OK
try {
responseAck((SIPRequest) evt.getRequest(), Response.OK);
@@ -187,7 +186,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
List<Region> regionList = catalogDataCatch.getRegionList(device.getDeviceId());
if ( regionList!= null && !regionList.isEmpty()) {
result &= regionService.batchAdd(catalogDataCatch.getRegionList(device.getDeviceId()));
result &= regionService.batchAdd(regionList);
}
List<Group> groupList = catalogDataCatch.getGroupList(device.getDeviceId());

View File

@@ -227,7 +227,6 @@ public class ZLMServerFactory {
if (sendRtpItem.getLocalPort() != 0) {
if (sendRtpItem.isTcpActive()) {
startSendRtpStreamResult = startSendRtpPassive(mediaInfo, param);
System.out.println(JSON.toJSON(param));
}else {
param.put("is_udp", is_Udp);
param.put("dst_url", sendRtpItem.getIp());