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 872df3df
authored
Oct 28, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
V1.3.0需求开发-试驾详情
1 parent
8ae95316
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
src/main/java/cn/com/glsx/admin/modules/model/export/TrialDriveReportDetailExport.java
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
src/main/resources/mapper/TrialDriveReportMapper.xml
src/main/java/cn/com/glsx/admin/modules/model/export/TrialDriveReportDetailExport.java
View file @
872df3d
...
@@ -13,7 +13,7 @@ public class TrialDriveReportDetailExport {
...
@@ -13,7 +13,7 @@ public class TrialDriveReportDetailExport {
@ExcelIgnore
@ExcelIgnore
private
Long
vdId
;
private
Long
vdId
;
@ExcelProperty
(
value
=
"特约店
账号
"
,
index
=
0
)
@ExcelProperty
(
value
=
"特约店
编码
"
,
index
=
0
)
private
String
account
;
private
String
account
;
@ExcelProperty
(
value
=
"特约店名称"
,
index
=
1
)
@ExcelProperty
(
value
=
"特约店名称"
,
index
=
1
)
...
@@ -42,16 +42,19 @@ public class TrialDriveReportDetailExport {
...
@@ -42,16 +42,19 @@ public class TrialDriveReportDetailExport {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
journeyEndTime
;
private
Date
journeyEndTime
;
@ExcelIgnore
@ExcelProperty
(
value
=
"试驾时长"
,
index
=
9
)
private
String
journeyTime
;
@ExcelProperty
(
value
=
"试驾里程(KM)"
,
index
=
10
)
private
Integer
totalMileage
;
private
Integer
totalMileage
;
@ExcelIgnore
@ExcelIgnore
private
Integer
percent
;
private
Integer
percent
;
@ExcelProperty
(
value
=
"是否有效"
,
index
=
9
)
@ExcelProperty
(
value
=
"是否有效"
,
index
=
11
)
private
String
valid
;
private
String
valid
;
@ExcelProperty
(
value
=
"无效原因"
,
index
=
1
0
)
@ExcelProperty
(
value
=
"无效原因"
,
index
=
1
2
)
private
String
reason
;
private
String
reason
;
}
}
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
View file @
872df3d
...
@@ -12,6 +12,11 @@ import org.apache.commons.collections.CollectionUtils;
...
@@ -12,6 +12,11 @@ import org.apache.commons.collections.CollectionUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -265,6 +270,15 @@ public class TrialDriveReportService {
...
@@ -265,6 +270,15 @@ public class TrialDriveReportService {
public
List
<
TrialDriveReportDetailExport
>
detailExport
(
TrialDriveReportSearch
search
)
{
public
List
<
TrialDriveReportDetailExport
>
detailExport
(
TrialDriveReportSearch
search
)
{
List
<
TrialDriveReportDetailExport
>
list
=
trialDriveReportMapper
.
detailExport
(
search
);
List
<
TrialDriveReportDetailExport
>
list
=
trialDriveReportMapper
.
detailExport
(
search
);
list
.
forEach
(
tdrd
->
{
list
.
forEach
(
tdrd
->
{
ZonedDateTime
beginTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
tdrd
.
getJourneyBeginTime
().
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
ZonedDateTime
endTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
tdrd
.
getJourneyEndTime
().
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
Duration
duration
=
Duration
.
between
(
beginTime
,
endTime
).
abs
();
long
hour
=
duration
.
getSeconds
()
/
ChronoUnit
.
HOURS
.
getDuration
().
getSeconds
();
long
minute
=
(
duration
.
getSeconds
()
-
ChronoUnit
.
HOURS
.
getDuration
().
getSeconds
()
*
hour
)
/
ChronoUnit
.
MINUTES
.
getDuration
().
getSeconds
();
long
second
=
(
duration
.
getSeconds
()
-
ChronoUnit
.
HOURS
.
getDuration
().
getSeconds
()
*
hour
)
-
minute
*
ChronoUnit
.
MINUTES
.
getDuration
().
getSeconds
();
tdrd
.
setJourneyTime
(
String
.
format
(
"%d小时%d分%d秒"
,
hour
,
minute
,
second
));
boolean
valid
=
tdrd
.
getPercent
()
>=
50
;
boolean
valid
=
tdrd
.
getPercent
()
>=
50
;
tdrd
.
setValid
(
valid
?
"是"
:
"否"
);
tdrd
.
setValid
(
valid
?
"是"
:
"否"
);
tdrd
.
setReason
(
valid
?
""
:
"试驾线路重合度低于标准值"
);
tdrd
.
setReason
(
valid
?
""
:
"试驾线路重合度低于标准值"
);
...
...
src/main/resources/mapper/TrialDriveReportMapper.xml
View file @
872df3d
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
tv.type_name typeName,
tv.type_name typeName,
journey_time journeyBeginTime,
journey_time journeyBeginTime,
journey_end_time journeyEndTime,
journey_end_time journeyEndTime,
total_mileage totalMileage,
total_mileage
/1000
totalMileage,
percent
percent
from t_electric_fence_drive tefd
from t_electric_fence_drive tefd
left join t_vehicle_device tvd on tvd.id = tefd.vd_id
left join t_vehicle_device tvd on tvd.id = tefd.vd_id
...
...
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