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 7284de37
authored
May 23, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' of
http://192.168.3.233:8090/eshiled-new/ne-shield-triald…
…rive-admin into develop
2 parents
b226d864
5c7e8740
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
src/main/java/cn/com/glsx/admin/modules/controller/HomeController.java
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
src/main/java/cn/com/glsx/admin/modules/controller/HomeController.java
View file @
7284de3
...
@@ -121,8 +121,9 @@ public class HomeController {
...
@@ -121,8 +121,9 @@ public class HomeController {
* @return 是否需要刷新
* @return 是否需要刷新
*/
*/
private
boolean
needRefreshTotal
(
String
uniqueValue
)
{
private
boolean
needRefreshTotal
(
String
uniqueValue
)
{
Long
lastRefreshTime
=
DEVICE_COUNT_LAST_REFRESH_TIME
.
get
(
uniqueValue
);
// Long lastRefreshTime = DEVICE_COUNT_LAST_REFRESH_TIME.get(uniqueValue);
return
lastRefreshTime
==
null
||
(
Math
.
abs
(
lastRefreshTime
-
System
.
currentTimeMillis
())
>=
120000
);
// return lastRefreshTime == null || (Math.abs(lastRefreshTime - System.currentTimeMillis()) >= 120000);
return
true
;
}
}
/**
/**
...
...
src/main/java/cn/com/glsx/admin/modules/service/OpereportService.java
View file @
7284de3
...
@@ -122,11 +122,16 @@ public class OpereportService extends AbstractCommonService {
...
@@ -122,11 +122,16 @@ public class OpereportService extends AbstractCommonService {
List
<
ReportDeviceDTO
>
list
=
vehicleDeviceMapper
.
searchReportDevice
(
search
);
List
<
ReportDeviceDTO
>
list
=
vehicleDeviceMapper
.
searchReportDevice
(
search
);
List
<
String
>
snList
=
list
.
stream
().
map
(
ReportDeviceDTO:
:
getSns
).
collect
(
Collectors
.
toList
());
//过滤有上点时间的sn(如果大数据有位置点数据,t_device_location则看消费是否有问题)
List
<
String
>
snList
=
list
.
stream
().
filter
(
rdd
->
StringUtils
.
isNotEmpty
(
rdd
.
getGpsTime
())).
map
(
ReportDeviceDTO:
:
getSns
).
collect
(
Collectors
.
toList
());
Map
<
String
,
GpsBsData
>
gpsBsDataMap
=
remoteGpsBsService
.
getLastGpsBsBatchBySns
(
snList
);
Map
<
String
,
GpsBsData
>
gpsBsDataMap
=
remoteGpsBsService
.
getLastGpsBsBatchBySns
(
snList
);
list
.
forEach
(
rdd
->
{
list
.
forEach
(
rdd
->
{
if
(
StringUtils
.
isNullOrEmpty
(
rdd
.
getGpsTime
()))
{
rdd
.
setGpsTime
(
"--"
);
return
;
}
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
if
(
gpsBsData
!=
null
)
{
if
(
gpsBsData
!=
null
)
{
long
gpsDateLong
=
0
;
long
gpsDateLong
=
0
;
...
@@ -146,7 +151,7 @@ public class OpereportService extends AbstractCommonService {
...
@@ -146,7 +151,7 @@ public class OpereportService extends AbstractCommonService {
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
}
}
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
if
(
trackTime
!=
0
)
{
if
(
trackTime
>
0
)
{
rdd
.
setGpsTime
(
DateUtils
.
formatNormal
(
new
Date
(
trackTime
)));
rdd
.
setGpsTime
(
DateUtils
.
formatNormal
(
new
Date
(
trackTime
)));
}
}
}
}
...
@@ -187,7 +192,7 @@ public class OpereportService extends AbstractCommonService {
...
@@ -187,7 +192,7 @@ public class OpereportService extends AbstractCommonService {
return
;
return
;
}
}
List
<
String
>
snList
=
dataList
.
stream
().
map
(
ReportDeviceExport:
:
getSns
).
collect
(
Collectors
.
toList
());
List
<
String
>
snList
=
dataList
.
stream
().
filter
(
rdd
->
StringUtils
.
isNotEmpty
(
rdd
.
getGpsTime
())).
map
(
ReportDeviceExport:
:
getSns
).
collect
(
Collectors
.
toList
());
//切分成一个list去请求
//切分成一个list去请求
List
<
List
<
String
>>
partList
=
Lists
.
partition
(
snList
,
1000
);
List
<
List
<
String
>>
partList
=
Lists
.
partition
(
snList
,
1000
);
...
@@ -219,6 +224,10 @@ public class OpereportService extends AbstractCommonService {
...
@@ -219,6 +224,10 @@ public class OpereportService extends AbstractCommonService {
}
}
dataList
.
forEach
(
rdd
->
{
dataList
.
forEach
(
rdd
->
{
if
(
StringUtils
.
isNullOrEmpty
(
rdd
.
getGpsTime
()))
{
rdd
.
setGpsTime
(
"--"
);
return
;
}
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
GpsBsData
gpsBsData
=
gpsBsDataMap
.
get
(
rdd
.
getSns
());
if
(
gpsBsData
!=
null
)
{
if
(
gpsBsData
!=
null
)
{
long
gpsDateLong
=
0
;
long
gpsDateLong
=
0
;
...
@@ -236,9 +245,8 @@ public class OpereportService extends AbstractCommonService {
...
@@ -236,9 +245,8 @@ public class OpereportService extends AbstractCommonService {
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
gpsDateLong
=
DateUtils
.
parse
(
gpsBsData
.
getGpsLocation
().
getDateTime
()).
getTime
();
}
}
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
long
trackTime
=
Math
.
max
(
gpsDateLong
,
bsDateLong
);
if
(
trackTime
!=
0
)
{
if
(
trackTime
>
0
)
{
rdd
.
setGpsTime
(
DateUtils
.
formatNormal
(
new
Date
(
trackTime
)));
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