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
aaf81011
Commit
aaf81011
authored
Feb 11, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 绿波干线运行监测优化返回数据
parent
7a4969cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
22 deletions
+48
-22
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+23
-11
StrategyControlServiceImpl.java
...pt/synthesis/service/impl/StrategyControlServiceImpl.java
+7
-2
GreenwaveRunMonitorVO.java
...src/main/java/net/wanji/opt/vo/GreenwaveRunMonitorVO.java
+17
-8
GreenwaveHistMapper.xml
...service/src/main/resources/mapper/GreenwaveHistMapper.xml
+1
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
aaf81011
...
@@ -538,18 +538,30 @@ public class TrendServiceImpl implements TrendService {
...
@@ -538,18 +538,30 @@ public class TrendServiceImpl implements TrendService {
List
<
GreenwaveRunMonitorVO
>
res
=
new
ArrayList
<>();
List
<
GreenwaveRunMonitorVO
>
res
=
new
ArrayList
<>();
Date
date
=
new
Date
();
Date
date
=
new
Date
();
List
<
GreenwaveHistPOExt
>
extList
=
greenwaveHistoryMapper
.
selectRunMonitorV2
(
greenwaveIdBO
.
getGreenwaveId
(),
date
);
List
<
GreenwaveHistPOExt
>
extList
=
greenwaveHistoryMapper
.
selectRunMonitorV2
(
greenwaveIdBO
.
getGreenwaveId
(),
date
);
for
(
GreenwaveHistPOExt
greenwaveHistPOExt
:
extList
)
{
if
(!
CollectionUtils
.
isEmpty
(
extList
))
{
GreenwaveRunMonitorVO
greenWaveRunMonitorVO
=
new
GreenwaveRunMonitorVO
();
Map
<
String
,
List
<
GreenwaveHistPOExt
>>
listMap
=
extList
.
stream
().
collect
(
Collectors
.
groupingBy
(
GreenwaveHistPOExt:
:
getRoadDirection
));
String
hour
=
greenwaveHistPOExt
.
getHour
();
for
(
Map
.
Entry
<
String
,
List
<
GreenwaveHistPOExt
>>
entry
:
listMap
.
entrySet
())
{
greenWaveRunMonitorVO
.
setHour
(
hour
);
String
roadDirection
=
entry
.
getKey
();
greenWaveRunMonitorVO
.
setAvgSpeed
(
greenwaveHistPOExt
.
getAvgSpeed
());
List
<
GreenwaveHistPOExt
>
value
=
entry
.
getValue
();
Double
congestionIndex
=
greenwaveHistPOExt
.
getCongestionIndex
();
GreenwaveRunMonitorVO
vo
=
new
GreenwaveRunMonitorVO
();
greenWaveRunMonitorVO
.
setCongestionIndex
(
congestionIndex
);
vo
.
setRoadDirection
(
roadDirection
);
Double
trvalTime
=
greenwaveHistPOExt
.
getTrvalTime
();
List
<
GreenwaveRunMonitorVO
.
Detail
>
details
=
new
ArrayList
<>(
value
.
size
());
greenWaveRunMonitorVO
.
setTravelTime
(
trvalTime
.
intValue
());
for
(
GreenwaveHistPOExt
greenwaveHistPOExt
:
value
)
{
greenWaveRunMonitorVO
.
setRoadDirection
(
greenwaveHistPOExt
.
getRoadDirection
());
GreenwaveRunMonitorVO
.
Detail
detail
=
new
GreenwaveRunMonitorVO
.
Detail
();
res
.
add
(
greenWaveRunMonitorVO
);
String
hour
=
greenwaveHistPOExt
.
getHour
();
detail
.
setHour
(
hour
);
detail
.
setAvgSpeed
(
greenwaveHistPOExt
.
getAvgSpeed
());
Double
congestionIndex
=
greenwaveHistPOExt
.
getCongestionIndex
();
detail
.
setCongestionIndex
(
congestionIndex
);
Double
trvalTime
=
greenwaveHistPOExt
.
getTrvalTime
();
detail
.
setTravelTime
(
trvalTime
.
intValue
());
details
.
add
(
detail
);
}
vo
.
setDetailList
(
details
);
res
.
add
(
vo
);
}
}
}
return
res
;
return
res
;
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/synthesis/service/impl/StrategyControlServiceImpl.java
View file @
aaf81011
...
@@ -924,8 +924,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
...
@@ -924,8 +924,13 @@ public class StrategyControlServiceImpl implements StrategyControlService {
List
<
StrategyControlDataVO
>
dataList
=
new
ArrayList
<>();
List
<
StrategyControlDataVO
>
dataList
=
new
ArrayList
<>();
for
(
StrategyPlanDTO
strategyPlanDTO
:
resultList
)
{
for
(
StrategyPlanDTO
strategyPlanDTO
:
resultList
)
{
StrategyControlDataVO
dataVO
=
new
StrategyControlDataVO
();
StrategyControlDataVO
dataVO
=
new
StrategyControlDataVO
();
dataVO
.
setBizId
(
strategyPlanDTO
.
getCrossId
());
String
bizId
=
strategyPlanDTO
.
getCrossId
();
dataVO
.
setBizType
(
0
);
dataVO
.
setBizId
(
bizId
);
if
(
bizId
.
length
()
==
1
)
{
dataVO
.
setBizType
(
1
);
}
else
{
dataVO
.
setBizType
(
0
);
}
dataVO
.
setStrategy
(
strategyPlanDTO
.
getStrategy
());
dataVO
.
setStrategy
(
strategyPlanDTO
.
getStrategy
());
dataVO
.
setScheduleStart
(
strategyPlanDTO
.
getStartTime
());
dataVO
.
setScheduleStart
(
strategyPlanDTO
.
getStartTime
());
dataVO
.
setScheduleEnd
(
strategyPlanDTO
.
getEndTime
());
dataVO
.
setScheduleEnd
(
strategyPlanDTO
.
getEndTime
());
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/GreenwaveRunMonitorVO.java
View file @
aaf81011
package
net
.
wanji
.
opt
.
vo
;
package
net
.
wanji
.
opt
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@NoArgsConstructor
@NoArgsConstructor
@Data
@Data
@ApiModel
(
value
=
"GreenwaveRunMonitorVO"
,
description
=
"子区信息-运行监测返回值"
)
@ApiModel
(
value
=
"GreenwaveRunMonitorVO"
,
description
=
"子区信息-运行监测返回值"
)
public
class
GreenwaveRunMonitorVO
{
public
class
GreenwaveRunMonitorVO
{
@ApiModelProperty
(
value
=
"时间"
)
private
String
hour
;
@ApiModelProperty
(
value
=
"平均速度"
)
private
Integer
avgSpeed
;
@ApiModelProperty
(
value
=
"拥堵指数"
)
private
Double
congestionIndex
;
@ApiModelProperty
(
value
=
"行程时间"
)
private
Integer
travelTime
;
@ApiModelProperty
(
value
=
"绿波方向"
)
@ApiModelProperty
(
value
=
"绿波方向"
)
private
String
roadDirection
;
private
String
roadDirection
;
private
List
<
Detail
>
detailList
;
@Data
public
static
class
Detail
{
@ApiModelProperty
(
value
=
"时间"
)
private
String
hour
;
@ApiModelProperty
(
value
=
"平均速度"
)
private
Integer
avgSpeed
;
@ApiModelProperty
(
value
=
"拥堵指数"
)
private
Double
congestionIndex
;
@ApiModelProperty
(
value
=
"行程时间"
)
@JsonProperty
(
"trvalTime"
)
private
Integer
travelTime
;
}
}
}
signal-optimize-service/src/main/resources/mapper/GreenwaveHistMapper.xml
View file @
aaf81011
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
when road_direction='e2w' then '东向西'
when road_direction='e2w' then '东向西'
when road_direction='w2e' then '西向东'
when road_direction='w2e' then '西向东'
end ) roadDirection,
end ) roadDirection,
DATE_FORMAT(start_time, '%
Y-%m-%d %H:%i:00
') AS hour,
DATE_FORMAT(start_time, '%
H:%i
') AS hour,
speed AS avg_speed,
speed AS avg_speed,
traffic_index AS congestion_index,
traffic_index AS congestion_index,
trval_time AS trval_time
trval_time AS trval_time
...
...
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