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
ee464c96
Commit
ee464c96
authored
Dec 09, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 策略列表添加优化方法
parent
7d64ed1d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
StrategyControlEnum.java
.../java/net/wanji/opt/common/enums/StrategyControlEnum.java
+16
-4
StrategyControlController.java
...i/opt/synthesis/controller/StrategyControlController.java
+1
-1
StrategyControlDataExt.java
.../net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
+1
-0
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+2
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/common/enums/StrategyControlEnum.java
View file @
ee464c96
...
...
@@ -10,13 +10,16 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public
enum
StrategyControlEnum
{
ZERO
(
0
,
"绿波带"
),
ONE
(
1
,
"失衡"
),
TWO
(
2
,
"溢出"
),
THREE
(
3
,
"空放"
);
ZERO
(
0
,
"绿波带"
,
"效率提升"
),
ONE
(
1
,
"失衡"
,
"均衡调控"
),
TWO
(
2
,
"溢出"
,
"效率提升"
),
THREE
(
3
,
"空放"
,
"效率提升"
),
FOUR
(
4
,
"拥堵"
,
"效率提升"
),
FIVE
(
5
,
"畅通"
,
"畅通"
);
private
int
code
;
private
String
desc
;
private
String
method
;
public
static
String
getDesc
(
int
code
)
{
for
(
StrategyControlEnum
value
:
StrategyControlEnum
.
values
())
{
...
...
@@ -24,6 +27,15 @@ public enum StrategyControlEnum {
return
value
.
getDesc
();
}
}
return
StrategyControlEnum
.
FIVE
.
getDesc
();
}
public
static
String
getMethod
(
int
code
)
{
for
(
StrategyControlEnum
value
:
StrategyControlEnum
.
values
())
{
if
(
code
==
value
.
getCode
())
{
return
value
.
getMethod
();
}
}
return
""
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/controller/StrategyControlController.java
View file @
ee464c96
...
...
@@ -88,7 +88,7 @@ public class StrategyControlController {
return
strategyControlService
.
strategyOptTimes
();
}
@ApiOperation
(
value
=
"路网优化监测-
接
口干线列表"
,
notes
=
"路网优化监测-AI路口-AI干线"
,
@ApiOperation
(
value
=
"路网优化监测-
路
口干线列表"
,
notes
=
"路网优化监测-AI路口-AI干线"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@GetMapping
(
value
=
"/crossOptInfoList"
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/pojo/StrategyControlDataExt.java
View file @
ee464c96
...
...
@@ -10,4 +10,5 @@ import lombok.Data;
public
class
StrategyControlDataExt
extends
StrategyControlDataEntity
{
private
String
strategyName
;
private
String
optStatus
;
private
String
optMethod
;
}
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
ee464c96
...
...
@@ -406,6 +406,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
StrategyControlDataExt
strategyControlDataExt
=
new
StrategyControlDataExt
();
BeanUtils
.
copyProperties
(
strategyControlDataEntity
,
strategyControlDataExt
);
strategyControlDataExt
.
setStrategyName
(
StrategyControlEnum
.
getDesc
(
strategy
));
strategyControlDataExt
.
setOptMethod
(
StrategyControlEnum
.
getMethod
(
strategy
));
if
(
StringUtils
.
isNotBlank
(
strategyControlDataEntity
.
getTime
()))
{
strategyControlDataExt
.
setOptStatus
(
"优化中"
);
strategyControlDataExts
.
add
(
strategyControlDataExt
);
...
...
@@ -419,6 +420,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
ext
.
setBizId
(
baseCrossInfoPO
.
getId
());
ext
.
setStrategyName
(
"无策略"
);
ext
.
setOptStatus
(
"未优化"
);
ext
.
setOptMethod
(
"畅通"
);
ext
.
setStatus
(
0
);
for
(
StrategyControlDataExt
strategyControlDataExt
:
strategyControlDataExts
)
{
if
(
StringUtils
.
equals
(
baseCrossInfoPO
.
getId
(),
strategyControlDataExt
.
getBizId
()))
{
...
...
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