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
e40f4d0c
Commit
e40f4d0c
authored
Mar 24, 2025
by
duwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化交通指标4个指标统计
parent
dbf5d81c
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
94 additions
and
63 deletions
+94
-63
TrendController.java
...c/main/java/net/wanji/opt/controller/TrendController.java
+6
-6
TrendService.java
...ice/src/main/java/net/wanji/opt/service/TrendService.java
+1
-1
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+31
-23
CommonCrossIdDateTimeVO.java
...c/main/java/net/wanji/opt/vo/CommonCrossIdDateTimeVO.java
+0
-3
CrossingDirectionQueryVO.java
.../main/java/net/wanji/opt/vo/CrossingDirectionQueryVO.java
+6
-6
CrossingTurnQueryVO.java
...e/src/main/java/net/wanji/opt/vo/CrossingTurnQueryVO.java
+6
-6
LanePeriodVO.java
...-service/src/main/java/net/wanji/opt/vo/LanePeriodVO.java
+25
-0
TableQueryVO.java
...-service/src/main/java/net/wanji/opt/vo/TableQueryVO.java
+1
-1
CrossDataHistMapper.xml
wj-databus/src/main/resources/mapper/CrossDataHistMapper.xml
+17
-16
CrossDirDataHistMapper.xml
...abus/src/main/resources/mapper/CrossDirDataHistMapper.xml
+1
-1
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/TrendController.java
View file @
e40f4d0c
...
@@ -278,7 +278,7 @@ public class TrendController {
...
@@ -278,7 +278,7 @@ public class TrendController {
}
}
/**
/**
* 交通指标 - 车道级
* 交通指标 - 车道级
数据
* @param crossIdDateTimeVO
* @param crossIdDateTimeVO
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -290,18 +290,18 @@ public class TrendController {
...
@@ -290,18 +290,18 @@ public class TrendController {
@ApiResponses
({
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TableQueryVO
.
CycleDataElement
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TableQueryVO
.
CycleDataElement
.
class
),
})
})
public
JsonViewObject
laneTrafficIndex
(
@RequestBody
CommonCrossIdDateTime
VO
crossIdDateTimeVO
)
throws
Exception
{
public
JsonViewObject
laneTrafficIndex
(
@RequestBody
LanePeriod
VO
crossIdDateTimeVO
)
throws
Exception
{
List
<
TableQueryVO
.
CycleDataElement
>
result
=
trendService
.
laneTrafficIndex
(
crossIdDateTimeVO
);
List
<
TableQueryVO
.
CycleDataElement
>
result
=
trendService
.
laneTrafficIndex
(
crossIdDateTimeVO
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
}
/**
/**
*
车道
交通指标 - 转向级数据
* 交通指标 - 转向级数据
* @param lanePeriodTurnVO
* @param lanePeriodTurnVO
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@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
=
"/lanePeriodTurnData"
,
@PostMapping
(
value
=
"/lanePeriodTurnData"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
@@ -329,7 +329,7 @@ public class TrendController {
...
@@ -329,7 +329,7 @@ public class TrendController {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@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
=
"/periodDirectionData"
,
@PostMapping
(
value
=
"/periodDirectionData"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
@@ -354,7 +354,7 @@ public class TrendController {
...
@@ -354,7 +354,7 @@ public class TrendController {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@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
=
"/periodCrossingData"
,
@PostMapping
(
value
=
"/periodCrossingData"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/TrendService.java
View file @
e40f4d0c
...
@@ -60,7 +60,7 @@ public interface TrendService {
...
@@ -60,7 +60,7 @@ public interface TrendService {
CrossStatusTimeRateVO
crossStatusTimeRate
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
CrossStatusTimeRateVO
crossStatusTimeRate
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
CommonCrossIdDateTimeVO
crossIdDateTime
VO
)
throws
Exception
;
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
LanePeriodVO
lanePeriod
VO
)
throws
Exception
;
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
LaneSnapshotIndexVO
laneSnapshotIndexVO
)
throws
Exception
;
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
LaneSnapshotIndexVO
laneSnapshotIndexVO
)
throws
Exception
;
List
<
OverflowEvent
>
overFlowEvent
(
LaneSnapshotIndexVO
laneSnapshotIndexVO
)
throws
Exception
;
List
<
OverflowEvent
>
overFlowEvent
(
LaneSnapshotIndexVO
laneSnapshotIndexVO
)
throws
Exception
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
e40f4d0c
...
@@ -1642,7 +1642,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1642,7 +1642,7 @@ public class TrendServiceImpl implements TrendService {
private
List
<
CrossingTurnQueryVO
.
CycleDataElement
>
buildCrossingTurnCycleData
(
String
crossId
,
List
<
CrossTurnDataHistVO
>
vos
)
{
private
List
<
CrossingTurnQueryVO
.
CycleDataElement
>
buildCrossingTurnCycleData
(
String
crossId
,
List
<
CrossTurnDataHistVO
>
vos
)
{
List
<
CrossingTurnQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
List
<
CrossingTurnQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
int
pedFlow
=
0
;
//
int pedFlow = 0;
for
(
CrossTurnDataHistVO
po
:
vos
)
{
for
(
CrossTurnDataHistVO
po
:
vos
)
{
CrossingTurnQueryVO
.
CycleDataElement
vo
=
new
CrossingTurnQueryVO
.
CycleDataElement
();
CrossingTurnQueryVO
.
CycleDataElement
vo
=
new
CrossingTurnQueryVO
.
CycleDataElement
();
if
(
po
.
getStartTime
()
==
null
||
po
.
getStartTime
().
equals
(
"0000"
)){
if
(
po
.
getStartTime
()
==
null
||
po
.
getStartTime
().
equals
(
"0000"
)){
...
@@ -1654,7 +1654,12 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1654,7 +1654,12 @@ public class TrendServiceImpl implements TrendService {
vo
.
setTurnType
(
po
.
getTurnType
());
vo
.
setTurnType
(
po
.
getTurnType
());
vo
.
setTurnTypeName
(
TurnConvertEnum
.
getDescByCode
(
po
.
getTurnType
()));
vo
.
setTurnTypeName
(
TurnConvertEnum
.
getDescByCode
(
po
.
getTurnType
()));
vo
.
setFlow
(
po
.
getFlow
());
vo
.
setFlow
(
po
.
getFlow
());
vo
.
setPedFlow
(
pedFlow
);
//参照(行人流量 + 非机动车流量 + 交通流量)
// vo.setAllFlow(pedFlow + po.getNonMotorFlow() + po.getFlow());
//vo.setAllVehiceleFlow(po.getFlow() + po.getNonMotorFlow());
vo
.
setAllVehiceleFlow
(
po
.
getFlow
()
+
0
);
//车辆总和
vo
.
setAllFlow
(
0
+
0
+
po
.
getFlow
());
vo
.
setPedFlow
(
0
);
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setTrafficFlowA
(
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowA
(
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowB
(
po
.
getTrafficFlowB
());
vo
.
setTrafficFlowB
(
po
.
getTrafficFlowB
());
...
@@ -1743,7 +1748,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1743,7 +1748,7 @@ public class TrendServiceImpl implements TrendService {
vo
.
setPedCrossRedLightRate
(
0.0
);
vo
.
setPedCrossRedLightRate
(
0.0
);
// vo.setV85(Math.round(po.getV85() * 100) / 100);
// vo.setV85(Math.round(po.getV85() * 100) / 100);
//
vo.setAllFlow(pedFlow + po.getNonMotorFlow() + po.getFlow());
//
// vo.setAllVehiceleFlow(po.getFlow() + po.getNonMotorFlow());
// vo.setAllVehiceleFlow(po.getFlow() + po.getNonMotorFlow());
// vo.setTurn(po.getTurn());
// vo.setTurn(po.getTurn());
...
@@ -1768,15 +1773,20 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1768,15 +1773,20 @@ public class TrendServiceImpl implements TrendService {
private
List
<
CrossingDirectionQueryVO
.
CycleDataElement
>
buildCrossingDirectionCycleData
(
String
crossId
,
List
<
CrossDirDataHistVO
>
vos
)
{
private
List
<
CrossingDirectionQueryVO
.
CycleDataElement
>
buildCrossingDirectionCycleData
(
String
crossId
,
List
<
CrossDirDataHistVO
>
vos
)
{
List
<
CrossingDirectionQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
List
<
CrossingDirectionQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
int
pedFlow
=
0
;
//
int pedFlow = 0;
for
(
CrossDirDataHistVO
po
:
vos
)
{
for
(
CrossDirDataHistVO
po
:
vos
)
{
CrossingDirectionQueryVO
.
CycleDataElement
vo
=
new
CrossingDirectionQueryVO
.
CycleDataElement
();
CrossingDirectionQueryVO
.
CycleDataElement
vo
=
new
CrossingDirectionQueryVO
.
CycleDataElement
();
vo
.
setTime
(
po
.
getStartTime
());
vo
.
setTime
(
po
.
getStartTime
());
vo
.
setDir
(
po
.
getDirType
());
vo
.
setDir
(
po
.
getDirType
());
vo
.
setDirName
(
BaseEnum
.
SignalDirectionEnum
.
getNameByCode
(
po
.
getDirType
()));
vo
.
setDirName
(
BaseEnum
.
SignalDirectionEnum
.
getNameByCode
(
po
.
getDirType
()));
vo
.
setFlow
(
po
.
getFlow
());
vo
.
setFlow
(
po
.
getFlow
());
//流量
vo
.
setPedFlow
(
pedFlow
);
//参照(行人流量 + 非机动车流量 + 交通流量)
// vo.setAllFlow(pedFlow + po.getNonMotorFlow() + po.getFlow());
vo
.
setAllFlow
(
0
+
0
+
po
.
getFlow
());
//总流量
//vo.setAllVehiceleFlow(po.getFlow() + po.getNonMotorFlow());
vo
.
setAllVehiceleFlow
(
po
.
getFlow
()
+
0
);
//车辆总和
vo
.
setPedFlow
(
0
);
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setTrafficFlowA
((
int
)
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowA
((
int
)
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowB
((
int
)
po
.
getTrafficFlowB
());
vo
.
setTrafficFlowB
((
int
)
po
.
getTrafficFlowB
());
...
@@ -1869,7 +1879,7 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1869,7 +1879,7 @@ public class TrendServiceImpl implements TrendService {
// vo.setV85(Math.round(po.getV85() * 100) / 100);
// vo.setV85(Math.round(po.getV85() * 100) / 100);
// vo.setAllFlow(pedFlow + po.getNonMotorFlow() + po.getFlow());
// vo.setAllFlow(pedFlow + po.getNonMotorFlow() + po.getFlow());
//
vo.setAllVehiceleFlow(po.getFlow() + po.getNonMotorFlow());
//
// vo.setTurn(0);
// vo.setTurn(0);
// String dirName = BaseEnum.SignalDirectionEnum.getNameByCode(po.getDir());
// String dirName = BaseEnum.SignalDirectionEnum.getNameByCode(po.getDir());
...
@@ -1894,12 +1904,15 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1894,12 +1904,15 @@ public class TrendServiceImpl implements TrendService {
private
List
<
CrossingQueryVO
.
CycleDataElement
>
buildCrossingCycleData
(
String
crossId
,
List
<
CrossDataHistVO
>
poExtList
)
{
private
List
<
CrossingQueryVO
.
CycleDataElement
>
buildCrossingCycleData
(
String
crossId
,
List
<
CrossDataHistVO
>
poExtList
)
{
List
<
CrossingQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
List
<
CrossingQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
int
pedFlow
=
0
;
//
int pedFlow = 0;
for
(
CrossDataHistVO
po
:
poExtList
)
{
for
(
CrossDataHistVO
po
:
poExtList
)
{
CrossingQueryVO
.
CycleDataElement
vo
=
new
CrossingQueryVO
.
CycleDataElement
();
CrossingQueryVO
.
CycleDataElement
vo
=
new
CrossingQueryVO
.
CycleDataElement
();
vo
.
setTime
(
po
.
getStartTime
());
vo
.
setTime
(
po
.
getStartTime
());
vo
.
setFlow
(
po
.
getFlow
());
vo
.
setFlow
(
po
.
getFlow
());
vo
.
setPedFlow
(
pedFlow
);
//行人流量 + 非机动车流量 + 流量
vo
.
setAllFlow
(
0
+
po
.
getNonMotorFlow
()
+
po
.
getFlow
());
vo
.
setAllVehiceleFlow
(
po
.
getFlow
()
+
po
.
getNonMotorFlow
());
vo
.
setPedFlow
(
0
);
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setNonMotorFlow
(
0
);
//非机动车流量
vo
.
setTrafficFlowA
(
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowA
(
po
.
getTrafficFlowA
());
vo
.
setTrafficFlowB
(
po
.
getTrafficFlowB
());
vo
.
setTrafficFlowB
(
po
.
getTrafficFlowB
());
...
@@ -1991,14 +2004,9 @@ public class TrendServiceImpl implements TrendService {
...
@@ -1991,14 +2004,9 @@ public class TrendServiceImpl implements TrendService {
vo
.
setPedCrossRedLightRate
(
0.0
);
vo
.
setPedCrossRedLightRate
(
0.0
);
// vo.setVehheadDist(po.getVehheadDist());
// vo.setVehheadDist(po.getVehheadDist());
// vo.setTrafficFlowA(po.getTrafficFlowA());
// vo.setTrafficFlowB(po.getTrafficFlowB());
// vo.setTrafficFlowC(po.getTrafficFlowC());
vo
.
setNonMotorFlow
(
po
.
getNonMotorFlow
());
vo
.
setNonMotorFlow
(
po
.
getNonMotorFlow
());
vo
.
setV85
(
Math
.
round
(
po
.
getV85
()
*
100
)
/
100
);
vo
.
setV85
(
Math
.
round
(
po
.
getV85
()
*
100
)
/
100
);
vo
.
setPedFlow
(
pedFlow
);
vo
.
setAllFlow
(
pedFlow
+
po
.
getNonMotorFlow
()
+
po
.
getFlow
());
vo
.
setAllVehiceleFlow
(
po
.
getFlow
()
+
po
.
getNonMotorFlow
());
// vo.setTurn(po.getTurn());
// vo.setTurn(po.getTurn());
res
.
add
(
vo
);
res
.
add
(
vo
);
...
@@ -2520,28 +2528,28 @@ public class TrendServiceImpl implements TrendService {
...
@@ -2520,28 +2528,28 @@ public class TrendServiceImpl implements TrendService {
/**
/**
* 车道级数据查询
* 车道级数据查询
* @param
crossIdDateTime
VO
* @param
lanePeriod
VO
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@Override
@Override
public
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
CommonCrossIdDateTimeVO
crossIdDateTime
VO
)
throws
Exception
{
public
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
LanePeriodVO
lanePeriod
VO
)
throws
Exception
{
try
{
try
{
String
crossId
=
crossIdDateTime
VO
.
getCrossId
();
String
crossId
=
lanePeriod
VO
.
getCrossId
();
int
start
=
(
int
)
(
crossIdDateTime
VO
.
getStart
().
getTime
()
/
1000
);
int
start
=
(
int
)
(
lanePeriod
VO
.
getStart
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
crossIdDateTime
VO
.
getEnd
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
lanePeriod
VO
.
getEnd
().
getTime
()
/
1000
);
String
ids
=
crossIdDateTime
VO
.
getIds
();
String
ids
=
lanePeriod
VO
.
getIds
();
List
<
String
>
idsList
=
null
;
List
<
String
>
idsList
=
null
;
if
(!
StringUtils
.
isBlank
(
ids
))
{
if
(!
StringUtils
.
isBlank
(
ids
))
{
idsList
=
Arrays
.
asList
(
ids
.
split
(
","
));
idsList
=
Arrays
.
asList
(
ids
.
split
(
","
));
}
}
//分析粒度【5m:五分钟 10m:10分钟 30m:30分钟 1h:一小时】
//分析粒度【5m:五分钟 10m:10分钟 30m:30分钟 1h:一小时】
String
granularity
=
crossIdDateTime
VO
.
getGranularity
();
String
granularity
=
lanePeriod
VO
.
getGranularity
();
if
(
StringUtils
.
isBlank
(
granularity
))
{
if
(
StringUtils
.
isBlank
(
granularity
))
{
granularity
=
"5"
;
granularity
=
"5"
;
}
else
{
}
else
{
granularity
=
granularity
.
replace
(
"m"
,
""
).
replace
(
"h"
,
""
);
;
granularity
=
granularity
.
replace
(
"m"
,
""
).
replace
(
"h"
,
""
);
}
}
// 查询周期数据
// 查询周期数据
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/CommonCrossIdDateTimeVO.java
View file @
e40f4d0c
...
@@ -23,9 +23,6 @@ public class CommonCrossIdDateTimeVO {
...
@@ -23,9 +23,6 @@ public class CommonCrossIdDateTimeVO {
@ApiModelProperty
(
value
=
"路口ID"
)
@ApiModelProperty
(
value
=
"路口ID"
)
@NotBlank
(
message
=
"路口编号不能为空"
)
@NotBlank
(
message
=
"路口编号不能为空"
)
private
String
crossId
;
private
String
crossId
;
@ApiModelProperty
(
value
=
"车道IDs"
)
@NotBlank
(
message
=
"车道ids不能为空"
)
private
String
ids
;
@ApiModelProperty
(
value
=
"开始时间"
)
@ApiModelProperty
(
value
=
"开始时间"
)
@NotNull
(
message
=
"开始日期不能为空"
)
@NotNull
(
message
=
"开始日期不能为空"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/CrossingDirectionQueryVO.java
View file @
e40f4d0c
...
@@ -37,9 +37,9 @@ public class CrossingDirectionQueryVO {
...
@@ -37,9 +37,9 @@ public class CrossingDirectionQueryVO {
@ExcelProperty
(
"方向名称"
)
@ExcelProperty
(
"方向名称"
)
private
String
dirName
;
private
String
dirName
;
//
@ApiModelProperty(value = "总流量")
@ApiModelProperty
(
value
=
"总流量"
)
//
@ExcelProperty("总流量")
@ExcelProperty
(
"总流量"
)
//
private int allFlow;
private
int
allFlow
;
@ApiModelProperty
(
value
=
"行人流量"
)
@ApiModelProperty
(
value
=
"行人流量"
)
@ExcelProperty
(
"行人流量"
)
@ExcelProperty
(
"行人流量"
)
...
@@ -207,8 +207,8 @@ public class CrossingDirectionQueryVO {
...
@@ -207,8 +207,8 @@ public class CrossingDirectionQueryVO {
@ExcelProperty
(
"行人闯红灯率"
)
@ExcelProperty
(
"行人闯红灯率"
)
private
double
pedCrossRedLightRate
;
private
double
pedCrossRedLightRate
;
//
@ApiModelProperty(value = "车辆总和")
@ApiModelProperty
(
value
=
"车辆总和"
)
//
@ExcelProperty("车辆总和")
@ExcelProperty
(
"车辆总和"
)
//
private int allVehiceleFlow;
private
int
allVehiceleFlow
;
}
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/CrossingTurnQueryVO.java
View file @
e40f4d0c
...
@@ -49,9 +49,9 @@ public class CrossingTurnQueryVO {
...
@@ -49,9 +49,9 @@ public class CrossingTurnQueryVO {
@ExcelProperty
(
"转向类型名称"
)
@ExcelProperty
(
"转向类型名称"
)
private
String
turnTypeName
;
private
String
turnTypeName
;
//
@ApiModelProperty(value = "总流量")
@ApiModelProperty
(
value
=
"总流量"
)
//
@ExcelProperty("总流量")
@ExcelProperty
(
"总流量"
)
//
private int allFlow;
private
int
allFlow
;
@ApiModelProperty
(
value
=
"行人流量"
)
@ApiModelProperty
(
value
=
"行人流量"
)
@ExcelProperty
(
"行人流量"
)
@ExcelProperty
(
"行人流量"
)
...
@@ -219,8 +219,8 @@ public class CrossingTurnQueryVO {
...
@@ -219,8 +219,8 @@ public class CrossingTurnQueryVO {
@ExcelProperty
(
"行人闯红灯率"
)
@ExcelProperty
(
"行人闯红灯率"
)
private
double
pedCrossRedLightRate
;
private
double
pedCrossRedLightRate
;
//
@ApiModelProperty(value = "车辆总和")
@ApiModelProperty
(
value
=
"车辆总和"
)
//
@ExcelProperty("车辆总和")
@ExcelProperty
(
"车辆总和"
)
//
private int allVehiceleFlow;
private
int
allVehiceleFlow
;
}
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/LanePeriodVO.java
0 → 100644
View file @
e40f4d0c
package
net
.
wanji
.
opt
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotBlank
;
/**
* @author duanruiming
* @date 2024/05/17 9:00
*/
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"LanePeriodVO"
)
public
class
LanePeriodVO
extends
CommonCrossIdDateTimeVO
{
@ApiModelProperty
(
value
=
"分析粒度【5m:五分钟 10m:10分钟 30m:30分钟 1h:一小时】"
)
private
String
granularity
;
@ApiModelProperty
(
value
=
"车道IDs"
)
@NotBlank
(
message
=
"车道ids不能为空"
)
private
String
ids
;
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/TableQueryVO.java
View file @
e40f4d0c
...
@@ -118,7 +118,7 @@ public class TableQueryVO {
...
@@ -118,7 +118,7 @@ public class TableQueryVO {
@ExcelIgnore
@ExcelIgnore
private
Integer
dir
;
private
Integer
dir
;
@ExcelProperty
(
"方向"
)
@ExcelProperty
(
"方向
名称
"
)
private
String
dirName
;
private
String
dirName
;
@ApiModelProperty
(
value
=
"车道转向:1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头',\n"
)
@ApiModelProperty
(
value
=
"车道转向:1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头',\n"
)
...
...
wj-databus/src/main/resources/mapper/CrossDataHistMapper.xml
View file @
e40f4d0c
...
@@ -98,40 +98,41 @@
...
@@ -98,40 +98,41 @@
<!-- 交通指标-路口级统计 -->
<!-- 交通指标-路口级统计 -->
<select
id=
"selectByCrossIdAndStartEndStat"
resultType=
"net.wanji.databus.vo.CrossDataHistVO"
>
<select
id=
"selectByCrossIdAndStartEndStat"
resultType=
"net.wanji.databus.vo.CrossDataHistVO"
>
SELECT
SELECT
cross_id AS crossId,
t2.
cross_id AS crossId,
<choose>
<choose>
<!-- 小时 -->
<!-- 小时 -->
<when
test=
"granularity==1"
>
<when
test=
"granularity==1"
>
DATE_FORMAT(start_time, '%Y-%m-%d %H:00:00') AS startTime,
DATE_FORMAT(
t2.
start_time, '%Y-%m-%d %H:00:00') AS startTime,
</when>
</when>
<!-- 分钟 -->
<!-- 分钟 -->
<otherwise>
<otherwise>
DATE_FORMAT(
DATE_FORMAT(
CONCAT( DATE (
start_time ), ' ', HOUR ( start_time ), ':', FLOOR( MINUTE (
start_time ) / #{granularity} ) * #{granularity} ),
CONCAT( DATE (
t2.start_time ), ' ', HOUR ( t2.start_time ), ':', FLOOR( MINUTE ( t2.
start_time ) / #{granularity} ) * #{granularity} ),
'%Y-%m-%d %H:%i:00'
'%Y-%m-%d %H:%i:00'
) AS startTime,
) AS startTime,
</otherwise>
</otherwise>
</choose>
</choose>
SUM( flow ) AS flow,
SUM( flow ) AS flow,
avg( traffic_flow_C
) AS trafficFlowC,
COALESCE ( sum( traffic_flow_C ), 0
) AS trafficFlowC,
avg( traffic_flow_B
) AS trafficFlowB,
COALESCE ( sum( traffic_flow_B ), 0
) AS trafficFlowB,
avg( traffic_flow_A
) AS trafficFlowA,
COALESCE ( sum( traffic_flow_A ), 0
) AS trafficFlowA,
avg( speed ) AS speed,
avg(
t2.
speed ) AS speed,
MAX( queue_length ) AS queueLength,
MAX(
t2.
queue_length ) AS queueLength,
AVG( stop_times ) AS stopTimes
AVG(
t2.
stop_times ) AS stopTimes
FROM
FROM
t_cross_data_hist
t_base_cross_info t1
LEFT JOIN t_cross_data_hist t2 ON t1.id = t2.cross_id
WHERE 1=1
WHERE 1=1
<if
test=
"crossId != null"
>
<if
test=
"crossId != null"
>
AND cross_id = #{crossId}
AND
t2.
cross_id = #{crossId}
</if>
</if>
and batch_time
<![CDATA[ >= ]]>
#{startStamp}
and
t2.
batch_time
<![CDATA[ >= ]]>
#{startStamp}
and batch_time
<![CDATA[ <= ]]>
#{endStamp}
and
t2.
batch_time
<![CDATA[ <= ]]>
#{endStamp}
GROUP BY
GROUP BY
cross_id,
t2.
cross_id,
startT
ime
t2.start_t
ime
ORDER BY
ORDER BY
startT
ime DESC
t2.start_t
ime DESC
</select>
</select>
<select
id=
"selectMetricHistDTO"
resultType=
"net.wanji.databus.dto.MetricHistDTO"
>
<select
id=
"selectMetricHistDTO"
resultType=
"net.wanji.databus.dto.MetricHistDTO"
>
...
...
wj-databus/src/main/resources/mapper/CrossDirDataHistMapper.xml
View file @
e40f4d0c
This diff is collapsed.
Click to expand it.
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