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 2d0b53b2
authored
Mar 30, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化Wifi定位获取数据
1 parent
9d0db017
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
View file @
2d0b53b
...
...
@@ -823,7 +823,7 @@ public class HdaoGpsComponent {
//解析mac地址获取定位
WifiMapInfoModel
wifiMapInfoModel
=
MapUtil
.
getWifiLoactionByMac
(
macStr
.
toString
());
if
(
wifiMapInfoModel
==
null
||
wifiMapInfoModel
.
getLocation
()
==
null
||
wifiMapInfoModel
.
getType
().
equals
(
"0"
))
{
log
.
info
(
"解析mac 获取地址失败。定位
类型:"
+
wifiMapInfoModel
.
getType
(
));
log
.
info
(
"解析mac 获取地址失败。定位
数据:"
+
JSONUtil
.
toJsonStr
(
wifiMapInfoModel
));
return
null
;
}
String
[]
lngLat
=
wifiMapInfoModel
.
getLocation
().
split
(
","
);
...
...
@@ -834,6 +834,7 @@ public class HdaoGpsComponent {
gpsLocation
.
setLat
(
lngLat
[
0
]);
gpsLocation
.
setLng
(
lngLat
[
1
]);
gpsLocation
.
setStoreTime
(
DateUtil
.
formatDateTime
(
date
));
gpsLocation
.
setDateTime
(
DateUtil
.
formatDateTime
(
date
));
return
gpsLocation
;
}
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
View file @
2d0b53b
...
...
@@ -177,7 +177,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
ZonedDateTime
nowTime
=
ZonedDateTime
.
now
();
GpsLocation
gpsLocation
=
gpsBsData
.
getGpsLocation
();
if
(
gpsLocation
!=
null
)
{
if
(
gpsLocation
!=
null
&&
gpsLocation
.
getDateTime
()
!=
null
)
{
ZonedDateTime
dateTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
DateUtils
.
parse
(
gpsLocation
.
getDateTime
()).
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
Duration
duration
=
Duration
.
between
(
nowTime
,
dateTime
).
abs
();
if
(
duration
.
toDays
()
<=
3
)
{
...
...
@@ -185,7 +185,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
}
}
GpsLocation
bsLocation
=
gpsBsData
.
getBsLocation
();
if
(
bsLocation
!=
null
)
{
if
(
bsLocation
!=
null
&&
bsLocation
.
getDateTime
()
!=
null
)
{
ZonedDateTime
dateTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
DateUtils
.
parse
(
bsLocation
.
getDateTime
()).
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
Duration
duration
=
Duration
.
between
(
nowTime
,
dateTime
).
abs
();
if
(
duration
.
toDays
()
<=
3
)
{
...
...
@@ -193,7 +193,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
}
}
GpsLocation
wifiLocation
=
gpsBsData
.
getWifiLocation
();
if
(
wifiLocation
!=
null
)
{
if
(
wifiLocation
!=
null
&&
wifiLocation
.
getDateTime
()
!=
null
)
{
ZonedDateTime
dateTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
DateUtils
.
parse
(
wifiLocation
.
getDateTime
()).
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
Duration
duration
=
Duration
.
between
(
nowTime
,
dateTime
).
abs
();
if
(
duration
.
toDays
()
<=
3
)
{
...
...
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