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
4a415b5a
Commit
4a415b5a
authored
May 07, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 态势监测-路口车道数据
parent
4c6115c8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
8 deletions
+95
-8
TrendController.java
...c/main/java/net/wanji/opt/controller/TrendController.java
+16
-4
TrendService.java
...ice/src/main/java/net/wanji/opt/service/TrendService.java
+3
-1
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+45
-1
HotspotCrossLaneVO.java
...ce/src/main/java/net/wanji/opt/vo/HotspotCrossLaneVO.java
+27
-0
HotspotCrossTurnVO.java
...ce/src/main/java/net/wanji/opt/vo/HotspotCrossTurnVO.java
+1
-0
HotspotCrossVO.java
...ervice/src/main/java/net/wanji/opt/vo/HotspotCrossVO.java
+1
-0
CrossLaneDataHistMapper.xml
...bus/src/main/resources/mapper/CrossLaneDataHistMapper.xml
+2
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/TrendController.java
View file @
4a415b5a
...
@@ -231,15 +231,27 @@ public class TrendController {
...
@@ -231,15 +231,27 @@ public class TrendController {
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
}
}
@ApiOperation
(
value
=
"路口转向
排队长度"
,
notes
=
"路口转向排队长度
"
,
response
=
JsonViewObject
.
class
,
@ApiOperation
(
value
=
"路口转向
数据"
,
notes
=
"路口转向数据
"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/cross
QueueLength
"
,
@PostMapping
(
value
=
"/cross
TurnData
"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
List
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
List
.
class
),
})
})
public
JsonViewObject
crossQueueLength
(
@RequestBody
String
crossId
)
throws
Exception
{
public
JsonViewObject
crossTurnData
(
@RequestBody
String
crossId
)
throws
Exception
{
List
<
HotspotCrossTurnVO
>
hotspotCrossVOS
=
trendService
.
crossQueueLength
(
crossId
);
List
<
HotspotCrossTurnVO
>
hotspotCrossVOS
=
trendService
.
crossTurnData
(
crossId
);
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
}
@ApiOperation
(
value
=
"路口车道数据"
,
notes
=
"路口车道数据"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/crossLaneData"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
List
.
class
),
})
public
JsonViewObject
crossLaneData
(
@RequestBody
String
crossId
)
throws
Exception
{
List
<
HotspotCrossLaneVO
>
hotspotCrossVOS
=
trendService
.
crossLaneData
(
crossId
);
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
return
JsonViewObject
.
newInstance
().
success
(
hotspotCrossVOS
);
}
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/TrendService.java
View file @
4a415b5a
...
@@ -49,7 +49,9 @@ public interface TrendService {
...
@@ -49,7 +49,9 @@ public interface TrendService {
List
<
HotspotCrossVO
>
hotspotCross
(
String
crossId
)
throws
Exception
;
List
<
HotspotCrossVO
>
hotspotCross
(
String
crossId
)
throws
Exception
;
List
<
HotspotCrossTurnVO
>
crossQueueLength
(
String
crossId
)
throws
Exception
;
List
<
HotspotCrossTurnVO
>
crossTurnData
(
String
crossId
)
throws
Exception
;
List
<
HotspotCrossLaneVO
>
crossLaneData
(
String
crossId
)
throws
Exception
;
List
<
RunningEvaluateMetricsDetailVO
>
top5Flow
()
throws
Exception
;
List
<
RunningEvaluateMetricsDetailVO
>
top5Flow
()
throws
Exception
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
4a415b5a
...
@@ -1710,6 +1710,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1710,6 +1710,7 @@ public class TrendServiceImpl implements TrendService {
dirDetail
.
setDir
(
crossDirDataHistPO
.
getDirType
());
dirDetail
.
setDir
(
crossDirDataHistPO
.
getDirType
());
dirDetail
.
setInOutType
(
crossDirDataHistPO
.
getInOutType
());
dirDetail
.
setInOutType
(
crossDirDataHistPO
.
getInOutType
());
dirDetail
.
setQueueLength
(
crossDirDataHistPO
.
getQueueLength
());
dirDetail
.
setQueueLength
(
crossDirDataHistPO
.
getQueueLength
());
dirDetail
.
setFlow
(
crossDirDataHistPO
.
getFlow
());
dirDetails
.
add
(
dirDetail
);
dirDetails
.
add
(
dirDetail
);
}
}
hotspotCrossVO
.
setDetailList
(
dirDetails
);
hotspotCrossVO
.
setDetailList
(
dirDetails
);
...
@@ -1730,7 +1731,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1730,7 +1731,7 @@ public class TrendServiceImpl implements TrendService {
}
}
@Override
@Override
public
List
<
HotspotCrossTurnVO
>
cross
QueueLength
(
String
crossId
)
throws
Exception
{
public
List
<
HotspotCrossTurnVO
>
cross
TurnData
(
String
crossId
)
throws
Exception
{
List
<
HotspotCrossTurnVO
>
results
=
new
ArrayList
<>();
List
<
HotspotCrossTurnVO
>
results
=
new
ArrayList
<>();
try
{
try
{
Date
date
=
new
Date
(
1705456500000L
);
Date
date
=
new
Date
(
1705456500000L
);
...
@@ -1750,6 +1751,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1750,6 +1751,7 @@ public class TrendServiceImpl implements TrendService {
turnDetail
.
setTurn
(
crossTurnDataHistPO
.
getTurnType
());
turnDetail
.
setTurn
(
crossTurnDataHistPO
.
getTurnType
());
turnDetail
.
setDir
(
crossTurnDataHistPO
.
getInDir
());
turnDetail
.
setDir
(
crossTurnDataHistPO
.
getInDir
());
turnDetail
.
setQueueLength
(
crossTurnDataHistPO
.
getQueueLength
());
turnDetail
.
setQueueLength
(
crossTurnDataHistPO
.
getQueueLength
());
turnDetail
.
setFlow
(
crossTurnDataHistPO
.
getFlow
());
turnDetails
.
add
(
turnDetail
);
turnDetails
.
add
(
turnDetail
);
}
}
HotspotCrossTurnVO
hotspotCrossTurnVO
=
new
HotspotCrossTurnVO
();
HotspotCrossTurnVO
hotspotCrossTurnVO
=
new
HotspotCrossTurnVO
();
...
@@ -1766,6 +1768,48 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1766,6 +1768,48 @@ public class TrendServiceImpl implements TrendService {
return
results
;
return
results
;
}
}
@Override
public
List
<
HotspotCrossLaneVO
>
crossLaneData
(
String
crossId
)
throws
Exception
{
List
<
HotspotCrossLaneVO
>
results
=
new
ArrayList
<>();
try
{
Date
date
=
new
Date
(
1705456500000L
);
long
dateTime
=
date
.
getTime
()
/
1000
;
List
<
CrossLaneDataHistPOExt
>
crossLaneDataHistPOS
=
crossLaneDataHistMapper
.
selectByCrossIdAndTimeSpan
(
crossId
,
(
int
)(
dateTime
-
3600
),
(
int
)
dateTime
);
if
(!
CollectionUtils
.
isEmpty
(
crossLaneDataHistPOS
))
{
Map
<
Date
,
List
<
CrossLaneDataHistPOExt
>>
collect
=
crossLaneDataHistPOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
CrossLaneDataHistPOExt:
:
getStartTime
));
for
(
Map
.
Entry
<
Date
,
List
<
CrossLaneDataHistPOExt
>>
entry
:
collect
.
entrySet
())
{
Date
timeStamp
=
entry
.
getKey
();
List
<
CrossLaneDataHistPOExt
>
value
=
entry
.
getValue
();
Map
<
Integer
,
List
<
CrossLaneDataHistPOExt
>>
dirLaneMap
=
value
.
stream
().
collect
(
Collectors
.
groupingBy
(
CrossLaneDataHistPOExt:
:
getDir
));
HotspotCrossLaneVO
hotspotCrossLaneVO
=
new
HotspotCrossLaneVO
();
for
(
Map
.
Entry
<
Integer
,
List
<
CrossLaneDataHistPOExt
>>
dirEntry
:
dirLaneMap
.
entrySet
())
{
Integer
dir
=
dirEntry
.
getKey
();
List
<
CrossLaneDataHistPOExt
>
dirList
=
dirEntry
.
getValue
();
List
<
HotspotCrossLaneVO
.
LaneDetail
>
laneDetails
=
new
ArrayList
<>();
for
(
CrossLaneDataHistPOExt
crossLaneDataHistPO
:
dirList
)
{
HotspotCrossLaneVO
.
LaneDetail
laneDetail
=
new
HotspotCrossLaneVO
.
LaneDetail
();
String
poId
=
crossLaneDataHistPO
.
getId
();
laneDetail
.
setLaneId
(
poId
.
substring
(
poId
.
length
()
-
2
));
laneDetail
.
setFlow
(
crossLaneDataHistPO
.
getFlow
());
laneDetail
.
setQueueLength
(
crossLaneDataHistPO
.
getQueueLength
());
laneDetails
.
add
(
laneDetail
);
}
hotspotCrossLaneVO
.
setCrossId
(
crossId
);
hotspotCrossLaneVO
.
setDir
(
dir
);
hotspotCrossLaneVO
.
setTimeStamp
(
timeStamp
);
hotspotCrossLaneVO
.
setTurnList
(
laneDetails
);
results
.
add
(
hotspotCrossLaneVO
);
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"路口车道数据异常:"
,
e
);
throw
new
Exception
(
e
);
}
return
results
;
}
@Override
@Override
public
List
<
RunningEvaluateMetricsDetailVO
>
top5Flow
()
throws
Exception
{
public
List
<
RunningEvaluateMetricsDetailVO
>
top5Flow
()
throws
Exception
{
List
<
RunningEvaluateMetricsDetailVO
>
hotspotCrossVOS
=
new
ArrayList
<>();
List
<
RunningEvaluateMetricsDetailVO
>
hotspotCrossVOS
=
new
ArrayList
<>();
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/HotspotCrossLaneVO.java
0 → 100644
View file @
4a415b5a
package
net
.
wanji
.
opt
.
vo
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author duanruiming
* @date 2024/05/07 16:31
*/
@NoArgsConstructor
@Data
public
class
HotspotCrossLaneVO
{
private
String
crossId
;
private
Integer
dir
;
private
Date
timeStamp
;
private
List
<
HotspotCrossLaneVO
.
LaneDetail
>
turnList
;
@Data
public
static
class
LaneDetail
{
private
String
laneId
;
private
Double
queueLength
;
private
Integer
flow
;
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/HotspotCrossTurnVO.java
View file @
4a415b5a
...
@@ -22,5 +22,6 @@ public class HotspotCrossTurnVO {
...
@@ -22,5 +22,6 @@ public class HotspotCrossTurnVO {
private
String
turn
;
private
String
turn
;
private
Integer
dir
;
private
Integer
dir
;
private
Double
queueLength
;
private
Double
queueLength
;
private
Integer
flow
;
}
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/HotspotCrossVO.java
View file @
4a415b5a
...
@@ -23,5 +23,6 @@ public class HotspotCrossVO {
...
@@ -23,5 +23,6 @@ public class HotspotCrossVO {
private
Integer
dir
;
private
Integer
dir
;
private
Integer
inOutType
;
private
Integer
inOutType
;
private
Double
queueLength
;
private
Double
queueLength
;
private
Integer
flow
;
}
}
}
}
wj-databus/src/main/resources/mapper/CrossLaneDataHistMapper.xml
View file @
4a415b5a
...
@@ -97,8 +97,8 @@
...
@@ -97,8 +97,8 @@
</select>
</select>
<select
id=
"selectByCrossIdAndTimeSpan"
resultType=
"net.wanji.databus.po.CrossLaneDataHistPOExt"
>
<select
id=
"selectByCrossIdAndTimeSpan"
resultType=
"net.wanji.databus.po.CrossLaneDataHistPOExt"
>
SELECT t2.dir, t2.sort, t1.flow, t1.speed, t1.queue_length, t1.delay_time, t1.stop_times,
SELECT t
1.id, t
2.dir, t2.sort, t1.flow, t1.speed, t1.queue_length, t1.delay_time, t1.stop_times,
t1.vehhead_time, t1.batch_time, t1.time_occupancy, t1.vehicle_nums_ratio_mean
t1.vehhead_time, t1.batch_time, t1.time_occupancy, t1.vehicle_nums_ratio_mean
, t1.start_time
FROM t_lane_data_hist t1 JOIN t_base_lane_info t2 ON t1.id = t2.id
FROM t_lane_data_hist t1 JOIN t_base_lane_info t2 ON t1.id = t2.id
where t1.cross_id = #{crossId}
where t1.cross_id = #{crossId}
and batch_time
<![CDATA[ >= ]]>
#{startTimeStamp}
and batch_time
<![CDATA[ >= ]]>
#{startTimeStamp}
...
...
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