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
e890b951
Commit
e890b951
authored
Oct 10, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波评价-底部曲线图指标入参改为指标名称
parent
96119270
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
BottomCurveBO.java
...service/src/main/java/net/wanji/opt/bo/BottomCurveBO.java
+2
-2
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+2
-1
StrategyAndMetricsEnum.java
...n/java/net/wanji/common/enums/StrategyAndMetricsEnum.java
+9
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/bo/BottomCurveBO.java
View file @
e890b951
...
...
@@ -27,8 +27,8 @@ public class BottomCurveBO {
@ApiModelProperty
(
value
=
"时间粒度(分钟)"
)
private
Integer
minutes
;
@ApiModelProperty
(
value
=
"指标
编号
"
)
private
String
metric
Cod
e
;
@ApiModelProperty
(
value
=
"指标
名称
"
)
private
String
metric
Nam
e
;
@ApiModelProperty
(
value
=
"开始时间 格式 yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
e890b951
...
...
@@ -107,10 +107,11 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
Integer
scope
=
bo
.
getScope
();
List
<
String
>
scopeList
=
bo
.
getScopeList
();
Integer
minutes
=
bo
.
getMinutes
();
String
metric
Code
=
bo
.
getMetricCod
e
();
String
metric
Name
=
bo
.
getMetricNam
e
();
Date
startTime
=
bo
.
getStartTime
();
Date
endTime
=
bo
.
getEndTime
();
String
metricCode
=
StrategyAndMetricsEnum
.
Metrics
.
getCodeByName
(
metricName
);
if
(
scope
!=
1
&&
Objects
.
equals
(
metricCode
,
StrategyAndMetricsEnum
.
Metrics
.
LOAD_BALANCE
.
getCode
()))
{
throw
new
RuntimeException
(
"只有路口级别可选择负载均衡度"
);
}
...
...
wj-common/src/main/java/net/wanji/common/enums/StrategyAndMetricsEnum.java
View file @
e890b951
...
...
@@ -84,6 +84,15 @@ public class StrategyAndMetricsEnum {
return
null
;
}
public
static
String
getCodeByName
(
String
name
)
{
for
(
Metrics
value
:
Metrics
.
values
())
{
if
(
value
.
description
.
equals
(
name
))
{
return
value
.
code
;
}
}
return
null
;
}
public
static
Metrics
getEnumByCode
(
String
code
)
{
for
(
Metrics
value
:
Metrics
.
values
())
{
if
(
value
.
code
.
equals
(
code
))
{
...
...
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