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
67bbaf0a
Commit
67bbaf0a
authored
May 30, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 交通流量添加详细事件戳
parent
f674a444
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
RunningEvaluateServiceImpl.java
...et/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
+7
-3
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/RunningEvaluateServiceImpl.java
View file @
67bbaf0a
...
@@ -431,7 +431,6 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -431,7 +431,6 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
private
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
buildMetricsList
(
private
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
buildMetricsList
(
List
<
MetricHistDTO
>
metricHistDTOList
,
Integer
minutes
)
{
List
<
MetricHistDTO
>
metricHistDTOList
,
Integer
minutes
)
{
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
res
=
new
ArrayList
<>();
// 按时间段分组
// 按时间段分组
Map
<
String
,
List
<
MetricHistDTO
>>
groupedByTime
=
metricHistDTOList
.
stream
()
Map
<
String
,
List
<
MetricHistDTO
>>
groupedByTime
=
metricHistDTOList
.
stream
()
...
@@ -449,9 +448,9 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -449,9 +448,9 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
// 获取时间段数组
// 获取时间段数组
List
<
String
>
minuteSectionArray
=
TimeArrayUtil
.
getMinuteSectionArray
(
minutes
);
List
<
String
>
minuteSectionArray
=
TimeArrayUtil
.
getMinuteSectionArray
(
minutes
);
// 计算指标
// 计算指标
List
<
RunningEvaluateMetricsDetailVO
.
CrossMetrics
>
res
=
new
ArrayList
<>();
for
(
String
section
:
minuteSectionArray
)
{
for
(
String
section
:
minuteSectionArray
)
{
RunningEvaluateMetricsDetailVO
.
CrossMetrics
crossMetrics
=
new
RunningEvaluateMetricsDetailVO
.
CrossMetrics
();
RunningEvaluateMetricsDetailVO
.
CrossMetrics
crossMetrics
=
new
RunningEvaluateMetricsDetailVO
.
CrossMetrics
();
crossMetrics
.
setMetricTime
(
section
);
List
<
MetricHistDTO
>
dtoList
=
groupedByTime
.
get
(
section
);
List
<
MetricHistDTO
>
dtoList
=
groupedByTime
.
get
(
section
);
if
(
CollectionUtil
.
isNotEmpty
(
dtoList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
dtoList
))
{
int
flowSum
=
0
;
int
flowSum
=
0
;
...
@@ -489,7 +488,12 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
...
@@ -489,7 +488,12 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
crossMetrics
.
setDelayTime
(
delayTimeSum
/
size
);
crossMetrics
.
setDelayTime
(
delayTimeSum
/
size
);
crossMetrics
.
setEffusionRate
(
effusionRateSum
/
size
);
crossMetrics
.
setEffusionRate
(
effusionRateSum
/
size
);
crossMetrics
.
setEmptyPhase
(
emptyPhaseSum
);
crossMetrics
.
setEmptyPhase
(
emptyPhaseSum
);
crossMetrics
.
setTimeStamp
(
dtoList
.
get
(
0
).
getStartTime
());
Date
currentDate
=
dtoList
.
get
(
0
).
getStartTime
();
Calendar
instance
=
Calendar
.
getInstance
();
instance
.
setTime
(
currentDate
);
instance
.
set
(
Calendar
.
HOUR_OF_DAY
,
Integer
.
parseInt
(
section
.
substring
(
0
,
2
)));
crossMetrics
.
setTimeStamp
(
instance
.
getTime
());
crossMetrics
.
setMetricTime
(
section
);
}
}
res
.
add
(
crossMetrics
);
res
.
add
(
crossMetrics
);
}
}
...
...
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