mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 14:07:50 +08:00
Compare commits
No commits in common. "83057d81d8b28b337b0b8bdf0f34aaaed075847a" and "2bdced8b9cf552852fa7a881ef3b98273b989fe9" have entirely different histories.
83057d81d8
...
2bdced8b9c
5
pom.xml
5
pom.xml
@ -406,11 +406,6 @@
|
||||
<version>1.18.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@ -219,11 +219,4 @@ public class UserSetting {
|
||||
*/
|
||||
private boolean useAliasForGroupSync = false;
|
||||
|
||||
/**
|
||||
* 对于识别为设备的国标设备的,是否默认开启位置订阅
|
||||
*/
|
||||
private boolean subscribeMobilePosition = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -150,15 +150,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
|
||||
// 重置 cseq 计数
|
||||
redisCatchStorage.resetAllCSEQ();
|
||||
// 处理设备状态
|
||||
dbStatusCheck();
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库状态检查, 每6小时检查一次
|
||||
*/
|
||||
@Scheduled(fixedDelay = 6, initialDelay = 6, timeUnit = TimeUnit.HOURS)
|
||||
public void dbStatusCheck(){
|
||||
// 处理设备状态
|
||||
Set<String> allDeviceIds = deviceStatusManager.getAll();
|
||||
if (!allDeviceIds.isEmpty()) {
|
||||
@ -219,7 +210,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void offlineByIds(List<Device> offlineDevices) {
|
||||
@ -328,14 +318,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
} catch (InvalidArgumentException | SipException | ParseException e) {
|
||||
log.error("[命令发送失败] 查询设备信息: {}", e.getMessage());
|
||||
}
|
||||
// 上线添加订阅
|
||||
if (userSetting.isSubscribeMobilePosition() && isDevice(device.getDeviceId())) {
|
||||
// 开启订阅
|
||||
device.setSubscribeCycleForMobilePosition(60);
|
||||
device.setMobilePositionSubmissionInterval(5);
|
||||
addMobilePositionSubscribe(device, null);
|
||||
}
|
||||
|
||||
sync(device);
|
||||
}else {
|
||||
device.setServerId(userSetting.getServerId());
|
||||
@ -364,13 +346,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
}
|
||||
if (device.getSubscribeCycleForMobilePosition() > 0 && !subscribeTaskRunner.containsKey(SubscribeTaskForMobilPosition.getKey(device))) {
|
||||
addMobilePositionSubscribe(device, null);
|
||||
}else{
|
||||
if (userSetting.isSubscribeMobilePosition() && isDevice(device.getDeviceId())) {
|
||||
// 开启订阅
|
||||
device.setSubscribeCycleForMobilePosition(60);
|
||||
device.setMobilePositionSubmissionInterval(5);
|
||||
addMobilePositionSubscribe(device, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (userSetting.getDeviceStatusNotify()) {
|
||||
@ -386,7 +361,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
sync(device);
|
||||
}
|
||||
}
|
||||
|
||||
// 设备状态任务添加
|
||||
long expiresTime = Math.min(device.getExpires(), device.getHeartBeatInterval() * device.getHeartBeatCount()) * 1000L;
|
||||
deviceStatusManager.add(device.getDeviceId(), expiresTime + System.currentTimeMillis());
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.genersoft.iot.vmp.gb28181.task.deviceStatus;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -12,6 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.lang.Thread;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@ -54,6 +56,7 @@ public class DeviceStatusManager {
|
||||
// 发送 Spring 异步事件
|
||||
eventPublisher.deviceOfflineEventPublish(expiredIds);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ public class NotifyRequestForMobilePositionProcessor extends SIPRequestProcessor
|
||||
continue;
|
||||
}
|
||||
|
||||
log.info("[收到移动位置订阅通知]:{}/{}->{}.{}, 时间: {}", mobilePosition.getDeviceId(), mobilePosition.getChannelDeviceId(),
|
||||
log.info("[收到移动位置订阅通知]:{}/{}->{}.{}, 时间: {}", mobilePosition.getDeviceId(), mobilePosition.getChannelId(),
|
||||
mobilePosition.getLongitude(), mobilePosition.getLatitude(), System.currentTimeMillis() - startTime);
|
||||
mobilePosition.setReportSource("Mobile Position");
|
||||
|
||||
|
||||
@ -69,7 +69,6 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
|
||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||
log.error("[命令发送失败] 心跳回复: {}", e.getMessage());
|
||||
}
|
||||
taskQueue.add(device);
|
||||
SIPRequest request = (SIPRequest) evt.getRequest();
|
||||
|
||||
RemoteAddressInfo remoteAddressInfo = SipUtils.getRemoteAddressFromRequest(request, userSetting.getSipUseSourceIpAsRemoteAddress());
|
||||
@ -81,7 +80,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
|
||||
device.setLocalIp(request.getLocalAddress().getHostAddress());
|
||||
}
|
||||
device.setKeepaliveTimeStamp(System.currentTimeMillis());
|
||||
|
||||
taskQueue.add(device);
|
||||
if (device.isOnLine()) {
|
||||
long expiresTime = Math.min(device.getExpires(), device.getHeartBeatInterval() * device.getHeartBeatCount()) * 1000L;
|
||||
deviceStatusManager.add(device.getDeviceId(), expiresTime + System.currentTimeMillis());
|
||||
|
||||
@ -174,7 +174,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
|
||||
} else {
|
||||
catalogDataCatch.setChannelSyncEnd(deviceId, finalSn, null);
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getKeepaliveTimeStatistics: function(deviceId) {
|
||||
this.$refs.timeStatistics.openDialog('心跳时间统计', 'device/getKeepaliveTimeStatistics', deviceId, 60)
|
||||
this.$refs.timeStatistics.openDialog('心跳时间统计', 'device/getKeepaliveTimeStatistics', deviceId, 10)
|
||||
},
|
||||
getRegisterTimeStatistics: function(deviceId) {
|
||||
this.$refs.timeStatistics.openDialog('注册时间统计', 'device/getRegisterTimeStatistics', deviceId, 10)
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
<el-table
|
||||
v-if="viewMode === 'table'"
|
||||
:data="tableData"
|
||||
:data="list"
|
||||
border
|
||||
stripe
|
||||
size="mini"
|
||||
@ -109,9 +109,6 @@ export default {
|
||||
rows: this.list
|
||||
}
|
||||
},
|
||||
tableData() {
|
||||
return this.list.slice().reverse();
|
||||
},
|
||||
timeDiffDelta() {
|
||||
if (!this.list.length) return 0
|
||||
const nums = this.list
|
||||
|
||||
Loading…
Reference in New Issue
Block a user