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 45952366
authored
Dec 25, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化获取报警时间定位点的方案
1 parent
fd6e7aca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/api/FeignGpsBsController.java
src/main/java/cn/com/glsx/devicemonitor/modules/service/GpsBsLocationService.java
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
src/test/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImplTest.java
src/main/java/cn/com/glsx/devicemonitor/modules/api/FeignGpsBsController.java
View file @
4595236
...
...
@@ -130,7 +130,7 @@ public class FeignGpsBsController implements GpsBsFeignService {
@GetMapping
(
value
=
"/getAddressByLngAndLat"
)
public
R
<
String
>
getAddressByLngAndLat
(
@RequestParam
String
lng
,
@RequestParam
String
lat
)
{
log
.
info
(
"getAdressBylngAndLat params===经度:"
+
lng
+
"纬度:"
+
lat
);
String
address
=
gpsBsLocationService
.
getAdressBylngAndLat
(
lat
,
lng
);
String
address
=
gpsBsLocationService
.
getAd
d
ressBylngAndLat
(
lat
,
lng
);
return
R
.
ok
().
data
(
address
);
}
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/service/GpsBsLocationService.java
View file @
4595236
...
...
@@ -79,7 +79,7 @@ public interface GpsBsLocationService {
* @param lat 纬度
* @return 地址
*/
String
getAdressBylngAndLat
(
String
lng
,
String
lat
);
String
getAd
d
ressBylngAndLat
(
String
lng
,
String
lat
);
/**
* 根据设备号和报警时间获取报警时间的定位
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
View file @
4595236
...
...
@@ -355,7 +355,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
* @return 地址
*/
@Override
public
String
getAdressBylngAndLat
(
String
lat
,
String
lng
)
{
public
String
getAd
d
ressBylngAndLat
(
String
lat
,
String
lng
)
{
return
hdaoGpsComponent
.
mapGeoConvert
(
lat
,
lng
);
}
...
...
@@ -375,6 +375,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
DataGpsLocation
dataGpsLocation
=
new
DataGpsLocation
();
if
(
CollectionUtil
.
isNotEmpty
(
dataGpsLocationList
))
{
dataGpsLocation
=
dataGpsLocationList
.
get
(
0
);
dataGpsLocation
.
setAddress
(
getAddressBylngAndLat
(
dataGpsLocation
.
getLat
(),
dataGpsLocation
.
getLng
()));
}
GpsBsData
gpsBsData
=
new
GpsBsData
();
gpsBsData
.
setSn
(
dataGpsLocation
.
getSn
());
...
...
@@ -399,6 +400,7 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
BeanUtils
.
copyProperties
(
mbModel
,
location
);
location
.
setStoreTime
(
bsModel
.
getStoreTime
());
location
.
setDateTime
(
bsModel
.
getTime
());
location
.
setAddress
(
getAddressBylngAndLat
(
dataGpsLocation
.
getLat
(),
dataGpsLocation
.
getLng
()));
}
gpsBsData
.
setBsLocation
(
location
);
}
...
...
src/test/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImplTest.java
View file @
4595236
...
...
@@ -24,7 +24,7 @@ public class GpsBsLocationServiceImplTest {
public
void
getAdressBylngAndLat
()
{
String
lng
=
"113.985232"
;
String
lat
=
"22.590188"
;
String
adressBylngAndLat
=
gpsBsLocationService
.
getAdressBylngAndLat
(
lat
,
lng
);
String
adressBylngAndLat
=
gpsBsLocationService
.
getAd
d
ressBylngAndLat
(
lat
,
lng
);
System
.
out
.
println
(
"adressBylngAndLat = "
+
adressBylngAndLat
);
}
...
...
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