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 384f36ff
authored
Mar 29, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.7.0 开发区域查车ICE调用接口-- 过滤定位查询经纬度为0 的定位
1 parent
7285d6af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
src/main/java/cn/com/glsx/devicemonitor/modules/converter/DataLocationConvert.java
src/test/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponentTest.java
src/main/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponent.java
View file @
384f36f
...
...
@@ -82,8 +82,9 @@ public class HdaoGpsComponent {
// 1:ok for part, the succesful part of device info is followed...
// -1:failed, the followed gpsDevInfo is meaningless...
log
.
info
(
"getDevicesGpsInfoBatch invoker ice getDevicesGpsInfo result:"
+
res
.
value
.
batchResult
+
" reqSn:"
+
Arrays
.
toString
(
snArray
));
log
.
info
(
"res.value.gpsDevInfos==="
+
JSONUtil
.
toJsonStr
(
res
.
value
.
gpsDevInfos
));
List
<
GpsDevInfo
>
trackModels
=
Arrays
.
asList
(
res
.
value
.
gpsDevInfos
);
log
.
info
(
"trackModels==="
+
JSONUtil
.
toJsonStr
(
trackModels
));
dataGpsLocationList
=
DataLocationConvert
.
convertIceListToGpsLocation
(
trackModels
);
}
}
catch
(
Exception
e
)
{
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/converter/DataLocationConvert.java
View file @
384f36f
...
...
@@ -65,6 +65,9 @@ public class DataLocationConvert {
if
(
gpsDevInfo
.
record
==
null
)
{
continue
;
}
if
(
gpsDevInfo
.
record
.
lng
==
0
&&
gpsDevInfo
.
record
.
lat
==
0
)
{
continue
;
}
DataGpsLocation
dataGpsLocation
=
new
DataGpsLocation
();
dataGpsLocation
.
setSn
(
String
.
valueOf
(
gpsDevInfo
.
userID
));
...
...
src/test/java/cn/com/glsx/devicemonitor/modules/components/HdaoGpsComponentTest.java
View file @
384f36f
...
...
@@ -12,6 +12,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
...
...
@@ -43,8 +44,11 @@ class HdaoGpsComponentTest {
@Test
public
void
testGetDevicesGpsInfoBatch
()
{
List
<
DataGpsLocation
>
devicesGpsInfoBatch
=
hdaoGpsComponent
.
getDevicesGpsInfoBatch
(
Lists
.
newArrayList
(
"1
591127955
"
));
List
<
DataGpsLocation
>
devicesGpsInfoBatch
=
hdaoGpsComponent
.
getDevicesGpsInfoBatch
(
Lists
.
newArrayList
(
"1
611088776
"
));
System
.
out
.
println
(
"devicesGpsInfoBatch = "
+
JSONUtil
.
toJsonStr
(
devicesGpsInfoBatch
));
if
(
CollectionUtils
.
isEmpty
(
devicesGpsInfoBatch
))
{
System
.
out
.
println
(
"true"
);
}
}
}
\ No newline at end of file
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