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 de5d8d00
authored
May 20, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化激活位置点批量查询方法
1 parent
35fde0e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 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 @
de5d8d0
...
@@ -196,7 +196,11 @@ public class HdaoGpsComponent {
...
@@ -196,7 +196,11 @@ public class HdaoGpsComponent {
* @return
* @return
*/
*/
public
DataGpsLocation
getDevicesFirstBsInfo
(
String
sn
,
String
activeDate
)
{
public
DataGpsLocation
getDevicesFirstBsInfo
(
String
sn
,
String
activeDate
)
{
DataBsLocation
bsLocation
=
new
DataBsLocation
();
DataBsLocation
bsLocation
=
null
;
if
(
StringUtils
.
isEmpty
(
sn
)
||
StringUtils
.
isEmpty
(
activeDate
))
{
return
null
;
}
try
{
try
{
Date
date
=
DateUtils
.
parseDate
(
activeDate
,
parsePattern
);
Date
date
=
DateUtils
.
parseDate
(
activeDate
,
parsePattern
);
Date
startTime
=
calcDayStartTime
(
date
);
Date
startTime
=
calcDayStartTime
(
date
);
...
@@ -233,7 +237,11 @@ public class HdaoGpsComponent {
...
@@ -233,7 +237,11 @@ public class HdaoGpsComponent {
log
.
error
(
"getDevicesFirstGpsInfo invoker ice getGpsRecords sn:"
+
sn
+
" exception: "
+
e
.
getMessage
(),
e
);
log
.
error
(
"getDevicesFirstGpsInfo invoker ice getGpsRecords sn:"
+
sn
+
" exception: "
+
e
.
getMessage
(),
e
);
}
}
// 2、通过基站获取位置(无需转换地址,通过基站获取位置已经有地址信息)
// 2、通过基站获取位置(无需转换地址,通过基站获取位置已经有地址信息)
return
mapGeoBsConvert
(
bsLocation
);
DataGpsLocation
dataGpsLocation
=
null
;
if
(
bsLocation
!=
null
)
{
dataGpsLocation
=
mapGeoBsConvert
(
bsLocation
);
}
return
dataGpsLocation
;
}
}
/**
/**
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/service/impl/GpsBsLocationServiceImpl.java
View file @
de5d8d0
...
@@ -29,7 +29,6 @@ import com.google.common.collect.Lists;
...
@@ -29,7 +29,6 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang3.tuple.ImmutablePair
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
...
@@ -112,17 +111,14 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
...
@@ -112,17 +111,14 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
List
<
GpsBsData
>
gpsBsDataList
=
Lists
.
newArrayList
();
List
<
GpsBsData
>
gpsBsDataList
=
Lists
.
newArrayList
();
// 遍历设备 激活时间集合 分别获取定位信息
// 遍历设备 激活时间集合 分别获取定位信息
for
(
GpsBsFirstBatchRequest
gpsBsFirstBatchRequest
:
gpsBsFirstBatchRequestList
)
{
for
(
GpsBsFirstBatchRequest
gpsBsFirstBatchRequest
:
gpsBsFirstBatchRequestList
)
{
// 1、调用ICE批量获取数据
// 1、调用ICE批量获取
GPS
数据
DataGpsLocation
dataGpsLocation
=
hdaoGpsComponent
.
getDevicesFirstGpsInfo
(
gpsBsFirstBatchRequest
.
getSn
(),
gpsBsFirstBatchRequest
.
getActiveDate
());
DataGpsLocation
dataGpsLocation
=
hdaoGpsComponent
.
getDevicesFirstGpsInfo
(
gpsBsFirstBatchRequest
.
getSn
(),
gpsBsFirstBatchRequest
.
getActiveDate
());
GpsBsData
gpsBsData
=
new
GpsBsData
();
GpsBsData
gpsBsData
=
new
GpsBsData
();
gpsBsData
.
setSn
(
gpsBsFirstBatchRequest
.
getSn
());
gpsBsData
.
setSn
(
gpsBsFirstBatchRequest
.
getSn
());
gpsBsData
.
setGpsLocation
(
DataLocationConvert
.
convertDataToGpsLocation
(
dataGpsLocation
));
gpsBsData
.
setGpsLocation
(
DataLocationConvert
.
convertDataToGpsLocation
(
dataGpsLocation
));
if
(
GeoLocationEnum
.
GPS
.
equals
(
dataGpsLocation
.
getGeoLocationEnum
()))
{
// 2、补充基站的数据
gpsBsData
.
setGpsLocation
(
DataLocationConvert
.
convertDataToGpsLocation
(
dataGpsLocation
));
// 2.1 如果是GPS,则补充获取基站的数据
DataGpsLocation
bsLocation
=
hdaoGpsComponent
.
getDevicesFirstBsInfo
(
gpsBsFirstBatchRequest
.
getSn
(),
gpsBsFirstBatchRequest
.
getActiveDate
());
DataGpsLocation
bsLocation
=
hdaoGpsComponent
.
getDevicesFirstBsInfo
(
gpsBsFirstBatchRequest
.
getSn
(),
gpsBsFirstBatchRequest
.
getActiveDate
());
gpsBsData
.
setBsLocation
(
DataLocationConvert
.
convertDataToGpsLocation
(
bsLocation
));
gpsBsData
.
setBsLocation
(
DataLocationConvert
.
convertDataToGpsLocation
(
bsLocation
));
}
gpsBsDataList
.
add
(
gpsBsData
);
gpsBsDataList
.
add
(
gpsBsData
);
}
}
...
...
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