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
d95eb09d
Commit
d95eb09d
authored
Oct 08, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波评价-场景数量统计
parent
8760d65e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
MainlineEvaluateServiceImpl.java
...t/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
+45
-0
GreenwaveHistPO.java
...in/java/net/wanji/databus/dao/entity/GreenwaveHistPO.java
+3
-1
GreenwaveHistMapper.xml
wj-databus/src/main/resources/mapper/GreenwaveHistMapper.xml
+1
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/MainlineEvaluateServiceImpl.java
View file @
d95eb09d
...
@@ -502,11 +502,56 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
...
@@ -502,11 +502,56 @@ public class MainlineEvaluateServiceImpl implements MainlineEvaluateService {
// 根据时段查询所有发生的绿波
// 根据时段查询所有发生的绿波
List
<
GreenwaveHistPO
>
greenwaveHistPOList
=
greenwaveHistMapper
List
<
GreenwaveHistPO
>
greenwaveHistPOList
=
greenwaveHistMapper
.
selectByTimeSection
(
poStartTimeStr
,
poEndTimeStr
);
.
selectByTimeSection
(
poStartTimeStr
,
poEndTimeStr
);
// 根据干线名称筛选结果
List
<
GreenwaveHistPO
>
filteredList
=
greenwaveHistPOList
.
stream
()
.
filter
(
po
->
{
String
name
=
po
.
getGreenwaveName
();
int
index
=
name
.
indexOf
(
':'
);
if
(
index
!=
-
1
)
{
String
leftSide
=
name
.
substring
(
0
,
index
).
trim
();
return
leftSide
.
equals
(
mainlineName
);
}
return
false
;
})
.
collect
(
Collectors
.
toList
());
MainlineSchemeAnalysisVO
res
=
new
MainlineSchemeAnalysisVO
();
res
.
setSceneData
(
calcSceneData
(
filteredList
));
res
.
setCrossData
(
new
ArrayList
<>());
res
.
setEvaluateData
(
new
ArrayList
<>());
res
.
setGreenwaveData
(
new
ArrayList
<>());
return
null
;
return
null
;
}
}
private
List
<
MainlineSchemeAnalysisVO
.
DirectionData
>
calcSceneData
(
List
<
GreenwaveHistPO
>
filteredList
)
{
List
<
MainlineSchemeAnalysisVO
.
DirectionData
>
res
=
new
ArrayList
<>();
HashMap
<
String
,
Integer
>
map
=
new
HashMap
<>();
for
(
GreenwaveHistPO
greenwaveHistPO
:
filteredList
)
{
Integer
dir
=
greenwaveHistPO
.
getDir
();
if
(
dir
==
0
)
{
// 正向
map
.
put
(
"单向绿波上行"
,
map
.
getOrDefault
(
"单向绿波上行"
,
0
)
+
1
);
}
else
if
(
dir
==
1
)
{
// 反向
map
.
put
(
"单向绿波下行"
,
map
.
getOrDefault
(
"单向绿波下行"
,
0
)
+
1
);
}
else
{
// 双向
map
.
put
(
"双向绿波"
,
map
.
getOrDefault
(
"双向绿波"
,
0
)
+
1
);
}
}
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
map
.
entrySet
())
{
MainlineSchemeAnalysisVO
.
DirectionData
directionData
=
new
MainlineSchemeAnalysisVO
.
DirectionData
();
directionData
.
setName
(
entry
.
getKey
());
directionData
.
setTimes
(
entry
.
getValue
());
res
.
add
(
directionData
);
}
return
res
;
}
private
Date
calcDate
(
String
timeStr
,
Date
startTime
)
throws
ParseException
{
private
Date
calcDate
(
String
timeStr
,
Date
startTime
)
throws
ParseException
{
// 使用 Calendar 来获取年、月、日信息
// 使用 Calendar 来获取年、月、日信息
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
wj-databus/src/main/java/net/wanji/databus/dao/entity/GreenwaveHistPO.java
View file @
d95eb09d
...
@@ -11,5 +11,7 @@ import lombok.Data;
...
@@ -11,5 +11,7 @@ import lombok.Data;
@Data
@Data
public
class
GreenwaveHistPO
extends
GreenwaveRealtimePO
{
public
class
GreenwaveHistPO
extends
GreenwaveRealtimePO
{
@ApiModelProperty
(
value
=
"绿波名称"
,
notes
=
""
)
@ApiModelProperty
(
value
=
"绿波名称"
,
notes
=
""
)
private
String
greenwaveName
;
private
String
greenwaveName
;
@ApiModelProperty
(
name
=
"协调方向:0正向;1反向;2双向"
)
private
Integer
dir
;
}
}
wj-databus/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
d95eb09d
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<select
id=
"selectByTimeSection"
resultType=
"net.wanji.databus.dao.entity.GreenwaveHistPO"
>
<select
id=
"selectByTimeSection"
resultType=
"net.wanji.databus.dao.entity.GreenwaveHistPO"
>
select t1.id,t1.status,t1.type,t1.traffic_index,t1.speed,t1.trval_time,t1.stop_times,t1.queue_length,
select t1.id,t1.status,t1.type,t1.traffic_index,t1.speed,t1.trval_time,t1.stop_times,t1.queue_length,
t1.cong_rate,t1.delay_time,t1.nopark_pass_rate,t1.cord_reliability,t1.cord_queue_ratio,
t1.cong_rate,t1.delay_time,t1.nopark_pass_rate,t1.cord_reliability,t1.cord_queue_ratio,
t1.uncoordinate_phase_queue,t1.gmt_create,t1.gmt_modified, t2.name as greenwaveName
t1.uncoordinate_phase_queue,t1.gmt_create,t1.gmt_modified, t2.name as greenwaveName
, t2.dir
from t_greenwave_hist t1 join t_greenwave_info t2 on t1.id = t2.id
from t_greenwave_hist t1 join t_greenwave_info t2 on t1.id = t2.id
where t1.gmt_modified
<![CDATA[ <= ]]>
#{endTimeStr}
where t1.gmt_modified
<![CDATA[ <= ]]>
#{endTimeStr}
and t1.gmt_modified
<![CDATA[ >= ]]>
#{startTimeStr}
and t1.gmt_modified
<![CDATA[ >= ]]>
#{startTimeStr}
...
...
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