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 8b9b9496
authored
May 11, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
排序
1 parent
1d60f733
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
View file @
8b9b949
...
@@ -394,6 +394,8 @@ public class VehicleMonitorService {
...
@@ -394,6 +394,8 @@ public class VehicleMonitorService {
/**
/**
* 查询并排序
* 查询并排序
*/
*/
public
static
final
String
BEGIN_TIME
=
"beginTime"
;
public
static
final
String
DURATION
=
"duration"
;
private
List
<
StayPointRecordDTO
>
getStayPointList
(
StayPointSearch
search
,
StayPointRequest
request
)
{
private
List
<
StayPointRecordDTO
>
getStayPointList
(
StayPointSearch
search
,
StayPointRequest
request
)
{
List
<
StayPointRecordDTO
>
stayPointRecord
=
remoteFeignStayPointService
.
getStayPointRecord
(
request
);
List
<
StayPointRecordDTO
>
stayPointRecord
=
remoteFeignStayPointService
.
getStayPointRecord
(
request
);
if
(
CollectionUtils
.
isEmpty
(
stayPointRecord
))
{
if
(
CollectionUtils
.
isEmpty
(
stayPointRecord
))
{
...
@@ -401,13 +403,13 @@ public class VehicleMonitorService {
...
@@ -401,13 +403,13 @@ public class VehicleMonitorService {
}
}
//排序
//排序
if
(
Objects
.
nonNull
(
search
.
getSort
())
&&
StringUtils
.
isNotBlank
(
search
.
getSort
().
getFiled
()))
{
if
(
Objects
.
nonNull
(
search
.
getSort
())
&&
StringUtils
.
isNotBlank
(
search
.
getSort
().
getFiled
()))
{
if
(
Objects
.
equals
(
search
.
getSort
().
getFiled
(),
"beginTime"
))
{
if
(
Objects
.
equals
(
search
.
getSort
().
getFiled
(),
BEGIN_TIME
))
{
stayPointRecord
=
stayPointRecord
.
stream
()
stayPointRecord
=
stayPointRecord
.
stream
()
.
sorted
(
Comparator
.
comparing
(
e
->
DateUtil
.
getTimestampMillisecond
(
e
.
getBeginTime
()),
.
sorted
(
Comparator
.
comparing
(
e
->
DateUtil
.
getTimestampMillisecond
(
e
.
getBeginTime
()),
CollectionSortUtil
.
order
(
search
.
getSort
().
getOrder
())))
CollectionSortUtil
.
order
(
search
.
getSort
().
getOrder
())))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
if
(
Objects
.
equals
(
search
.
getSort
().
getFiled
(),
"duration"
))
{
if
(
Objects
.
equals
(
search
.
getSort
().
getFiled
(),
DURATION
))
{
stayPointRecord
=
stayPointRecord
.
stream
()
stayPointRecord
=
stayPointRecord
.
stream
()
.
sorted
(
Comparator
.
comparing
(
StayPointRecordDTO:
:
getDuration
,
.
sorted
(
Comparator
.
comparing
(
StayPointRecordDTO:
:
getDuration
,
CollectionSortUtil
.
order
(
search
.
getSort
().
getOrder
())))
CollectionSortUtil
.
order
(
search
.
getSort
().
getOrder
())))
...
...
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