修复移动位置位置订阅上报间隔为0的bug

2.7.1-多对一语音对讲
648540858 2024-06-11 10:08:13 +08:00
parent 619a86e0ed
commit f8ef14bfea
4 changed files with 16 additions and 7 deletions

View File

@ -4,7 +4,6 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
import com.genersoft.iot.vmp.service.IPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -62,8 +61,15 @@ public class SubscribeHolder {
mobilePositionMap.put(platformId, subscribeInfo);
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId;
// 添加任务处理GPS定时推送
int cycleForCatalog;
if (subscribeInfo.getGpsInterval() <= 0) {
cycleForCatalog = 5;
}else {
cycleForCatalog = subscribeInfo.getGpsInterval();
}
dynamicTask.startCron(key, gpsTask,
subscribeInfo.getGpsInterval() * 1000);
cycleForCatalog * 1000);
String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId;
if (subscribeInfo.getExpires() > 0) {
// 添加任务处理订阅过期

View File

@ -7,10 +7,6 @@ import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
import com.genersoft.iot.vmp.gb28181.SipLayer;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
@ -44,7 +40,6 @@ import javax.sip.SipFactory;
import javax.sip.header.CallIdHeader;
import javax.sip.message.Request;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
/**
@ -1249,6 +1244,8 @@ public class SIPCommander implements ISIPCommander {
subscribePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
if (device.getSubscribeCycleForMobilePosition() > 0) {
subscribePostitionXml.append("<Interval>" + device.getMobilePositionSubmissionInterval() + "</Interval>\r\n");
}else {
subscribePostitionXml.append("<Interval>5</Interval>\r\n");
}
subscribePostitionXml.append("</Query>\r\n");

View File

@ -322,6 +322,9 @@ public class DeviceQuery {
public void updateDevice(Device device){
if (device != null && device.getDeviceId() != null) {
if (device.getSubscribeCycleForMobilePosition() > 0 && device.getMobilePositionSubmissionInterval() <= 0) {
device.setMobilePositionSubmissionInterval(5);
}
deviceService.updateCustomDevice(device);
}
}

View File

@ -128,6 +128,9 @@ export default {
this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog||0
this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition||0
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
if (this.form.mobilePositionSubmissionInterval === 0) {
this.form.mobilePositionSubmissionInterval = 5
}
this.$axios({
method: 'post',
url:`/api/device/query/device/${this.isEdit?'update':'add'}/`,