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
e0f9499b
Commit
e0f9499b
authored
Dec 15, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略管理路口状态优化
parent
622e3d8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+13
-14
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
e0f9499b
...
@@ -14,9 +14,10 @@ import net.wanji.common.framework.rest.JsonViewObject;
...
@@ -14,9 +14,10 @@ import net.wanji.common.framework.rest.JsonViewObject;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.common.utils.tool.JacksonUtils
;
import
net.wanji.databus.dao.entity.GreenwaveInfoPO
;
import
net.wanji.databus.dao.entity.GreenwaveInfoPO
;
import
net.wanji.databus.dao.mapper.BaseCrossInfoMapper
;
import
net.wanji.databus.dao.mapper.BaseCrossInfoMapper
;
import
net.wanji.databus.dao.mapper.CrossDataRealtimeMapper
;
import
net.wanji.databus.dao.mapper.GreenwaveInfoMapper
;
import
net.wanji.databus.dao.mapper.GreenwaveInfoMapper
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.
po.TBaseCrossInfo
;
import
net.wanji.databus.
vo.AbnormalCrossListVO
;
import
net.wanji.opt.cache.BaseCrossInfoCache
;
import
net.wanji.opt.cache.BaseCrossInfoCache
;
import
net.wanji.opt.cache.GreenWaveInfoCache
;
import
net.wanji.opt.cache.GreenWaveInfoCache
;
import
net.wanji.opt.common.enums.StrategyControlEnum
;
import
net.wanji.opt.common.enums.StrategyControlEnum
;
...
@@ -73,6 +74,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -73,6 +74,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
private
StrategyCrossResultMapper
strategyCrossResultMapper
;
private
StrategyCrossResultMapper
strategyCrossResultMapper
;
@Resource
@Resource
private
BaseCrossInfoCache
baseCrossInfoCache
;
private
BaseCrossInfoCache
baseCrossInfoCache
;
@Resource
private
CrossDataRealtimeMapper
crossDataRealtimeMapper
;
@Override
@Override
...
@@ -255,25 +258,21 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -255,25 +258,21 @@ public class StrategyControlServiceImpl implements StrategyControlService {
Map
<
String
,
StrategyControlDataEntity
>
map
=
runList
.
stream
().
collect
(
Collectors
.
toMap
(
StrategyControlDataEntity:
:
getBizId
,
entity
->
entity
));
Map
<
String
,
StrategyControlDataEntity
>
map
=
runList
.
stream
().
collect
(
Collectors
.
toMap
(
StrategyControlDataEntity:
:
getBizId
,
entity
->
entity
));
// 路口
// 路口
if
(
Objects
.
equals
(
0
,
type
))
{
if
(
Objects
.
equals
(
0
,
type
))
{
LambdaQueryWrapper
<
TBaseCrossInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
List
<
AbnormalCrossListVO
>
abnormalCrossListVOS
=
crossDataRealtimeMapper
.
selectAbnormalCross
(
null
,
null
,
null
);
queryWrapper
.
eq
(
TBaseCrossInfo:
:
getIsSignal
,
1
);
if
(!
CollectionUtils
.
isEmpty
(
abnormalCrossListVOS
))
{
List
<
TBaseCrossInfo
>
baseCrossInfoPOS
=
baseCrossInfoMapper
.
selectList
(
queryWrapper
);
for
(
AbnormalCrossListVO
baseCrossInfoPO
:
abnormalCrossListVOS
)
{
if
(!
CollectionUtils
.
isEmpty
(
baseCrossInfoPOS
))
{
for
(
TBaseCrossInfo
baseCrossInfoPO
:
baseCrossInfoPOS
)
{
StrategyControlDataEntity
strategyControlDataEntity
=
new
StrategyControlDataEntity
();
StrategyControlDataEntity
strategyControlDataEntity
=
new
StrategyControlDataEntity
();
String
crossId
=
baseCrossInfoPO
.
getId
();
String
crossId
=
baseCrossInfoPO
.
getId
();
strategyControlDataEntity
.
setBizType
(
0
);
strategyControlDataEntity
.
setBizType
(
0
);
strategyControlDataEntity
.
setBizId
(
baseCrossInfoPO
.
getId
()
);
strategyControlDataEntity
.
setBizId
(
crossId
);
// 转化成 0 畅通 1失衡 2拥堵 3溢出 4死锁 5空放 6干线拥堵 7干线缓行 8干线畅通
// 转化成 0 畅通 1失衡 2拥堵 3溢出 4死锁 5空放 6干线拥堵 7干线缓行 8干线畅通
strategyControlDataEntity
.
setStrategy
(
0
);
Integer
status
=
baseCrossInfoPO
.
getRealtimeStatus
();
strategyControlDataEntity
.
setOptMethod
(
"均衡调控"
);
strategyControlDataEntity
.
setStrategy
(
status
);
strategyControlDataEntity
.
setOptMethod
(
Objects
.
equals
(
1
,
status
)
?
"均衡调控"
:
"效率提升"
);
strategyControlDataEntity
.
setTime
(
null
);
strategyControlDataEntity
.
setTime
(
null
);
strategyControlDataEntity
.
setStatus
(
0
);
strategyControlDataEntity
.
setStatus
(
status
);
if
(
map
.
containsKey
(
crossId
))
{
strategyControlDataEntity
=
map
.
get
(
crossId
);
}
strategyControlDataEntity
.
setCrossName
(
baseCrossInfoPO
.
getName
());
strategyControlDataEntity
.
setCrossName
(
baseCrossInfoPO
.
getName
());
String
location
=
baseCrossInfoPO
.
getLocation
();
String
location
=
baseCrossInfoPO
.
getLocation
Str
();
location
=
location
.
replace
(
"POINT("
,
""
).
replace
(
" "
,
","
).
replace
(
")"
,
""
);
location
=
location
.
replace
(
"POINT("
,
""
).
replace
(
" "
,
","
).
replace
(
")"
,
""
);
strategyControlDataEntity
.
setWkt
(
location
);
strategyControlDataEntity
.
setWkt
(
location
);
results
.
add
(
strategyControlDataEntity
);
results
.
add
(
strategyControlDataEntity
);
...
...
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