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
Show 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 {
...
@@ -53,6 +53,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-溢出"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"方案评价-溢出"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@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
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
@@ -63,10 +65,10 @@ public class EvaluationInfoController {
...
@@ -63,10 +65,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
@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
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
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
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
...
@@ -78,6 +80,8 @@ public class EvaluationInfoController {
...
@@ -78,6 +80,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-失衡"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"方案评价-失衡"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@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
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
@@ -88,10 +92,10 @@ public class EvaluationInfoController {
...
@@ -88,10 +92,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
@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
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
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
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
...
@@ -103,6 +107,8 @@ public class EvaluationInfoController {
...
@@ -103,6 +107,8 @@ public class EvaluationInfoController {
@ApiOperation
(
value
=
"方案评价-空放"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"方案评价-空放"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiImplicitParams
({
@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
=
"crossId"
,
value
=
"路口ID"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"分析时段开始时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"分析时段截止时间"
,
required
=
false
,
dataType
=
"string"
),
...
@@ -113,10 +119,10 @@ public class EvaluationInfoController {
...
@@ -113,10 +119,10 @@ public class EvaluationInfoController {
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
AreaProblemOverview
.
class
),
@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
();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
try
{
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
);
jsonViewObject
.
success
(
resData
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
jsonViewObject
.
fail
(
I18nResourceBundle
.
getConstants
(
"GET_FAILED_MSG"
));
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;
...
@@ -4,6 +4,8 @@ import net.wanji.common.framework.mapper.BaseInterfaceMapper;
import
net.wanji.opt.entity.evaluation.EventInfo
;
import
net.wanji.opt.entity.evaluation.EventInfo
;
import
net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo
;
import
net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay
;
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.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -20,8 +22,8 @@ public interface CrossProblemEvaluationMapper {
...
@@ -20,8 +22,8 @@ public interface CrossProblemEvaluationMapper {
public
List
<
AnalysisProblemAndStrategyDay
>
findOVerFlowInfo
();
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
;
package
net
.
wanji
.
opt
.
po
.
trend
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
@@ -64,4 +65,12 @@ public class EventInfoSimplePo implements Serializable {
...
@@ -64,4 +65,12 @@ public class EventInfoSimplePo implements Serializable {
@ApiModelProperty
(
value
=
"纵轴日期 格式:(dd/MM)"
,
notes
=
""
)
@ApiModelProperty
(
value
=
"纵轴日期 格式:(dd/MM)"
,
notes
=
""
)
private
List
<
String
>
dataTimeList
=
new
ArrayList
<>();
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;
...
@@ -9,9 +9,9 @@ import java.util.Map;
public
interface
EvaluationInfoService
extends
IService
<
CrossDataHistPO
>
{
public
interface
EvaluationInfoService
extends
IService
<
CrossDataHistPO
>
{
Map
<
String
,
Object
>
getListEvaluationSummarize
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
);
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
...
@@ -10,6 +10,7 @@ import net.wanji.opt.constant.ServiceLevelEnum;
...
@@ -10,6 +10,7 @@ import net.wanji.opt.constant.ServiceLevelEnum;
import
net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo
;
import
net.wanji.opt.entity.eventoptimize.TEventOptimizeInfo
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay
;
import
net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay
;
import
net.wanji.opt.dao.mapper.evaluation.CrossProblemEvaluationMapper
;
import
net.wanji.opt.dao.mapper.evaluation.CrossProblemEvaluationMapper
;
import
net.wanji.opt.po.trend.EventInfoSimplePo
;
import
net.wanji.opt.servicev2.evaluation.EvaluationInfoService
;
import
net.wanji.opt.servicev2.evaluation.EvaluationInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -142,34 +143,52 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
...
@@ -142,34 +143,52 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
return
serviceLevel
;
return
serviceLevel
;
}
}
/*
* 溢出
* */
@Override
@Override
public
Map
<
String
,
Object
>
summaryEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
Map
<
String
,
Object
>
summaryEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
try
{
try
{
//分析时间
//分析时间
List
<
TEventOptimizeInfo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
crossId
,
startTime
,
endTime
);
List
<
EventInfoSimplePo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
);
//对比时间
//对比时间
List
<
TEventOptimizeInfo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
crossId
,
contrastStartTime
,
constrastEndTime
);
List
<
EventInfoSimplePo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
evenType
,
currentAlgo
,
crossId
,
contrastStartTime
,
constrastEndTime
);
//分析溢出次数
long
overFlowcount
=
overFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())).
count
();
//对比溢出次数
long
ontrastoverFlowcount
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())).
count
();
//分析时间的查询数据集
//分析溢出次数
long
overFlowcount
=
0
;
//分析溢出优化次数
long
overFlowTime
=
0
;
//分析溢出时长
int
fenxioverflowTime
=
0
;
for
(
EventInfoSimplePo
fxList:
overFlowList
){
//分析溢出次数
overFlowcount
=
fxList
.
getEventCount
();
//分析溢出优化次数
//分析溢出优化次数
long
overFlowTime
=
overFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
overFlowTime
=
fxList
.
getOptimizecount
();
fenxioverflowTime
=
fxList
.
getDuration
();
}
//对比时间的查询数据集
//对比溢出次数
long
ontrastoverFlowcount
=
0
;
//对比溢出优化次数
long
contrastoverFlowTime
=
0
;
//对比溢出时长
int
duibioverflowTime
=
0
;
for
(
EventInfoSimplePo
fxList:
contrastoverFlowList
){
//对比溢出次数
ontrastoverFlowcount
=
fxList
.
getEventCount
();
//对比溢出优化次数
//对比溢出优化次数
long
contrastoverFlowTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
contrastoverFlowTime
=
fxList
.
getOptimize
count
();
//分析溢出时长
duibioverflowTime
=
fxList
.
getDuration
();
int
fenxioverflowTime
=
overFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
}
//对比溢出时长
int
duibioverflowTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"703"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
//计算溢出次数百分比
//计算溢出次数百分比
double
overFlowCishujisuan
=
calculatePercentage
(
overFlowcount
,
ontrastoverFlowcount
);
double
overFlowCishujisuan
=
calculatePercentage
(
overFlowcount
,
ontrastoverFlowcount
);
...
@@ -231,31 +250,46 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
...
@@ -231,31 +250,46 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
*
*
* */
* */
@Override
@Override
public
Map
<
String
,
Object
>
unbalanceEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
Map
<
String
,
Object
>
unbalanceEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
try
{
try
{
//分析时间
//分析时间
List
<
TEventOptimizeInfo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
crossId
,
startTime
,
endTime
);
List
<
EventInfoSimplePo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
);
//对比时间
//对比时间
List
<
TEventOptimizeInfo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
crossId
,
contrastStartTime
,
constrastEndTime
);
List
<
EventInfoSimplePo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
evenType
,
currentAlgo
,
crossId
,
contrastStartTime
,
constrastEndTime
);
//分析失衡次数
long
unbalancecount
=
overFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())).
count
();
//对比失衡次数
long
contrastunbalancecount
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())).
count
();
//分析时间结果集
//分析失衡次数
long
unbalancecount
=
0
;
//分析失衡优化次数
//分析失衡优化次数
long
unbalanceTime
=
overFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
long
unbalanceTime
=
0
;
//对比失衡优化次数
long
contrastunbalanceTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
//分析失衡时长
//分析失衡时长
int
fenxiunbalanceTime
=
overFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
int
fenxiunbalanceTime
=
0
;
for
(
EventInfoSimplePo
fxList:
overFlowList
){
//分析次数
unbalancecount
=
fxList
.
getEventCount
();
//分析优化次数
unbalanceTime
=
fxList
.
getOptimizecount
();
fenxiunbalanceTime
=
fxList
.
getDuration
();
}
//对比时间结果集
//对比失衡次数
long
contrastunbalancecount
=
0
;
//对比失衡优化次数
long
contrastunbalanceTime
=
0
;
//对比失衡时长
//对比失衡时长
int
duibiunbalanceTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"702"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
int
duibiunbalanceTime
=
0
;
for
(
EventInfoSimplePo
fxList:
contrastoverFlowList
){
//对比次数
contrastunbalancecount
=
fxList
.
getEventCount
();
//对比优化次数
contrastunbalanceTime
=
fxList
.
getOptimizecount
();
duibiunbalanceTime
=
fxList
.
getDuration
();
}
//计算失衡次数百分比
//计算失衡次数百分比
double
unbalanceCishujisuan
=
calculatePercentage
(
unbalancecount
,
contrastunbalancecount
);
double
unbalanceCishujisuan
=
calculatePercentage
(
unbalancecount
,
contrastunbalancecount
);
...
@@ -309,39 +343,54 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
...
@@ -309,39 +343,54 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
log
.
error
(
"{} unbalanceEvaluation error"
,
this
.
getClass
().
getSimpleName
(),
e
);
log
.
error
(
"{} unbalanceEvaluation error"
,
this
.
getClass
().
getSimpleName
(),
e
);
throw
e
;
throw
e
;
}
}
}
}
/*
/*
* 空放701
* 空放701
* */
* */
@Override
@Override
public
Map
<
String
,
Object
>
idleEvaluation
(
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
public
Map
<
String
,
Object
>
idleEvaluation
(
String
evenType
,
String
currentAlgo
,
String
crossId
,
String
startTime
,
String
endTime
,
String
contrastStartTime
,
String
constrastEndTime
)
{
try
{
try
{
//分析时间
//分析时间
List
<
TEventOptimizeInfo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
crossId
,
startTime
,
endTime
);
List
<
EventInfoSimplePo
>
overFlowList
=
crossProblemEvaluationMapper
.
getOverflow
(
evenType
,
currentAlgo
,
crossId
,
startTime
,
endTime
);
//对比时间
//对比时间
List
<
TEventOptimizeInfo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
crossId
,
contrastStartTime
,
constrastEndTime
);
List
<
EventInfoSimplePo
>
contrastoverFlowList
=
crossProblemEvaluationMapper
.
getContrastOverflow
(
evenType
,
currentAlgo
,
crossId
,
contrastStartTime
,
constrastEndTime
);
//分析时间空放次数
long
dileCount
=
overFlowList
.
stream
().
filter
(
evet
->
"701"
.
equals
(
evet
.
getEventType
())).
count
();
//对比时间空放次数
long
contrastDileCount
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"701"
.
equals
(
event
.
getEventType
())).
count
();
//分析时间结果集
//分析时间空放次数
long
dileCount
=
0
;
//分析时间空放优化次数
//分析时间空放优化次数
long
dileTime
=
overFlowList
.
stream
().
filter
(
event
->
"701"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
long
dileTime
=
0
;
//对比时间空放优化次数
long
contrastDileTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"701"
.
equals
(
event
.
getEventType
())
&&
"1"
.
equals
(
event
.
getOptStatus
())).
count
();
//分析空放时长
//分析空放时长
int
fenxiDileTime
=
overFlowList
.
stream
().
filter
(
event
->
"701"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
int
fenxiDileTime
=
0
;
for
(
EventInfoSimplePo
fxList:
overFlowList
){
//分析次数
dileCount
=
fxList
.
getEventCount
();
//分析优化次数
dileTime
=
fxList
.
getOptimizecount
();
fenxiDileTime
=
fxList
.
getDuration
();
}
//对比时间结果集
//对比时间空放次数
long
contrastDileCount
=
0
;
//对比时间空放优化次数
long
contrastDileTime
=
0
;
//对比空放时长
//对比空放时长
int
duibiDileTime
=
contrastoverFlowList
.
stream
().
filter
(
event
->
"701"
.
equals
(
event
.
getEventType
())).
mapToInt
(
TEventOptimizeInfo:
:
getDuration
).
sum
();
int
duibiDileTime
=
0
;
for
(
EventInfoSimplePo
fxList:
contrastoverFlowList
){
//对比次数
contrastDileCount
=
fxList
.
getEventCount
();
//对比优化次数
contrastDileTime
=
fxList
.
getOptimizecount
();
duibiDileTime
=
fxList
.
getDuration
();
}
//计算空放次数百分比
//计算空放次数百分比
double
dileCishujisuan
=
calculatePercentage
(
dileCount
,
contrastDileCount
);
double
dileCishujisuan
=
calculatePercentage
(
dileCount
,
contrastDileCount
);
...
@@ -396,5 +445,6 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
...
@@ -396,5 +445,6 @@ public class EvaluationInfoServiceImpl extends ServiceImpl<CrossDataHistMapper,
throw
e
;
throw
e
;
}
}
}
}
}
}
signal-optimize-service/src/main/resources/mapper/evaluation/CrossProblemEvaluationMapper.xml
View file @
2c4b7468
...
@@ -9,36 +9,77 @@
...
@@ -9,36 +9,77 @@
FROM t_event_optimize_info
FROM t_event_optimize_info
WHERE 1=1
WHERE 1=1
</select>
</select>
<select
id=
"getOverflow"
parameterType=
"net.wanji.opt.
entity.eventoptimize.TEventOptimizeInfo"
resultType=
"net.wanji.opt.entity.eventoptimize.TEventOptimizeInf
o"
>
<select
id=
"getOverflow"
parameterType=
"net.wanji.opt.
po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimpleP
o"
>
SELECT
SELECT
count(*) as event_count,
cross_id,duration,opt_status
,
sum(duration) duration
,
event_type,opt_duration
count(t2.event_id) as optimizecount
FROM
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
WHERE
1=1
1=1
<if
test=
"crossId!=null and crossId!=''"
>
<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>
<if
test=
"
startTime!=null and startTime!='' and endTime!='' and endTime
!=null"
>
<if
test=
"
currentAlgo
!=null"
>
AND
happen_start_time>=#{startTime} and happen_start_time
<
=#{endTime
}
AND
t1.current_algo=#{currentAlgo
}
</if>
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
</select>
<select
id=
"getContrastOverflow"
parameterType=
"net.wanji.opt.
entity.eventoptimize.TEventOptimizeInfo"
resultType=
"net.wanji.opt.entity.eventoptimize.TEventOptimizeInf
o"
>
<select
id=
"getContrastOverflow"
parameterType=
"net.wanji.opt.
po.trend.EventInfoSimplePo"
resultType=
"net.wanji.opt.po.trend.EventInfoSimpleP
o"
>
SELECT
SELECT
count(*) as event_count,
cross_id,duration,opt_status
,
sum(duration) duration
,
event_type,opt_duration
count(t2.event_id) as optimizecount
FROM
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
WHERE
1=1
1=1
<if
test=
"crossId!=null and crossId!=''"
>
<if
test=
"crossId!=null and crossId!=''"
>
AND cross_id=#{crossId}
AND
t1.
cross_id=#{crossId}
</if>
</if>
<if
test=
"contrastStartTime!=null and constrastEndTime!=null"
>
<if
test=
"contrastStartTime!=null and contrastStartTime!='' and constrastEndTime!='' and constrastEndTime!=null"
>
AND issue_time>=#{contrastStartTime} and issue_time
<
=#{constrastEndTime}
AND happen_start_time>=#{contrastStartTime} and happen_start_time
<
=#{constrastEndTime}
</if>
<if
test=
"currentAlgo!=null"
>
AND t1.current_algo=#{currentAlgo}
</if>
</if>
) t2
on t1.event_serial_number=t2.event_id
GROUP BY t1.cross_id,t1.type
</select>
</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