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
f39f08bc
Commit
f39f08bc
authored
Feb 25, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 路口优化列表优化状态优化;策略保存优化运行计划删除逻辑
parent
102acda8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+9
-4
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
f39f08bc
...
...
@@ -679,10 +679,15 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Integer
currentAlgo
=
entity
.
getCurrentAlgo
();
Date
issueTime
=
entity
.
getIssueTime
();
Date
current
=
new
Date
();
Integer
duration
=
entity
.
getDuration
();
// 优化时间大于5分钟,默认优化完
if
(
Objects
.
nonNull
(
issueTime
)
&&
current
.
getTime
()
-
issueTime
.
getTime
()
>
5
*
60
*
1000
)
{
currentAlgo
=
null
;
// 计算结束时间
if
(
Objects
.
nonNull
(
issueTime
))
{
if
(
Objects
.
equals
(
2
,
currentAlgo
)
&&
current
.
getTime
()
-
issueTime
.
getTime
()
-
duration
*
1000
>
0
)
{
currentAlgo
=
null
;
}
else
if
(
current
.
getTime
()
-
issueTime
.
getTime
()
>
10
*
1000
)
{
currentAlgo
=
null
;
}
}
// 0无策略
...
...
@@ -835,6 +840,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
StrategyControlDetailList
.
ExecutePlan
executePlan
=
plans
.
get
(
0
);
LambdaQueryWrapper
<
StrategyPlanInfoEntity
>
planDel
=
new
LambdaQueryWrapper
<>();
planDel
.
eq
(
StrategyPlanInfoEntity:
:
getCrossId
,
executePlan
.
getCrossId
());
strategyPlanInfoMapper
.
delete
(
planDel
);
for
(
StrategyControlDetailList
.
ExecutePlan
plan
:
plans
)
{
StrategyPlanInfoEntity
planInfoEntity
=
new
StrategyPlanInfoEntity
();
planInfoEntity
.
setPlanId
(
plan
.
getPlanId
());
...
...
@@ -845,7 +851,6 @@ public class StrategyControlServiceImpl implements StrategyControlService {
planInfoEntity
.
setCompany
(
plan
.
getCompany
());
planInfoEntity
.
setName
(
plan
.
getName
());
planInfoEntity
.
setPlanDetails
(
mapper
.
writeValueAsString
(
plan
.
getPlanDetails
()));
strategyPlanInfoMapper
.
delete
(
planDel
);
strategyPlanInfoMapper
.
insert
(
planInfoEntity
);
}
}
...
...
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