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 eae7fccf
authored
Jan 02, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设备监控-新增设备有效位置校验
1 parent
ca0006b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
View file @
eae7fcc
...
@@ -180,10 +180,10 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
...
@@ -180,10 +180,10 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
if
(
locationRequest
.
getVerifyTimeFlag
())
{
if
(
locationRequest
.
getVerifyTimeFlag
())
{
//GPS有效定位验证
//GPS有效定位验证
boolean
gpsLocationVerify
=
isGpsBsDataValid
(
locationRequest
.
getGpsValidMinute
(),
gpsLocation
);
boolean
gpsLocationVerify
=
isGpsBsDataValid
(
locationRequest
.
getGpsValidMinute
(),
sn
,
gpsLocation
);
//基站有效定位验证
//基站有效定位验证
boolean
bsLocationVerify
=
isGpsBsDataValid
(
locationRequest
.
getBsValidMinute
(),
bsLocation
);
boolean
bsLocationVerify
=
isGpsBsDataValid
(
locationRequest
.
getBsValidMinute
(),
sn
,
bsLocation
);
gpsBsData
.
setGpsVerifyResult
(
gpsLocationVerify
);
gpsBsData
.
setGpsVerifyResult
(
gpsLocationVerify
);
gpsBsData
.
setBsVerifyResult
(
bsLocationVerify
);
gpsBsData
.
setBsVerifyResult
(
bsLocationVerify
);
...
@@ -198,7 +198,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
...
@@ -198,7 +198,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
}
}
}
}
//验证
占
没用到
//验证
暂
没用到
if
(
locationRequest
.
getVerifyDistanceFlag
())
{
if
(
locationRequest
.
getVerifyDistanceFlag
())
{
//子母分离验证
//子母分离验证
boolean
distanceVerify
=
isDistanceValid
(
locationRequest
,
gpsBsDataMap
);
boolean
distanceVerify
=
isDistanceValid
(
locationRequest
,
gpsBsDataMap
);
...
@@ -240,7 +240,12 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
...
@@ -240,7 +240,12 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
});
});
}
}
private
boolean
isGpsBsDataValid
(
int
validMinute
,
DataGpsLocation
location
)
{
private
boolean
isGpsBsDataValid
(
int
validMinute
,
String
sn
,
DataGpsLocation
location
)
{
if
(
location
==
null
)
{
log
.
info
(
"设备{}位置查询DataGpsLocation为空"
,
sn
);
return
false
;
}
log
.
info
(
"{} 位置上点时间:{}"
,
location
.
getSn
(),
location
.
getDateTime
());
log
.
info
(
"{} 位置上点时间:{}"
,
location
.
getSn
(),
location
.
getDateTime
());
ZonedDateTime
nowTime
=
ZonedDateTime
.
now
();
ZonedDateTime
nowTime
=
ZonedDateTime
.
now
();
...
@@ -251,6 +256,10 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
...
@@ -251,6 +256,10 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
}
}
private
boolean
isDistanceValid
(
DeviceLocationRequest
locationRequest
,
Map
<
String
,
GpsBsData
>
gpsBsDataMap
)
{
private
boolean
isDistanceValid
(
DeviceLocationRequest
locationRequest
,
Map
<
String
,
GpsBsData
>
gpsBsDataMap
)
{
if
(
gpsBsDataMap
==
null
)
{
return
false
;
}
// TODO: 2021/12/14 多设备激活时,距离验证
// TODO: 2021/12/14 多设备激活时,距离验证
if
(
gpsBsDataMap
.
size
()
<=
1
)
{
if
(
gpsBsDataMap
.
size
()
<=
1
)
{
return
true
;
return
true
;
...
...
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