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 893b348d
authored
Oct 28, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
V1.3.0需求开发-试驾详情
1 parent
872df3df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
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/service/TrialDriveReportService.java
View file @
893b348
...
@@ -270,14 +270,8 @@ public class TrialDriveReportService {
...
@@ -270,14 +270,8 @@ 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
());
tdrd
.
setJourneyTime
(
getTrialDriveTime
(
tdrd
));
ZonedDateTime
endTime
=
ZonedDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
tdrd
.
getJourneyEndTime
().
toInstant
().
toEpochMilli
()),
ZoneId
.
systemDefault
());
tdrd
.
setTotalMileage
(
tdrd
.
getTotalMileage
()
!=
null
?
tdrd
.
getTotalMileage
()
/
1000
:
null
);
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
?
"是"
:
"否"
);
...
@@ -286,4 +280,17 @@ public class TrialDriveReportService {
...
@@ -286,4 +280,17 @@ public class TrialDriveReportService {
return
list
;
return
list
;
}
}
public
String
getTrialDriveTime
(
TrialDriveReportDetailExport
tdrd
)
{
if
(
tdrd
.
getJourneyEndTime
()
==
null
)
{
return
"--"
;
}
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
();
return
String
.
format
(
"%d小时%d分%d秒"
,
hour
,
minute
,
second
);
}
}
}
src/main/resources/mapper/TrialDriveReportMapper.xml
View file @
893b348
...
@@ -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
/1000
totalMileage,
total_mileage 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