Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
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 71c6f78f
authored
May 19, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
上点时间取最新时间(代码待优化)
1 parent
1a690f45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
8 deletions
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
View file @
71c6f78
...
@@ -15,6 +15,7 @@ import cn.com.glsx.stdinterface.enums.DeviceComposeEnum;
...
@@ -15,6 +15,7 @@ import cn.com.glsx.stdinterface.enums.DeviceComposeEnum;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
...
@@ -27,6 +28,7 @@ import org.springframework.stereotype.Service;
...
@@ -27,6 +28,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.StopWatch
;
import
org.springframework.util.StopWatch
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
...
@@ -127,12 +129,25 @@ public class OpereportService extends AbstractCommonService {
...
@@ -127,12 +129,25 @@ public class OpereportService extends AbstractCommonService {
list
.
forEach
(
rdd
->
{
list
.
forEach
(
rdd
->
{
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
if
(
gpsBsData
!=
null
)
{
if
(
gpsBsData
!=
null
)
{
long
gpsDateLong
=
0
;
long
bsDateLong
=
0
;
//先基站
if
(
gpsBsData
.
getBsLocation
()
!=
null
)
{
//rdd.setGpsTime(gpsBsData.getBsLocation().getDateTime());
rdd
.
setGpsAddress
(
gpsBsData
.
getBsLocation
().
getAddress
());
bsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getBsLocation
().
getDateTime
()).
getTime
();
}
//再gps
if
(
gpsBsData
.
getGpsLocation
()
!=
null
)
{
if
(
gpsBsData
.
getGpsLocation
()
!=
null
)
{
rdd
.
setGpsTime
(
gpsBsData
.
getGpsLocation
().
getDateTime
());
//
rdd.setGpsTime(gpsBsData.getGpsLocation().getDateTime());
rdd
.
setGpsAddress
(
gpsBsData
.
getGpsLocation
().
getAddress
());
rdd
.
setGpsAddress
(
gpsBsData
.
getGpsLocation
().
getAddress
());
}
else
if
(
gpsBsData
.
getBsLocation
()
!=
null
)
{
rdd
.
setGpsTime
(
gpsBsData
.
getBsLocation
().
getDateTime
());
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
rdd
.
setGpsAddress
(
gpsBsData
.
getBsLocation
().
getAddress
());
}
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
if
(
trackTime
!=
0
)
{
rdd
.
setGpsTime
(
DateUtils
.
formatNormal
(
new
Date
(
trackTime
)));
}
}
}
}
});
});
...
@@ -206,12 +221,25 @@ public class OpereportService extends AbstractCommonService {
...
@@ -206,12 +221,25 @@ public class OpereportService extends AbstractCommonService {
dataList
.
forEach
(
rdd
->
{
dataList
.
forEach
(
rdd
->
{
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
if
(
gpsBsData
!=
null
)
{
if
(
gpsBsData
!=
null
)
{
long
gpsDateLong
=
0
;
long
bsDateLong
=
0
;
if
(
gpsBsData
.
getBsLocation
()
!=
null
)
{
//rdd.setGpsTime(gpsBsData.getBsLocation().getDateTime());
rdd
.
setGpsAddress
(
gpsBsData
.
getBsLocation
().
getAddress
());
bsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getBsLocation
().
getDateTime
()).
getTime
();
}
if
(
gpsBsData
.
getGpsLocation
()
!=
null
)
{
if
(
gpsBsData
.
getGpsLocation
()
!=
null
)
{
rdd
.
setGpsTime
(
gpsBsData
.
getGpsLocation
().
getDateTime
());
//
rdd.setGpsTime(gpsBsData.getGpsLocation().getDateTime());
rdd
.
setGpsAddress
(
gpsBsData
.
getGpsLocation
().
getAddress
());
rdd
.
setGpsAddress
(
gpsBsData
.
getGpsLocation
().
getAddress
());
}
else
if
(
gpsBsData
.
getBsLocation
()
!=
null
)
{
rdd
.
setGpsTime
(
gpsBsData
.
getBsLocation
().
getDateTime
());
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
rdd
.
setGpsAddress
(
gpsBsData
.
getBsLocation
().
getAddress
());
}
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
if
(
trackTime
!=
0
)
{
rdd
.
setGpsTime
(
DateUtils
.
formatNormal
(
new
Date
(
trackTime
)));
}
}
}
}
});
});
...
...
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