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 3c9199e6
authored
Apr 19, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.9.0 仲利车辆列表增加最后定位时间字段
1 parent
d4ec6da1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleService.java
View file @
3c9199e
...
@@ -1219,6 +1219,15 @@ public class VehicleService extends AbstractCommonService {
...
@@ -1219,6 +1219,15 @@ public class VehicleService extends AbstractCommonService {
}
}
}
}
// 查询设备最后定位点数据
List
<
String
>
snList
=
vehicleInfoList
.
stream
().
map
(
VehicleInfoExport:
:
getSn
).
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
Map
<
String
,
DeviceLocation
>
deviceLocationMap
=
Maps
.
newHashMap
();
List
<
DeviceLocation
>
deviceLocationList
=
deviceLocationMapper
.
findLocationListBySnList
(
snList
);
if
(
CollectionUtils
.
isNotEmpty
(
deviceLocationList
))
{
deviceLocationMap
=
deviceLocationList
.
stream
().
collect
(
Collectors
.
toMap
(
DeviceLocation:
:
getSn
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
}
for
(
VehicleInfoExport
vehicleInfo
:
vehicleInfoList
)
{
for
(
VehicleInfoExport
vehicleInfo
:
vehicleInfoList
)
{
vehicleInfo
.
setCreator
(
vehicleInfo
.
getBelongLevels
());
vehicleInfo
.
setCreator
(
vehicleInfo
.
getBelongLevels
());
//设置车辆类型
//设置车辆类型
...
@@ -1256,12 +1265,36 @@ public class VehicleService extends AbstractCommonService {
...
@@ -1256,12 +1265,36 @@ public class VehicleService extends AbstractCommonService {
}
}
// 设置调频数据
// 设置调频数据
setAdjustFreq
(
vehicleInfo
,
localRelUserMap
,
wechatUserMap
);
setAdjustFreq
(
vehicleInfo
,
localRelUserMap
,
wechatUserMap
);
// 设置最后定位时间
setDeviceLocation
(
vehicleInfo
,
deviceLocationMap
);
}
}
return
vehicleInfoList
;
return
vehicleInfoList
;
}
}
/**
/**
* 设置设备定位数据
*
* @param vehicleInfo 车辆设备数据
* @param deviceLocationMap 设备定位数据 map
*/
private
void
setDeviceLocation
(
VehicleInfoExport
vehicleInfo
,
Map
<
String
,
DeviceLocation
>
deviceLocationMap
)
{
DeviceLocation
deviceLocation
=
deviceLocationMap
.
get
(
vehicleInfo
.
getSn
());
if
(
Objects
.
isNull
(
deviceLocation
))
{
return
;
}
if
(
Objects
.
isNull
(
deviceLocation
.
getLastGpsTime
())
&&
Objects
.
nonNull
(
deviceLocation
.
getLastBsTime
()))
{
vehicleInfo
.
setLastPoiTime
(
DateUtil
.
formatDateTime
(
deviceLocation
.
getLastBsTime
()));
}
else
if
(
Objects
.
nonNull
(
deviceLocation
.
getLastGpsTime
())
&&
Objects
.
isNull
(
deviceLocation
.
getLastBsTime
()))
{
vehicleInfo
.
setLastPoiTime
(
DateUtil
.
formatDateTime
(
deviceLocation
.
getLastGpsTime
()));
}
else
if
(
Objects
.
nonNull
(
deviceLocation
.
getLastGpsTime
())
&&
Objects
.
nonNull
(
deviceLocation
.
getLastBsTime
()))
{
vehicleInfo
.
setLastPoiTime
(
DateUtil
.
formatDateTime
(
new
Date
(
Math
.
max
(
deviceLocation
.
getLastGpsTime
().
getTime
(),
deviceLocation
.
getLastBsTime
().
getTime
()))));
}
else
{
vehicleInfo
.
setLastPoiTime
(
null
);
}
}
/**
* 设置调频信息
* 设置调频信息
*
*
* @param model
* @param model
...
...
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