Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit be501126
authored
Sep 13, 2024
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设备的状态-“行驶中”判断条件改为 GPS上报时间在6分钟内并且有速度
1 parent
dd580bf5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/utils/DeviceUtils.java
src/main/java/cn/com/glsx/devicemonitor/modules/utils/DeviceUtils.java
View file @
be50112
...
@@ -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
)
{
//行驶状态
//行驶状态
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment