Commit 304c9acc by 谢海旭

Merge branch 'develop' into 'master'

设备的状态-“行驶中”判断条件改为 GPS上报时间在6分钟内并且有速度

See merge request !2
2 parents dd580bf5 be501126
...@@ -86,13 +86,14 @@ public class DeviceUtils { ...@@ -86,13 +86,14 @@ public class DeviceUtils {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
// 6分钟内算在线 // 6分钟内算在线
long drivingTime = 6 * 60 * 1000; long drivingTime = 6 * 60 * 1000;
if (now - trackTime > drivingTime) { Date lastGpsTime = deviceLogin.getLastGpsTime();
//大于6分钟 有源在线 if ((now - trackTime > drivingTime) || Objects.isNull(lastGpsTime) || (now - lastGpsTime.getTime() > drivingTime)) {
//大于6分钟 有源在线 或者 GPS无上点
deviceStatus.setStatus(DeviceStatusEnum.ONLINE.getCode()); deviceStatus.setStatus(DeviceStatusEnum.ONLINE.getCode());
return; return;
} }
//否则 在6分钟内并且有速度 则为行驶中 //否则 GPS上报时间在6分钟内并且有速度 则为行驶中
// 取消速度限制,速度的判定交给大数据计算 // 取消速度限制,速度的判定交给大数据计算
if (deviceLogin.getStayStatus() != null && deviceLogin.getStayStatus() == 2) { if (deviceLogin.getStayStatus() != null && deviceLogin.getStayStatus() == 2) {
//行驶状态 //行驶状态
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!