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
8338777b
Commit
8338777b
authored
Mar 12, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 代码优化
parent
2930a9cf
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
416 additions
and
396 deletions
+416
-396
StrategyControlDataExt.java
.../net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
+0
-4
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+26
-2
InducesMonitorTask.java
.../src/main/java/net/wanji/opt/task/InducesMonitorTask.java
+390
-390
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
View file @
8338777b
...
...
@@ -14,8 +14,4 @@ public class StrategyControlDataExt extends StrategyControlDataEntity{
private
String
optStatus
;
@ApiModelProperty
(
value
=
"策略类型"
)
private
String
optMethod
;
@ApiModelProperty
(
value
=
"交通指数"
)
private
Double
trafficIndex
;
@ApiModelProperty
(
value
=
"排队长度"
)
private
int
queueLength
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
8338777b
...
...
@@ -30,6 +30,7 @@ import net.wanji.opt.synthesis.service.PushStrategyControlService;
import
net.wanji.opt.synthesis.service.StrategyControlService
;
import
net.wanji.opt.vo.StrategyLockSendVO
;
import
net.wanji.opt.vo.StrategyNameCrossVO
;
import
net.wanji.opt.vo2.OptMonitoringVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -581,7 +582,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Date
date
=
Date
.
from
(
startOfDay
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
());
List
<
StrategyControlDataExt
>
results
=
new
ArrayList
<>();
if
(
Objects
.
equals
(
0
,
type
))
{
results
=
getCrossList
(
date
);
results
=
getCrossList
();
}
if
(
Objects
.
equals
(
1
,
type
))
{
results
=
getGreenList
(
date
);
...
...
@@ -661,12 +662,27 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
// 添加逻辑,事件类型
List
<
OptMonitoringVO
>
optMonitoringVOS
=
holoEventMapper
.
selectGreenOptMonitoringList
();
if
(!
CollectionUtils
.
isEmpty
(
optMonitoringVOS
))
{
for
(
OptMonitoringVO
optMonitoringVO
:
optMonitoringVOS
)
{
String
id
=
optMonitoringVO
.
getId
();
String
type
=
optMonitoringVO
.
getType
();
for
(
StrategyControlDataExt
result
:
results
)
{
String
bizId
=
result
.
getBizId
();
if
(
StringUtils
.
equals
(
id
,
bizId
))
{
result
.
setBizType
(
Integer
.
valueOf
(
type
));
}
}
}
}
Collections
.
sort
(
results
,
Comparator
.
comparingInt
(
StrategyControlDataExt:
:
getStatus
).
reversed
());
results
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
results
;
}
private
List
<
StrategyControlDataExt
>
getCrossList
(
Date
date
)
{
private
List
<
StrategyControlDataExt
>
getCrossList
()
{
List
<
StrategyControlDataExt
>
results
=
new
ArrayList
<>();
List
<
StrategyCrossResultEntity
>
resultList
=
strategyCrossResultMapper
.
selectAICrossList
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
resultList
))
{
...
...
@@ -695,12 +711,20 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if
(
Objects
.
isNull
(
currentAlgo
)
||
Objects
.
equals
(
0
,
currentAlgo
))
{
ext
.
setOptStatus
(
"正常"
);
ext
.
setOptMethod
(
"畅通"
);
ext
.
setBizType
(
700
);
}
else
if
(
Objects
.
equals
(
2
,
currentAlgo
))
{
ext
.
setOptStatus
(
"优化中"
);
ext
.
setOptMethod
(
"均衡调控"
);
ext
.
setBizType
(
702
);
}
else
{
ext
.
setOptStatus
(
"优化中"
);
ext
.
setOptMethod
(
"效率提升"
);
if
(
Objects
.
equals
(
1
,
currentAlgo
))
{
ext
.
setBizType
(
701
);
}
if
(
Objects
.
equals
(
3
,
currentAlgo
))
{
ext
.
setBizType
(
703
);
}
}
results
.
add
(
ext
);
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/task/InducesMonitorTask.java
View file @
8338777b
This diff is collapsed.
Click to expand it.
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