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 188f77df
authored
Jun 12, 2024
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
【ID1016881】 bug修复
1 parent
ccaff94f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
src/main/java/cn/com/glsx/admin/modules/model/vo/VehicleUsageAnalysisVO.java
src/main/java/cn/com/glsx/admin/modules/service/RiskAssessmentService.java
src/main/java/cn/com/glsx/admin/modules/model/vo/VehicleUsageAnalysisVO.java
View file @
188f77d
...
@@ -31,10 +31,9 @@ public class VehicleUsageAnalysisVO implements Serializable {
...
@@ -31,10 +31,9 @@ public class VehicleUsageAnalysisVO implements Serializable {
@ApiModelProperty
(
value
=
"活跃度等级对应提示语"
)
@ApiModelProperty
(
value
=
"活跃度等级对应提示语"
)
private
String
tips
;
private
String
tips
;
@ApiModelProperty
(
value
=
"使用天数。日期:天数,日期间隔:一周"
)
private
List
<
VehicleUsageAnalysisPointVO
>
daysOfVehicle
;
@ApiModelProperty
(
value
=
"日里程。日期:里程,里程单位km"
)
@ApiModelProperty
(
value
=
"日里程。日期:里程,里程单位km"
)
private
List
<
VehicleUsageAnalysisPointVO
>
mileage
;
private
List
<
VehicleUsageAnalysisPointVO
>
mileage
;
@ApiModelProperty
(
value
=
"使用天数。日期:天数,日期间隔:一周或一天"
)
private
List
<
VehicleUsageAnalysisPointVO
>
daysOfVehicle
;
}
}
src/main/java/cn/com/glsx/admin/modules/service/RiskAssessmentService.java
View file @
188f77d
...
@@ -841,14 +841,22 @@ public class RiskAssessmentService {
...
@@ -841,14 +841,22 @@ public class RiskAssessmentService {
}
}
//用车天数 最后定位日期-激活日期
//用车天数 最后定位日期-激活日期
Example
locationExample
=
new
Example
.
Builder
(
DeviceLocation
.
class
).
where
(
WeekendSqls
.<
DeviceLocation
>
custom
()
Vehicle
vehicle
=
vehicleMapper
.
selectById
(
vehicleId
);
.
andEqualTo
(
DeviceLocation:
:
getSn
,
sn
)).
build
();
FinalPositioningSearch
search
=
new
FinalPositioningSearch
();
DeviceLocation
deviceLocation
=
deviceLocationMapper
.
selectOneByExample
(
locationExample
);
search
.
setKeywords
(
vehicle
.
getVin
());
if
(
Objects
.
nonNull
(
deviceLocation
))
{
search
.
setPageNumber
(
1
);
Date
locationDate
=
DateUtil
.
getMaxDate
(
deviceLocation
.
getLastGpsTime
(),
deviceLocation
.
getLastBsTime
());
search
.
setPageSize
(
10
);
int
daysOfUsage
=
(
int
)
cn
.
hutool
.
core
.
date
.
DateUtil
.
between
(
activeDate
,
locationDate
,
DateUnit
.
DAY
);
List
<
FinalPositioningExport
>
finalPositioningList
=
finalPositioningService
.
findFinalPositioningList
(
search
);
if
(
CollectionUtils
.
isNotEmpty
(
finalPositioningList
))
{
Map
<
String
,
FinalPositioningExport
>
snLocationMap
=
finalPositioningList
.
stream
().
collect
(
Collectors
.
toMap
(
FinalPositioningExport:
:
getSn
,
Function
.
identity
(),
(
o
,
n
)
->
n
));
FinalPositioningExport
finalPosition
=
snLocationMap
.
get
(
sn
);
if
(
Objects
.
nonNull
(
finalPosition
))
{
int
daysOfUsage
=
(
int
)
cn
.
hutool
.
core
.
date
.
DateUtil
.
between
(
activeDate
,
DateUtil
.
parseDate
(
finalPosition
.
getLastPoiTime
()),
DateUnit
.
DAY
);
analysisVO
.
setDays
(
daysOfUsage
);
analysisVO
.
setDays
(
daysOfUsage
);
}
else
{
}
}
if
(
Objects
.
isNull
(
analysisVO
.
getDays
()))
{
analysisVO
.
setDays
(
0
);
analysisVO
.
setDays
(
0
);
}
}
...
...
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