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 c15de83c
authored
May 16, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
导出默认值
1 parent
7f072323
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
30 deletions
src/main/java/cn/com/glsx/admin/common/constants/Constants.java
src/main/java/cn/com/glsx/admin/modules/converter/VehicleMonitorConvert.java
src/main/java/cn/com/glsx/admin/modules/model/export/ResidentListExport.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
src/main/java/cn/com/glsx/admin/common/constants/Constants.java
View file @
c15de83
...
@@ -141,4 +141,7 @@ public final class Constants {
...
@@ -141,4 +141,7 @@ public final class Constants {
* 导出最大限制
* 导出最大限制
*/
*/
public
static
final
int
MAX_EXPORT_LIMIT
=
10000
;
public
static
final
int
MAX_EXPORT_LIMIT
=
10000
;
public
static
final
String
EMPTY_CONTENT_EXCEL
=
"--"
;
}
}
src/main/java/cn/com/glsx/admin/modules/converter/VehicleMonitorConvert.java
View file @
c15de83
package
cn
.
com
.
glsx
.
admin
.
modules
.
converter
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
converter
;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.modules.entity.VehicleDeviceWorkOrder
;
import
cn.com.glsx.admin.modules.entity.VehicleDeviceWorkOrder
;
import
cn.com.glsx.admin.modules.model.export.ResidentListExport
;
import
cn.com.glsx.admin.modules.model.export.ResidentListExport
;
import
cn.com.glsx.admin.modules.model.export.StayPointListExport
;
import
cn.com.glsx.admin.modules.model.export.StayPointListExport
;
...
@@ -71,37 +72,51 @@ public class VehicleMonitorConvert {
...
@@ -71,37 +72,51 @@ public class VehicleMonitorConvert {
VehicleDeviceWorkOrder
vehicleDeviceWorkOrder
,
VehicleDeviceWorkOrder
vehicleDeviceWorkOrder
,
String
sn
,
String
address
)
{
String
sn
,
String
address
)
{
StayPointListExport
stayPointListExport
=
new
StayPointListExport
();
StayPointListExport
stayPointListExport
=
new
StayPointListExport
();
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
String
workOrderNo
=
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
ifPresent
(
stayPointListExport:
:
setWorkOrderNo
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setWorkOrderNo
(
workOrderNo
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
String
name
=
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
stayPointListExport:
:
setOwnerName
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setOwnerName
(
name
);
stayPointListExport
.
setSn
(
sn
);
String
snR
=
Optional
.
ofNullable
(
sn
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setSn
(
snR
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
String
vin
=
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
ifPresent
(
stayPointListExport:
:
setVin
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setVin
(
vin
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
String
shopName
=
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
ifPresent
(
stayPointListExport:
:
setShopName
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setShopName
(
shopName
);
stayPointListExport
.
setBeginTime
(
stayPointRecordDTO
.
getBeginTime
());
String
beginTime
=
Optional
.
ofNullable
(
stayPointRecordDTO
.
getBeginTime
())
stayPointListExport
.
setEndTime
(
stayPointRecordDTO
.
getEndTime
());
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setBeginTime
(
beginTime
);
String
endTime
=
Optional
.
ofNullable
(
stayPointRecordDTO
.
getEndTime
())
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setEndTime
(
endTime
);
//时长
//时长
Optional
.
ofNullable
(
stayPointRecordDTO
.
getDuration
())
String
duration
=
Optional
.
ofNullable
(
stayPointRecordDTO
.
getDuration
())
.
map
(
e
->
e
*
1000
)
.
map
(
e
->
e
*
1000
)
.
map
(
Integer:
:
longValue
)
.
map
(
Integer:
:
longValue
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
ifPresent
(
stayPointListExport:
:
setDuration
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setDuration
(
duration
);
stayPointListExport
.
setLocationType
(
"GPS"
);
stayPointListExport
.
setLocationType
(
"GPS"
);
stayPointListExport
.
setAddress
(
address
);
String
addressR
=
Optional
.
ofNullable
(
address
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
stayPointListExport
.
setAddress
(
addressR
);
return
stayPointListExport
;
return
stayPointListExport
;
}
}
...
@@ -170,34 +185,46 @@ public class VehicleMonitorConvert {
...
@@ -170,34 +185,46 @@ public class VehicleMonitorConvert {
VehicleDeviceWorkOrder
common
,
VehicleDeviceWorkOrder
common
,
String
address
)
{
String
address
)
{
ResidentListExport
result
=
new
ResidentListExport
();
ResidentListExport
result
=
new
ResidentListExport
();
Optional
.
ofNullable
(
common
)
String
workOrderNo
=
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
ifPresent
(
result:
:
setWorkOrderNo
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setWorkOrderNo
(
workOrderNo
);
Optional
.
ofNullable
(
common
)
String
ownerName
=
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
result:
:
setOwnerName
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setOwnerName
(
ownerName
);
Optional
.
ofNullable
(
common
)
String
sn
=
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getSn
)
.
map
(
VehicleDeviceWorkOrder:
:
getSn
)
.
ifPresent
(
result:
:
setSn
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setSn
(
sn
);
Optional
.
ofNullable
(
common
)
String
vin
=
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
ifPresent
(
result:
:
setVin
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setVin
(
vin
);
Optional
.
ofNullable
(
common
)
String
shopName
=
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
ifPresent
(
result:
:
setShopName
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setShopName
(
shopName
);
Optional
.
ofNullable
(
residentDTO
.
getTotalDuration
())
String
totalDurationString
=
Optional
.
ofNullable
(
residentDTO
.
getTotalDuration
())
.
map
(
e
->
e
*
1000
)
.
map
(
e
->
e
*
1000
)
.
map
(
Integer:
:
longValue
)
.
map
(
Integer:
:
longValue
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
ifPresent
(
result:
:
setTotalDurationString
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setTotalDurationString
(
totalDurationString
);
String
totalTimes
=
Optional
.
ofNullable
(
residentDTO
.
getTotalTimes
())
.
map
(
String:
:
valueOf
)
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setTotalTimes
(
totalTimes
);
result
.
setTotalTimes
(
residentDTO
.
getTotalTimes
());
String
addressR
=
Optional
.
ofNullable
(
address
)
result
.
setAddress
(
address
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
result
.
setAddress
(
addressR
);
return
result
;
return
result
;
}
}
}
}
src/main/java/cn/com/glsx/admin/modules/model/export/ResidentListExport.java
View file @
c15de83
...
@@ -53,7 +53,7 @@ public class ResidentListExport implements Serializable {
...
@@ -53,7 +53,7 @@ public class ResidentListExport implements Serializable {
* 驻留次数
* 驻留次数
*/
*/
@ExcelProperty
(
"驻留次数"
)
@ExcelProperty
(
"驻留次数"
)
private
Integer
totalTimes
;
private
String
totalTimes
;
/**
/**
* 常驻地位置
* 常驻地位置
...
...
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
View file @
c15de83
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.common.constants.ConstantsVehicle
;
import
cn.com.glsx.admin.common.constants.ConstantsVehicle
;
import
cn.com.glsx.admin.common.enums.OrgVehicleTreeIdTag
;
import
cn.com.glsx.admin.common.enums.OrgVehicleTreeIdTag
;
import
cn.com.glsx.admin.modules.converter.VehicleMonitorConvert
;
import
cn.com.glsx.admin.modules.converter.VehicleMonitorConvert
;
...
@@ -437,11 +438,12 @@ public class VehicleMonitorService {
...
@@ -437,11 +438,12 @@ public class VehicleMonitorService {
//获取车辆,工单信息
//获取车辆,工单信息
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
VehicleDeviceWorkOrder
commonInfo
=
vehicleDeviceService
.
getVehicleDeviceWorkOrderBySn
(
search
.
getSn
());
return
stayPointRecord
.
stream
()
return
stayPointRecord
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
stayPoint
->
{
.
map
(
stayPoint
->
{
String
address
=
Optional
.
ofNullable
(
stayPoint
.
getStayGps
())
String
address
=
Optional
.
ofNullable
(
stayPoint
.
getStayGps
())
.
map
(
e
->
e
.
getElat
()
+
e
.
getElng
())
.
map
(
e
->
e
.
getElat
()
+
e
.
getElng
())
.
map
(
addressMap:
:
get
)
.
map
(
addressMap:
:
get
)
.
orElse
(
""
);
.
orElse
(
Constants
.
EMPTY_CONTENT_EXCEL
);
return
VehicleMonitorConvert
.
buildStayPointListExport
(
stayPoint
,
commonInfo
,
search
.
getSn
(),
address
);
return
VehicleMonitorConvert
.
buildStayPointListExport
(
stayPoint
,
commonInfo
,
search
.
getSn
(),
address
);
})
})
.
collect
(
Collectors
.
toList
());
.
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