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
jinan
traffic-signal-platform
Commits
2c4b7468
Commit
2c4b7468
authored
Apr 10, 2025
by
wangyecheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改方案评价溢出场景空放
parent
ac21b3be
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
185 additions
and
77 deletions
+185
-77
EvaluationInfoController.java
...opt/controllerv2/evaluation/EvaluationInfoController.java
+12
-6
CrossProblemEvaluationMapper.java
...t/dao/mapper/evaluation/CrossProblemEvaluationMapper.java
+4
-2
EventInfoSimplePo.java
...c/main/java/net/wanji/opt/po/trend/EventInfoSimplePo.java
+9
-0
EvaluationInfoService.java
...wanji/opt/servicev2/evaluation/EvaluationInfoService.java
+3
-3
EvaluationInfoServiceImpl.java
.../servicev2/evaluation/impl/EvaluationInfoServiceImpl.java
+98
-48
CrossProblemEvaluationMapper.xml
...ources/mapper/evaluation/CrossProblemEvaluationMapper.xml
+59
-18
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controllerv2/evaluation/EvaluationInfoController.java
View file @
2c4b7468
...
...
@@ -53,6 +53,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-溢出"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"evenType"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"currentAlgo"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
...
@@ -63,10 +65,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
})
public
JsonViewObject
summaryEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
JsonViewObject
summaryEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
summaryEvaluation
(
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
summaryEvaluation
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
...
...
@@ -78,6 +80,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-失衡"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"evenType"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"currentAlgo"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
...
@@ -88,10 +92,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
})
public
JsonViewObject
unbalanceEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
JsonViewObject
unbalanceEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
unbalanceEvaluation
(
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
unbalanceEvaluation
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
...
...
@@ -103,6 +107,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-空放"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"evenType"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"currentAlgo"
,
value
=
"事件类型"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
...
@@ -113,10 +119,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
})
public
JsonViewObject
idleEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
JsonViewObject
idleEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
idleEvaluation
(
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
Map
<
String
,
Object
>
resData
=
evaluationInfoService
.
idleEvaluation
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
,
contrastStartTime
,
constrastEndTime
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
...
...
signal-optimize-service/src/main/java/net/wanji/opt/dao/mapper/evaluation/CrossProblemEvaluationMapper.java
View file @
2c4b7468
...
...
@@ -4,6 +4,8 @@ import net.wanji.common.framework.mapper.BaseInterfaceMapper;
import
net.wanji.opt.entity.evaluation.EventInfo
;
import
net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay
;
import
net.wanji.opt.po.trend.EventInfoSimplePo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -20,8 +22,8 @@ public interface CrossProblemEvaluationMapper {
public
List
<
AnalysisProblemAndStrategyDay
>
findOVerFlowInfo
();
List
<
TEventOptimizeInfo
>
getOverflow
(
String
crossId
,
String
startTime
,
String
endTime
);
List
<
EventInfoSimplePo
>
getOverflow
(
@Param
(
"evenType"
)
String
evenType
,
@Param
(
"currentAlgo"
)
String
currentAlgo
,
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
TEventOptimizeInfo
>
getContrastOverflow
(
String
crossId
,
String
contrastStartTime
,
String
constrastEndTime
);
List
<
EventInfoSimplePo
>
getContrastOverflow
(
@Param
(
"evenType"
)
String
evenType
,
@Param
(
"currentAlgo"
)
String
currentAlgo
,
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"contrastStartTime"
)
String
contrastStartTime
,
@Param
(
"constrastEndTime"
)
String
constrastEndTime
);
}
signal-optimize-service/src/main/java/net/wanji/opt/po/trend/EventInfoSimplePo.java
View file @
2c4b7468
package
net
.
wanji
.
opt
.
po
.
trend
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
@@ -64,4 +65,12 @@ public class EventInfoSimplePo implements Serializable {
@ApiModelProperty
(
value
=
"纵轴日期 格式:(dd/MM)"
,
notes
=
""
)
private
List
<
String
>
dataTimeList
=
new
ArrayList
<>();
//非数据库字段
//事件发生次数
@TableField
(
exist
=
false
)
private
Long
eventCount
;
//优化次数
@TableField
(
exist
=
false
)
private
Long
optimizecount
;
}
\ No newline at end of file
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/evaluation/EvaluationInfoService.java
View file @
2c4b7468
...
...
@@ -9,9 +9,9 @@ import java.util.Map;
public
interface
EvaluationInfoService
extends
IService
<
CrossDataHistPO
>
{
Map
<
String
,
Object
>
getListEvaluationSummarize
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
summaryEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
summaryEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
unbalanceEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
unbalanceEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
idleEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
Map
<
String
,
Object
>
idleEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
}
signal-optimize-service/src/main/java/net/wanji/opt/servicev2/evaluation/impl/EvaluationInfoServiceImpl.java
View file @
2c4b7468
This diff is collapsed.
Click to expand it.
signal-optimize-service/src/main/resources/mapper/evaluation/CrossProblemEvaluationMapper.xml
View file @
2c4b7468
...
...
@@ -9,36 +9,77 @@
FROM t_event_optimize_info
WHERE 1=1
</select>
<select
id=
"getOverflow"
parameterType=
"net.wanji.opt.
entity.eventoptimize.TEventOptimizeInfo"
resultType=
"net.wanji.opt.entity.eventoptimize.TEventOptimizeInf
o"
>
SELECT
cross_id,duration,opt_status
,
event_type,opt_duration
<select
id=
"getOverflow"
parameterType=
"net.wanji.opt.
po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimpleP
o"
>
SELECT
count(*) as event_count,
sum(duration) duration
,
count(t2.event_id) as optimizecount
FROM
t_event_optimize_info
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND t1.cross_id=#{crossId}
</if>
<if
test=
"startTime!=null and endTime!=null"
>
AND start_time>=#{startTime} and start_time
<
=#{endTime}
</if>
<if
test=
"evenType!=null"
>
AND t1.type=#{evenType}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND cross_id=#{crossId}
AND t1.cross_id=#{crossId}
</if>
<if
test=
"startTime!=null and endTime!=null"
>
AND issue_time>=#{startTime} and issue_time
<
=#{endTime}
</if>
<if
test=
"
startTime!=null and startTime!='' and endTime!='' and endTime
!=null"
>
AND
happen_start_time>=#{startTime} and happen_start_time
<
=#{endTime
}
<if
test=
"
currentAlgo
!=null"
>
AND
t1.current_algo=#{currentAlgo
}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
<select
id=
"getContrastOverflow"
parameterType=
"net.wanji.opt.
entity.eventoptimize.TEventOptimizeInfo"
resultType=
"net.wanji.opt.entity.eventoptimize.TEventOptimizeInf
o"
>
SELECT
cross_id,duration,opt_status
,
event_type,opt_duration
<select
id=
"getContrastOverflow"
parameterType=
"net.wanji.opt.
po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimpleP
o"
>
SELECT
count(*) as event_count,
sum(duration) duration
,
count(t2.event_id) as optimizecount
FROM
t_event_optimize_info
(
SELECT t1.cross_id,t1.event_serial_number,t1.type,TIMESTAMPDIFF(SECOND,t1.start_time,t1.end_time) duration from t_event_info t1
Where 1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND t1.cross_id=#{crossId}
</if>
<if
test=
"contrastStartTime!=null and constrastEndTime!=null"
>
AND start_time>=#{contrastStartTime} and start_time
<
=#{constrastEndTime}
</if>
<if
test=
"evenType!=null"
>
AND t1.type=#{evenType}
</if>
) t1
left JOIN
(
SELECT t1.cross_id,t1.event_id from t_strategy_cross_result t1
WHERE
1=1
<if
test=
"crossId!=null and crossId!=''"
>
AND cross_id=#{crossId}
AND
t1.
cross_id=#{crossId}
</if>
<if
test=
"contrastStartTime!=null and contrastStartTime!='' and constrastEndTime!='' and constrastEndTime!=null"
>
AND happen_start_time>=#{contrastStartTime} and happen_start_time
<
=#{constrastEndTime}
<if
test=
"contrastStartTime!=null and constrastEndTime!=null"
>
AND issue_time>=#{contrastStartTime} and issue_time
<
=#{constrastEndTime}
</if>
<if
test=
"currentAlgo!=null"
>
AND t1.current_algo=#{currentAlgo}
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
...
...
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