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
jinan
traffic-signal-platform
Commits
275a0db4
Commit
275a0db4
authored
Mar 15, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 路口干线监测增加缓存
parent
e81c1ce7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
TrendServiceV2Impl.java
...va/net/wanji/opt/servicev2/implv2/TrendServiceV2Impl.java
+20
-5
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/implv2/TrendServiceV2Impl.java
View file @
275a0db4
...
...
@@ -51,6 +51,9 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
@Resource
private
StrategyGreenOptHistMapper
greenOptHistMapper
;
private
static
List
<
OptMonitoringVO
>
greenListCache
=
new
ArrayList
<>(
10
);
private
static
List
<
OptMonitoringVO
>
crossListCache
=
new
ArrayList
<>(
80
);
@Override
public
List
<
CrossGreenStatusTimeRateVO
>
crossGreenStatusTimeRate
()
{
List
<
CrossGreenStatusTimeRateVO
>
crossGreenStatusTimeRateVOS
=
holoEventMapper
.
selectCrossGreenStatusTimeRate
();
...
...
@@ -204,6 +207,7 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
}
}
});
greenListCache
=
optMonitoringVOS
;
return
optMonitoringVOS
;
}
...
...
@@ -216,14 +220,14 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
String
crossId
=
optMonitoringVO
.
getId
();
for
(
CrossLastOptResultDTO
optResultDTO
:
optResultDTOS
)
{
String
id
=
optResultDTO
.
getId
();
String
type
=
optMonitoringVO
.
getType
();
optMonitoringVO
.
setTypeDesc
(
EventInfoTypeEnum
.
getOptDesc
(
type
));
if
(
StringUtils
.
endsWithIgnoreCase
(
id
,
crossId
))
{
Date
optTime
=
optResultDTO
.
getOptTime
();
Integer
duration
=
optResultDTO
.
getDuration
();
String
type
=
optResultDTO
.
getType
();
// 优化时间计算
optMonitoringVO
.
setOptTime
(
optTime
);
optMonitoringVO
.
setOptStatus
(
0
);
optMonitoringVO
.
setTypeDesc
(
EventInfoTypeEnum
.
getOptDesc
(
type
));
if
(
Objects
.
nonNull
(
optTime
))
{
// 空放优化中,6秒钟结束,当前时间小于开始时间+持续时间
if
(
Objects
.
equals
(
EventInfoTypeEnum
.
PHASE_EMPTY
.
getEventType
(),
type
)
&&
(
current
-
optTime
.
getTime
()
>
6
*
1000
))
{
...
...
@@ -238,14 +242,25 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
}
}
});
crossListCache
=
optMonitoringVOS
;
return
optMonitoringVOS
;
}
@Override
public
List
<
OptMonitoringVO
>
eventAlarmRealTimeList
()
throws
Exception
{
List
<
OptMonitoringVO
>
results
=
new
ArrayList
<>(
80
);
List
<
OptMonitoringVO
>
greenList
=
crossOptMonitoringList
();
List
<
OptMonitoringVO
>
crossList
=
greenOptMonitoringList
();
List
<
OptMonitoringVO
>
results
=
new
ArrayList
<>(
90
);
List
<
OptMonitoringVO
>
greenList
=
new
ArrayList
<>(
10
);
List
<
OptMonitoringVO
>
crossList
=
new
ArrayList
<>(
80
);
if
(!
CollectionUtils
.
isEmpty
(
greenListCache
))
{
greenList
=
greenListCache
;
}
else
{
greenList
=
greenOptMonitoringList
();
}
if
(!
CollectionUtils
.
isEmpty
(
crossListCache
))
{
crossList
=
crossListCache
;
}
else
{
crossList
=
crossOptMonitoringList
();
}
results
.
addAll
(
greenList
);
results
.
addAll
(
crossList
);
List
<
OptMonitoringVO
>
sort
=
results
.
stream
().
sorted
(
Comparator
.
comparing
(
OptMonitoringVO:
:
getStartTime
).
reversed
()).
collect
(
Collectors
.
toList
());
...
...
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