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 fb77158b
authored
May 24, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加返回值
1 parent
7284de37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
54 deletions
src/main/java/cn/com/glsx/admin/modules/converter/VehicleMonitorConvert.java
src/main/java/cn/com/glsx/admin/modules/model/vo/ResidentListVO.java
src/main/java/cn/com/glsx/admin/modules/model/vo/StayPointListVO.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
src/main/java/cn/com/glsx/admin/modules/converter/VehicleMonitorConvert.java
View file @
fb77158
...
...
@@ -25,7 +25,7 @@ public class VehicleMonitorConvert {
public
static
StayPointListVO
buildStayPointListVO
(
StayPointRecordDTO
stayPointRecordDTO
,
VehicleDeviceWorkOrder
vehicleDeviceWorkOrder
,
String
sn
)
{
String
sn
,
String
address
)
{
StayPointListVO
stayPointListVO
=
new
StayPointListVO
();
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
...
...
@@ -64,6 +64,7 @@ public class VehicleMonitorConvert {
.
map
(
StayPointRecordDTO:
:
getStayGps
)
.
map
(
GpsLocation:
:
getElng
)
.
ifPresent
(
stayPointListVO:
:
setElng
);
stayPointListVO
.
setAddress
(
address
);
return
stayPointListVO
;
}
...
...
@@ -143,7 +144,7 @@ public class VehicleMonitorConvert {
return
residentRequest
;
}
public
static
ResidentListVO
buildResidentListVO
(
ResidentDTO
residentDTO
,
VehicleDeviceWorkOrder
common
)
{
public
static
ResidentListVO
buildResidentListVO
(
ResidentDTO
residentDTO
,
VehicleDeviceWorkOrder
common
,
String
address
)
{
ResidentListVO
residentListVO
=
new
ResidentListVO
();
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
...
...
@@ -178,6 +179,7 @@ public class VehicleMonitorConvert {
residentListVO
.
setBlng
(
residentDTO
.
getBlng
());
residentListVO
.
setElat
(
residentDTO
.
getElat
());
residentListVO
.
setElng
(
residentDTO
.
getElng
());
residentListVO
.
setAddress
(
address
);
return
residentListVO
;
}
...
...
src/main/java/cn/com/glsx/admin/modules/model/vo/ResidentListVO.java
View file @
fb77158
...
...
@@ -95,4 +95,10 @@ public class ResidentListVO implements Serializable {
*/
@ApiModelProperty
(
value
=
"经度偏移"
)
private
String
elng
;
/**
* 停留地址
* */
@ApiModelProperty
(
value
=
"停留地址"
)
private
String
address
;
}
src/main/java/cn/com/glsx/admin/modules/model/vo/StayPointListVO.java
View file @
fb77158
...
...
@@ -82,4 +82,10 @@ public class StayPointListVO implements Serializable {
* */
@ApiModelProperty
(
value
=
"停留经度"
)
private
String
elng
;
/**
* 停留地址
* */
@ApiModelProperty
(
value
=
"停留地址"
)
private
String
address
;
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
View file @
fb77158
...
...
@@ -384,8 +384,55 @@ public class VehicleMonitorService {
List
<
StayPointRecordDTO
>
stayPointRecord
=
getStayPointList
(
search
,
request
);
//获取车辆,工单信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
//获取地址信息
List
<
LngLatDTO
>
lngLats
=
stayPointRecord
.
stream
()
.
filter
(
e
->
Objects
.
nonNull
(
e
.
getStayGps
()))
.
map
(
e
->
new
LngLatDTO
(
e
.
getStayGps
().
getElng
(),
e
.
getStayGps
().
getElat
()))
.
collect
(
Collectors
.
toList
());
LngLatAddressDTO
addressDTO
=
remoteGpsBsService
.
getAddressMap
(
lngLats
);
Map
<
String
,
String
>
addressMap
=
Optional
.
ofNullable
(
addressDTO
)
.
map
(
LngLatAddressDTO:
:
getAddress
)
.
orElse
(
Maps
.
newHashMap
());
return
stayPointRecord
.
stream
()
.
map
(
stayPoint
->
VehicleMonitorConvert
.
buildStayPointListVO
(
stayPoint
,
commonInfo
,
search
.
getSn
(),
Optional
.
ofNullable
(
stayPoint
.
getStayGps
())
.
map
(
e
->
e
.
getElat
()
+
e
.
getElng
())
.
map
(
addressMap:
:
get
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
)))
.
collect
(
Collectors
.
toList
());
}
/**
* 停留点列表导出
*/
public
List
<
StayPointListExport
>
exportStayPointList
(
StayPointSearch
search
)
{
StayPointRequest
request
=
VehicleMonitorConvert
.
buildStayPointRequest
(
search
);
//获取停留点列表
List
<
StayPointRecordDTO
>
stayPointRecord
=
getStayPointList
(
search
,
request
);
//获取地址信息
List
<
LngLatDTO
>
lngLats
=
stayPointRecord
.
stream
()
.
filter
(
e
->
Objects
.
nonNull
(
e
.
getStayGps
()))
.
map
(
e
->
new
LngLatDTO
(
e
.
getStayGps
().
getElng
(),
e
.
getStayGps
().
getElat
()))
.
collect
(
Collectors
.
toList
());
LngLatAddressDTO
addressDTO
=
remoteGpsBsService
.
getAddressMap
(
lngLats
);
Map
<
String
,
String
>
addressMap
=
Optional
.
ofNullable
(
addressDTO
)
.
map
(
LngLatAddressDTO:
:
getAddress
)
.
orElse
(
Maps
.
newHashMap
());
//获取车辆,工单信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
return
stayPointRecord
.
stream
()
.
map
(
stayPoint
->
VehicleMonitorConvert
.
buildStayPointListVO
(
stayPoint
,
commonInfo
,
search
.
getSn
()))
.
filter
(
Objects:
:
nonNull
)
.
map
(
stayPoint
->
{
String
address
=
Optional
.
ofNullable
(
stayPoint
.
getStayGps
())
.
map
(
e
->
e
.
getElat
()
+
e
.
getElng
())
.
map
(
addressMap:
:
get
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
return
VehicleMonitorConvert
.
buildStayPointListExport
(
stayPoint
,
commonInfo
,
search
.
getSn
(),
address
);
})
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -417,42 +464,41 @@ public class VehicleMonitorService {
return
stayPointRecord
;
}
/**
*
停留点列表导出
*
常驻地列表
*/
public
List
<
StayPointListExport
>
exportStayPointList
(
StayPointSearch
search
)
{
StayPointRequest
request
=
VehicleMonitorConvert
.
buildStayPointRequest
(
search
);
//获取停留点列表
List
<
StayPointRecordDTO
>
stayPointRecord
=
getStayPointList
(
search
,
request
);
public
List
<
ResidentListVO
>
queryResidentList
(
ResidentSearch
search
)
{
ResidentRequest
request
=
buildResidentRequest
(
search
);
List
<
ResidentDTO
>
residentList
=
remoteFeignResidentService
.
getResidentList
(
request
);
if
(
CollectionUtils
.
isEmpty
(
residentList
))
{
return
Lists
.
newArrayList
();
}
//查询设备,车辆,工单等信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
//获取地址信息
List
<
LngLatDTO
>
lngLats
=
stayPointRecord
.
stream
()
.
filter
(
e
->
Objects
.
nonNull
(
e
.
getStayGps
()))
.
map
(
e
->
new
LngLatDTO
(
e
.
getStayGps
().
getElng
(),
e
.
getStayGps
().
getElat
()))
List
<
LngLatDTO
>
lngLats
=
residentList
.
stream
()
.
map
(
e
->
new
LngLatDTO
(
e
.
getElng
(),
e
.
getElat
()))
.
collect
(
Collectors
.
toList
());
LngLatAddressDTO
addressDTO
=
remoteGpsBsService
.
getAddressMap
(
lngLats
);
Map
<
String
,
String
>
addressMap
=
Optional
.
ofNullable
(
addressDTO
)
.
map
(
LngLatAddressDTO:
:
getAddress
)
.
orElse
(
Maps
.
newHashMap
());
//获取车辆,工单信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
return
stayPointRecord
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
stayPoint
->
{
String
address
=
Optional
.
ofNullable
(
stayPoint
.
getStayGps
())
.
map
(
e
->
e
.
getElat
()
+
e
.
getElng
())
.
map
(
addressMap:
:
get
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
return
VehicleMonitorConvert
.
buildStayPointListExport
(
stayPoint
,
commonInfo
,
search
.
getSn
(),
address
);
})
return
residentList
.
stream
()
.
map
(
e
->
VehicleMonitorConvert
.
buildResidentListVO
(
e
,
commonInfo
,
addressMap
.
get
(
e
.
getElat
()
+
e
.
getElng
())))
.
collect
(
Collectors
.
toList
());
}
/**
*
常驻地列表
*
导出常驻地
*/
public
List
<
ResidentList
VO
>
query
ResidentList
(
ResidentSearch
search
)
{
public
List
<
ResidentList
Export
>
export
ResidentList
(
ResidentSearch
search
)
{
ResidentRequest
request
=
buildResidentRequest
(
search
);
List
<
ResidentDTO
>
residentList
=
remoteFeignResidentService
.
getResidentList
(
request
);
...
...
@@ -463,8 +509,18 @@ public class VehicleMonitorService {
//查询设备,车辆,工单等信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
//获取地址信息
List
<
LngLatDTO
>
lngLats
=
residentList
.
stream
()
.
map
(
e
->
new
LngLatDTO
(
e
.
getElng
(),
e
.
getElat
()))
.
collect
(
Collectors
.
toList
());
LngLatAddressDTO
addressDTO
=
remoteGpsBsService
.
getAddressMap
(
lngLats
);
Map
<
String
,
String
>
addressMap
=
Optional
.
ofNullable
(
addressDTO
)
.
map
(
LngLatAddressDTO:
:
getAddress
)
.
orElse
(
Maps
.
newHashMap
());
return
residentList
.
stream
()
.
map
(
e
->
VehicleMonitorConvert
.
buildResidentListVO
(
e
,
commonInfo
))
.
filter
(
Objects:
:
nonNull
)
.
map
(
resident
->
VehicleMonitorConvert
.
buildResidentListExport
(
resident
,
commonInfo
,
addressMap
.
get
(
resident
.
getElat
()
+
resident
.
getElng
())))
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -524,33 +580,4 @@ public class VehicleMonitorService {
}
return
new
ImmutablePair
<>(
startDate
,
endDate
);
}
/**
* 导出常驻地
*/
public
List
<
ResidentListExport
>
exportResidentList
(
ResidentSearch
search
)
{
ResidentRequest
request
=
buildResidentRequest
(
search
);
List
<
ResidentDTO
>
residentList
=
remoteFeignResidentService
.
getResidentList
(
request
);
if
(
CollectionUtils
.
isEmpty
(
residentList
))
{
return
Lists
.
newArrayList
();
}
//查询设备,车辆,工单等信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
//获取地址信息
List
<
LngLatDTO
>
lngLats
=
residentList
.
stream
()
.
map
(
e
->
new
LngLatDTO
(
e
.
getElng
(),
e
.
getElat
()))
.
collect
(
Collectors
.
toList
());
LngLatAddressDTO
addressDTO
=
remoteGpsBsService
.
getAddressMap
(
lngLats
);
Map
<
String
,
String
>
addressMap
=
Optional
.
ofNullable
(
addressDTO
)
.
map
(
LngLatAddressDTO:
:
getAddress
)
.
orElse
(
Maps
.
newHashMap
());
return
residentList
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
resident
->
VehicleMonitorConvert
.
buildResidentListExport
(
resident
,
commonInfo
,
addressMap
.
get
(
resident
.
getElat
()
+
resident
.
getElng
())))
.
collect
(
Collectors
.
toList
());
}
}
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