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
65991591
Commit
65991591
authored
Feb 10, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波策略列表优化,添加周期状态
parent
e13aa51d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
23 deletions
+30
-23
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+30
-23
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
65991591
...
...
@@ -17,16 +17,14 @@ import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper;
import
net.wanji.databus.dao.mapper.GreenwaveInfoMapper
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.vo.AbnormalCrossListVO
;
import
net.wanji.databus.vo.GreenwaveListVO
;
import
net.wanji.opt.cache.BaseCrossInfoCache
;
import
net.wanji.opt.cache.GreenWaveInfoCache
;
import
net.wanji.opt.common.enums.EventStatusEnum
;
import
net.wanji.opt.common.enums.GreenBeltDirEnum
;
import
net.wanji.opt.common.enums.StrategyControlEnum
;
import
net.wanji.opt.dao.mapper.*
;
import
net.wanji.opt.dto.StrategyOptCountDTO
;
import
net.wanji.opt.dto.StrategyOptTimesDTO
;
import
net.wanji.opt.po.StrategyGreenOptHistEntity
;
import
net.wanji.opt.po.trend.HoloEventInfoPO
;
import
net.wanji.opt.synthesis.enums.StrategyCrossAlgoEnum
;
import
net.wanji.opt.synthesis.pojo.*
;
import
net.wanji.opt.synthesis.pojo.vo.*
;
...
...
@@ -358,24 +356,33 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
// 干线
if
(
Objects
.
equals
(
1
,
type
))
{
List
<
GreenwaveInfoPO
>
greenwaveInfoPOS
=
greenwaveInfoMapper
.
selectAll
();
if
(!
CollectionUtils
.
isEmpty
(
greenwaveInfoPOS
))
{
for
(
GreenwaveInfoPO
greenwaveInfoPO
:
greenwaveInfoPOS
)
{
List
<
GreenwaveListVO
>
greenwaveListVOS
=
greenwaveInfoMapper
.
listGreenwave
(
null
,
null
,
null
);
Map
<
Integer
,
Optional
<
GreenwaveListVO
>>
groupMap
=
greenwaveListVOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
GreenwaveListVO:
:
getId
,
Collectors
.
maxBy
(
Comparator
.
comparingInt
(
GreenwaveListVO:
:
getRealtimeStatus
))));
String
currenGreenId
=
null
;
Integer
currentStatus
=
0
;
for
(
Map
.
Entry
<
Integer
,
Optional
<
GreenwaveListVO
>>
entry
:
groupMap
.
entrySet
())
{
Optional
<
GreenwaveListVO
>
value
=
entry
.
getValue
();
GreenwaveListVO
greenwaveListVO
=
value
.
get
();
String
greenId
=
String
.
valueOf
(
entry
.
getKey
());
StrategyControlDataEntity
strategyControlDataEntity
=
new
StrategyControlDataEntity
();
String
greenId
=
String
.
valueOf
(
greenwaveInfoPO
.
getId
());
strategyControlDataEntity
.
setBizType
(
1
);
strategyControlDataEntity
.
setBizId
(
String
.
valueOf
(
greenId
));
strategyControlDataEntity
.
setStrategy
(
8
);
strategyControlDataEntity
.
setTime
(
null
);
strategyControlDataEntity
.
setStatus
(
0
);
Integer
status
=
greenwaveListVO
.
getRealtimeStatus
();
if
(
map
.
containsKey
(
greenId
))
{
strategyControlDataEntity
=
map
.
get
(
greenId
);
}
strategyControlDataEntity
.
setCrossName
(
greenwaveInfoPO
.
getName
());
strategyControlDataEntity
.
setWkt
(
greenwaveInfoPO
.
getWkt
());
strategyControlDataEntity
.
setStatus
(
status
);
if
(
StringUtils
.
equals
(
greenId
,
currenGreenId
)
&&
status
>
currentStatus
)
{
strategyControlDataEntity
.
setStatus
(
greenwaveListVO
.
getRealtimeStatus
());
}
strategyControlDataEntity
.
setBizType
(
1
);
strategyControlDataEntity
.
setBizId
(
String
.
valueOf
(
greenId
));
strategyControlDataEntity
.
setStrategy
(
8
);
strategyControlDataEntity
.
setCrossName
(
greenwaveListVO
.
getName
());
strategyControlDataEntity
.
setWkt
(
greenwaveListVO
.
getWkt
());
strategyControlDataEntity
.
setOptMethod
(
"效率提升"
);
results
.
add
(
strategyControlDataEntity
);
}
currenGreenId
=
greenId
;
currentStatus
=
status
;
}
}
return
JsonViewObject
.
newInstance
().
success
(
results
);
...
...
@@ -499,10 +506,10 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Integer
controlMethod
=
entity
.
getControlMethod
();
if
(
Objects
.
equals
(-
1
,
controlMethod
))
{
ext
.
setStatus
(
0
);
ext
.
setOptStatus
(
"
优化中
"
);
ext
.
setOptStatus
(
"
未优化
"
);
}
else
{
ext
.
setStatus
(
1
);
ext
.
setOptStatus
(
"
未优化
"
);
ext
.
setOptStatus
(
"
优化中
"
);
}
Map
<
Integer
,
GreenwaveInfoPO
>
greenWaveMap
=
GreenWaveInfoCache
.
greenWaveMap
;
GreenwaveInfoPO
greenwaveInfoPO
=
greenWaveMap
.
get
(
greenId
);
...
...
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