Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
signal
traffic-signal-platform
Commits
8f15e50d
Commit
8f15e50d
authored
Sep 15, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 新信号评价-修改运行评价热力图方向处理方式
parent
58a94e96
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
RunningEvaluateServiceImpl.java
...et/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
+17
-3
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
View file @
8f15e50d
...
@@ -535,10 +535,24 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -535,10 +535,24 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
default
:
default
:
throw
new
IllegalArgumentException
(
"状态值非法"
);
throw
new
IllegalArgumentException
(
"状态值非法"
);
}
}
// 过滤 status 字段值为 status 变量的对象,并按照
选择的字段
分组
// 过滤 status 字段值为 status 变量的对象,并按照
方向
分组
Map
<
String
,
List
<
CrossDataHistPO
>>
grouped
=
crossDataHistPOList
.
stream
()
Map
<
String
,
List
<
CrossDataHistPO
>>
grouped
=
crossDataHistPOList
.
stream
()
.
filter
(
po
->
status
.
equals
(
po
.
getStatus
()))
.
flatMap
(
po
->
{
.
collect
(
Collectors
.
groupingBy
(
groupByField
));
String
dirs
=
""
;
if
(
status
==
1
)
{
dirs
=
po
.
getUnbalanceDirs
();
}
else
if
(
status
==
2
)
{
dirs
=
po
.
getCongestionDirs
();
}
else
if
(
status
==
3
)
{
dirs
=
po
.
getSpilloverDirs
();
}
return
Arrays
.
stream
(
dirs
.
split
(
","
))
.
map
(
dir
->
new
AbstractMap
.
SimpleEntry
<>(
dir
,
po
));
})
.
collect
(
Collectors
.
groupingBy
(
Map
.
Entry
::
getKey
,
Collectors
.
mapping
(
Map
.
Entry
::
getValue
,
Collectors
.
toList
())
));
// 对每个组进行处理,仅保留 start_time 相同的记录中 duration 最大的一条
// 对每个组进行处理,仅保留 start_time 相同的记录中 duration 最大的一条
Map
<
String
,
List
<
CrossDataHistPO
>>
filteredGrouped
=
grouped
.
entrySet
().
stream
()
Map
<
String
,
List
<
CrossDataHistPO
>>
filteredGrouped
=
grouped
.
entrySet
().
stream
()
.
collect
(
Collectors
.
toMap
(
.
collect
(
Collectors
.
toMap
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment