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
8fafabbc
Commit
8fafabbc
authored
May 27, 2024
by
hanbing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
900b7da2
b1499500
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
207 additions
and
71 deletions
+207
-71
TrendController.java
...c/main/java/net/wanji/opt/controller/TrendController.java
+16
-4
AnalysisRidTurnIndicators.java
...ava/net/wanji/opt/po/trend/AnalysisRidTurnIndicators.java
+1
-1
TrendService.java
...ice/src/main/java/net/wanji/opt/service/TrendService.java
+4
-2
LaneSnapshotDataQueryService.java
...et/wanji/opt/service/es/LaneSnapshotDataQueryService.java
+1
-1
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+112
-56
CommonCrossIdDateTimeVO.java
...c/main/java/net/wanji/opt/vo/CommonCrossIdDateTimeVO.java
+1
-1
HoloEventVO.java
...e-service/src/main/java/net/wanji/opt/vo/HoloEventVO.java
+16
-0
LaneIdAliasNameVO.java
...ice/src/main/java/net/wanji/opt/vo/LaneIdAliasNameVO.java
+18
-0
LaneSnapshotIndexVO.java
...e/src/main/java/net/wanji/opt/vo/LaneSnapshotIndexVO.java
+30
-0
TableQueryVO.java
...-service/src/main/java/net/wanji/opt/vo/TableQueryVO.java
+3
-0
CrossLaneDataHistPOExt.java
...ain/java/net/wanji/databus/po/CrossLaneDataHistPOExt.java
+0
-4
CrossLaneDataRealTimePO.java
...in/java/net/wanji/databus/po/CrossLaneDataRealTimePO.java
+2
-0
CrossLaneDataHistMapper.xml
...bus/src/main/resources/mapper/CrossLaneDataHistMapper.xml
+3
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/controller/TrendController.java
View file @
8fafabbc
...
...
@@ -298,8 +298,8 @@ public class TrendController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
TableQueryVO
.
RealTimeDataElement
.
class
),
})
public
JsonViewObject
laneSnapshotIndex
(
@RequestBody
CommonCrossIdDateTimeVO
crossIdDateTime
VO
)
throws
Exception
{
List
<
TableQueryVO
.
RealTimeDataElement
>
result
=
trendService
.
laneSnapshotIndex
(
crossIdDateTime
VO
);
public
JsonViewObject
laneSnapshotIndex
(
@RequestBody
LaneSnapshotIndexVO
laneSnapshotIndex
VO
)
throws
Exception
{
List
<
TableQueryVO
.
RealTimeDataElement
>
result
=
trendService
.
laneSnapshotIndex
(
laneSnapshotIndex
VO
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
...
...
@@ -322,8 +322,20 @@ public class TrendController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
HoloEventInfoPO
.
class
),
})
public
JsonViewObject
holoEvenList
(
@RequestBody
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
{
List
<
HoloEventInfoPO
>
result
=
trendService
.
holoEvenList
(
crossIdDateTimeVO
);
public
JsonViewObject
holoEvenList
(
@RequestBody
HoloEventVO
holoEventVO
)
throws
Exception
{
List
<
HoloEventInfoPO
>
result
=
trendService
.
holoEvenList
(
holoEventVO
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
@ApiOperation
(
value
=
"车道查询列表"
,
notes
=
"车道查询列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/laneIdList"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LaneIdAliasNameVO
.
class
),
})
public
JsonViewObject
laneIdList
(
@RequestBody
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
{
List
<
LaneIdAliasNameVO
>
result
=
trendService
.
laneIdList
(
commonCrossIdVO
);
return
JsonViewObject
.
newInstance
().
success
(
result
);
}
}
\ No newline at end of file
signal-optimize-service/src/main/java/net/wanji/opt/po/trend/AnalysisRidTurnIndicators.java
View file @
8fafabbc
...
...
@@ -16,7 +16,7 @@ import java.util.Date;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_analysis_rid_turn_indicators"
)
@ApiModel
(
value
=
"AnalysisRidTurnIndicators"
,
description
=
""
)
@ApiModel
(
value
=
"AnalysisRidTurnIndicators"
,
description
=
"
通过航向角计算方向转向流量排队数据
"
)
public
class
AnalysisRidTurnIndicators
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/TrendService.java
View file @
8fafabbc
...
...
@@ -61,9 +61,11 @@ public interface TrendService {
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
;
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
CommonCrossIdDateTimeVO
crossIdDateTime
VO
)
throws
Exception
;
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
LaneSnapshotIndexVO
laneSnapshotIndex
VO
)
throws
Exception
;
List
<
AnalysisRidTurnIndicators
>
lanePeriodTurnData
(
LanePeriodTurnVO
lanePeriodTurnVO
)
throws
Exception
;
List
<
HoloEventInfoPO
>
holoEvenList
(
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
;
List
<
HoloEventInfoPO
>
holoEvenList
(
HoloEventVO
holoEventVO
)
throws
Exception
;
List
<
LaneIdAliasNameVO
>
laneIdList
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
;
}
signal-optimize-service/src/main/java/net/wanji/opt/service/es/LaneSnapshotDataQueryService.java
View file @
8fafabbc
...
...
@@ -63,7 +63,7 @@ public class LaneSnapshotDataQueryService implements LaneSnapshotService {
searchSourceBuilder
.
query
(
boolQuery
)
.
from
(
pageNum
)
.
from
(
pageNum
*
500
)
.
size
((
pageNum
+
1
)
*
500
);
searchRequest
.
source
(
searchSourceBuilder
);
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
8fafabbc
...
...
@@ -128,7 +128,7 @@ public class TrendServiceImpl implements TrendService {
RidInfoMapper
ridInfoMapper
,
BaseCrossDirInfoMapper
baseCrossDirInfoMapper
,
CrossSchemeOptLogMapper
crossSchemeOptLogMapper
,
GreenwaveCrossMapper
greenwaveCrossMapper
,
CrossDirDataRealtimeMapper
crossDirDataRealtimeMapper
,
GreenwaveHistMapper
greenwaveHistMapper
,
GreenwaveRealtimeMapper
greenwaveRealtimeMapper
,
SceneStrategyIdeaMapper
strategyIdeaMapper
,
StrategyMapper
strategyMapper
,
BaseCrossSchedulesMapper
baseCrossSchedulesMapper
,
BaseCrossSchedulesPlanMapper
baseCrossSchedulesPlanMapper
,
BaseCrossSectionMapper
baseCrossSectionMapper
,
BaseCrossSchemeMapper
crossSchemeMapper
,
BaseCrossSchemeMapper
baseCrossSchemeMapper
,
BaseCrossPhaseMapper
baseCrossPhaseMapper
,
BaseCrossPhaseLightsMapper
crossPhaseLightsMapper
,
BaseCrossLaneLightsMapper
baseCrossLaneLightsMapper
,
CrossBaseLaneInfoMapper
crossBaseLaneInfoMapper
,
CrossTurnDataHistMapper
crossTurnDataHistMapper
,
@Qualifier
(
"greenwaveSceneMapper"
)
GreenwaveSceneMapper
greenwaveSceneMapper
,
@Qualifier
(
"sceneStrategyMapper"
)
SceneStrategyMapper
sceneStrategyMapper
,
@Qualifier
(
"sceneMapper"
)
SceneMapper
sceneMapper
,
@Qualifier
(
"baseCrossPlanMapper"
)
BaseCrossPlanMapper
baseCrossPlanMapper
,
MainlineEvaluateServiceImpl
mainlineEvaluateServiceImpl
,
CrossLaneDataHistMapper
crossLaneDataHistMapper
,
LaneSnapshotDataQueryService
laneSnapshotDataQueryService
,
DirectionMappingsConfig
directionMappingsConfig
,
CrossDataHistMapper
crossDataHistMapper
,
RunningEvaluateServiceImpl
runningEvaluateService
,
AnalysisRidTurnIndicatorsMapper
ridTurnIndicatorsMapper
,
HoloEventMapper
holoEventMapper
)
{
AnalysisRidTurnIndicatorsMapper
ridTurnIndicatorsMapper
,
HoloEventMapper
holoEventMapper
)
{
this
.
greenwaveInfoMapper
=
greenwaveInfoMapper
;
this
.
baseCrossInfoMapper
=
baseCrossInfoMapper
;
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
...
...
@@ -1176,6 +1176,7 @@ public class TrendServiceImpl implements TrendService {
// 获取当前日期和时间的 Calendar 对象
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
2024
,
Calendar
.
JANUARY
,
15
,
10
,
0
,
0
);
// 设置时、分、秒和毫秒为 0,以获取当天的 00:00:00
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
...
...
@@ -1285,8 +1286,9 @@ public class TrendServiceImpl implements TrendService {
element
.
setSpeed
(
Math
.
round
(
dto
.
getMeanV
()
*
100.0
)
/
100.0
);
element
.
setHeadSpeed
(
Math
.
round
(
dto
.
getStartV
()
*
100.0
)
/
100.0
);
element
.
setMailSpeed
(
Math
.
round
(
dto
.
getEndV
()
*
100.0
)
/
100.0
);
element
.
setTeamHeadDistance
(
dto
.
getTeamHeadDistance
());
element
.
setTeamTailDistance
(
dto
.
getTeamTailDistance
());
element
.
setTeamHeadDistance
(
Math
.
round
(
dto
.
getTeamHeadDistance
()*
100.0
)
/
100.0
);
element
.
setTeamTailDistance
(
Math
.
round
(
dto
.
getTeamTailDistance
()*
100.0
)
/
100.0
);
element
.
setStdSpaceHeadway
(
Math
.
round
(
dto
.
getStdSpaceHeadway
()
*
100.0
)
/
100.0
);
res
.
add
(
element
);
}
...
...
@@ -1356,10 +1358,6 @@ public class TrendServiceImpl implements TrendService {
private
List
<
TableQueryVO
.
CycleDataElement
>
buildCycleData
(
String
crossId
,
List
<
CrossLaneDataHistPOExt
>
poExtList
)
{
List
<
TableQueryVO
.
CycleDataElement
>
res
=
new
ArrayList
<>();
LambdaQueryWrapper
<
CrossBaseLaneInfoPO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
CrossBaseLaneInfoPO:
:
getCrossId
,
crossId
);
List
<
CrossBaseLaneInfoPO
>
crossBaseLaneInfoPOS
=
crossBaseLaneInfoMapper
.
selectList
(
queryWrapper
);
int
pedFlow
=
0
;
for
(
CrossLaneDataHistPOExt
po
:
poExtList
)
{
TableQueryVO
.
CycleDataElement
vo
=
new
TableQueryVO
.
CycleDataElement
();
...
...
@@ -1408,28 +1406,20 @@ public class TrendServiceImpl implements TrendService {
vo
.
setNonMotorFlow
(
po
.
getNonMotorFlow
());
vo
.
setV85
(
po
.
getV85
());
vo
.
setPedFlow
(
pedFlow
);
vo
.
setAllFlow
(
pedFlow
+
pedFlow
+
po
.
getNonMotorFlow
());
vo
.
setAllFlow
(
pedFlow
+
pedFlow
+
po
.
getNonMotorFlow
()
+
po
.
getFlow
()
);
vo
.
setAllVehiceleFlow
(
po
.
getFlow
()
+
po
.
getNonMotorFlow
());
Integer
turn
=
null
;
for
(
CrossBaseLaneInfoPO
crossBaseLaneInfoPO
:
crossBaseLaneInfoPOS
)
{
if
(
StringUtils
.
equalsIgnoreCase
(
laneId
,
crossBaseLaneInfoPO
.
getId
()))
{
turn
=
crossBaseLaneInfoPO
.
getTurn
();
}
}
vo
.
setTurn
(
turn
);
vo
.
setTurn
(
po
.
getTurn
());
String
dirName
=
BaseEnum
.
SignalDirectionEnum
.
getNameByCode
(
po
.
getDir
());
String
turnName
=
TurnConvertEnum
.
getDescByKey
(
turn
);
String
turnName
=
TurnConvertEnum
.
getDescByKey
(
po
.
getTurn
()
);
vo
.
setLaneSort
(
String
.
join
(
"-"
,
dirName
,
turnName
,
String
.
valueOf
(
po
.
getSort
())));
res
.
add
(
vo
);
}
List
<
TableQueryVO
.
CycleDataElement
>
sortedRes
=
res
.
stream
()
.
sorted
(
Comparator
.
comparing
(
TableQueryVO
.
CycleDataElement
::
getTime
))
.
sorted
(
Comparator
.
comparing
(
TableQueryVO
.
CycleDataElement
::
getTime
)
.
reversed
()
)
.
collect
(
Collectors
.
toList
());
return
sortedRes
;
}
...
...
@@ -1966,54 +1956,120 @@ public class TrendServiceImpl implements TrendService {
@Override
public
List
<
TableQueryVO
.
CycleDataElement
>
laneTrafficIndex
(
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
{
String
crossId
=
crossIdDateTimeVO
.
getCrossId
();
int
start
=
(
int
)
(
crossIdDateTimeVO
.
getStart
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
crossIdDateTimeVO
.
getEnd
().
getTime
()
/
1000
);
try
{
String
crossId
=
crossIdDateTimeVO
.
getCrossId
();
int
start
=
(
int
)
(
crossIdDateTimeVO
.
getStart
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
crossIdDateTimeVO
.
getEnd
().
getTime
()
/
1000
);
// 查询周期数据
List
<
CrossLaneDataHistPOExt
>
poExtList
=
crossLaneDataHistMapper
.
selectByCrossIdAndTimeSpan
(
crossId
,
start
,
end
);
return
buildCycleData
(
crossId
,
poExtList
);
// 查询周期数据
List
<
CrossLaneDataHistPOExt
>
poExtList
=
crossLaneDataHistMapper
.
selectByCrossIdAndTimeSpan
(
crossId
,
start
,
end
);
return
buildCycleData
(
crossId
,
poExtList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"车道数据查询异常:"
,
e
);
throw
new
RuntimeException
(
e
);
}
}
@Override
public
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
{
String
crossId
=
crossIdDateTimeVO
.
getCrossId
();
int
start
=
(
int
)
(
crossIdDateTimeVO
.
getStart
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
crossIdDateTimeVO
.
getEnd
().
getTime
()
/
1000
);
int
pageNum
=
crossIdDateTimeVO
.
getPageNum
();
String
laneId
=
crossIdDateTimeVO
.
getLaneId
();
// 查询秒级数据
List
<
CrossLaneSnapshotDataDTO
>
dtoList
=
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
pageNum
,
laneId
);
return
buildRealTimeList
(
dtoList
);
public
List
<
TableQueryVO
.
RealTimeDataElement
>
laneSnapshotIndex
(
LaneSnapshotIndexVO
laneSnapshotIndexVO
)
throws
Exception
{
try
{
String
crossId
=
laneSnapshotIndexVO
.
getCrossId
();
int
start
=
(
int
)
(
laneSnapshotIndexVO
.
getStart
().
getTime
()
/
1000
);
int
end
=
(
int
)
(
laneSnapshotIndexVO
.
getEnd
().
getTime
()
/
1000
);
int
pageNum
=
laneSnapshotIndexVO
.
getPageNum
();
String
laneId
=
laneSnapshotIndexVO
.
getLaneId
();
// 查询秒级数据
List
<
CrossLaneSnapshotDataDTO
>
dtoList
=
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
pageNum
,
laneId
);
List
<
TableQueryVO
.
RealTimeDataElement
>
result
=
buildRealTimeList
(
dtoList
);
List
<
TableQueryVO
.
RealTimeDataElement
>
sorts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
sorts
=
result
.
stream
().
sorted
(
Comparator
.
comparing
(
TableQueryVO
.
RealTimeDataElement
::
getTime
)).
collect
(
Collectors
.
toList
());
}
return
sorts
;
}
catch
(
Exception
e
)
{
log
.
error
(
"车道快照数据查询异常:"
,
e
);
throw
new
Exception
(
e
);
}
}
@Override
public
List
<
AnalysisRidTurnIndicators
>
lanePeriodTurnData
(
LanePeriodTurnVO
lanePeriodTurnVO
)
throws
Exception
{
String
crossId
=
lanePeriodTurnVO
.
getCrossId
();
Date
start
=
lanePeriodTurnVO
.
getStart
();
Date
end
=
lanePeriodTurnVO
.
getEnd
();
String
granularity
=
lanePeriodTurnVO
.
getGranularity
();
if
(
StringUtils
.
isBlank
(
granularity
))
{
granularity
=
"5m"
;
try
{
String
crossId
=
lanePeriodTurnVO
.
getCrossId
();
Date
start
=
lanePeriodTurnVO
.
getStart
();
Date
end
=
lanePeriodTurnVO
.
getEnd
();
String
granularity
=
lanePeriodTurnVO
.
getGranularity
();
if
(
StringUtils
.
isBlank
(
granularity
))
{
granularity
=
"5m"
;
}
LambdaQueryWrapper
<
AnalysisRidTurnIndicators
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AnalysisRidTurnIndicators:
:
getCrossId
,
crossId
);
queryWrapper
.
eq
(
AnalysisRidTurnIndicators:
:
getGranularity
,
granularity
);
queryWrapper
.
between
(
AnalysisRidTurnIndicators:
:
getWindowEndTime
,
start
,
end
);
queryWrapper
.
orderByDesc
(
AnalysisRidTurnIndicators:
:
getWindowStartTime
);
return
ridTurnIndicatorsMapper
.
selectList
(
queryWrapper
);
}
catch
(
Exception
e
)
{
log
.
error
(
"全是周期车道数据方向转向查询异常:"
,
e
);
throw
new
Exception
(
e
);
}
}
@Override
public
List
<
HoloEventInfoPO
>
holoEvenList
(
HoloEventVO
holoEventVO
)
throws
Exception
{
try
{
LambdaQueryWrapper
<
HoloEventInfoPO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
String
crossId
=
holoEventVO
.
getCrossId
();
Date
start
=
holoEventVO
.
getStart
();
LocalDateTime
localDateTime1
=
LocalDateTime
.
ofInstant
(
start
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
Date
end
=
holoEventVO
.
getEnd
();
LocalDateTime
localDateTime2
=
LocalDateTime
.
ofInstant
(
end
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
String
types
=
holoEventVO
.
getTypes
();
queryWrapper
.
eq
(
HoloEventInfoPO:
:
getCrossId
,
crossId
);
queryWrapper
.
between
(
HoloEventInfoPO:
:
getDetectTime
,
localDateTime1
,
localDateTime2
);
List
<
HoloEventInfoPO
>
holoEventInfoPOS
=
holoEventMapper
.
selectList
(
queryWrapper
);
List
<
HoloEventInfoPO
>
results
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
holoEventInfoPOS
)
&&
StringUtils
.
isNotBlank
(
types
))
{
for
(
HoloEventInfoPO
holoEventInfoPO
:
holoEventInfoPOS
)
{
String
type
=
holoEventInfoPO
.
getType
();
if
(
types
.
contains
(
type
))
{
results
.
add
(
holoEventInfoPO
);
}
}
}
results
=
holoEventInfoPOS
;
return
results
;
}
catch
(
Exception
e
)
{
log
.
error
(
"全息事件查询异常:"
,
e
);
throw
new
Exception
(
e
);
}
LambdaQueryWrapper
<
AnalysisRidTurnIndicators
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AnalysisRidTurnIndicators:
:
getCrossId
,
crossId
);
queryWrapper
.
eq
(
AnalysisRidTurnIndicators:
:
getGranularity
,
granularity
);
queryWrapper
.
between
(
AnalysisRidTurnIndicators:
:
getRuksj
,
start
,
end
);
return
ridTurnIndicatorsMapper
.
selectList
(
queryWrapper
);
}
@Override
public
List
<
HoloEventInfoPO
>
holoEvenList
(
CommonCrossIdDateTimeVO
crossIdDateTimeVO
)
throws
Exception
{
LambdaQueryWrapper
<
HoloEventInfoPO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
String
crossId
=
crossIdDateTimeVO
.
getCrossId
();
Date
start
=
crossIdDateTimeVO
.
getStart
();
LocalDateTime
localDateTime1
=
LocalDateTime
.
ofInstant
(
start
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
Date
end
=
crossIdDateTimeVO
.
getEnd
();
LocalDateTime
localDateTime2
=
LocalDateTime
.
ofInstant
(
end
.
toInstant
(),
ZoneId
.
of
(
"+8"
));
queryWrapper
.
eq
(
HoloEventInfoPO:
:
getCrossId
,
crossId
);
queryWrapper
.
between
(
HoloEventInfoPO:
:
getDetectTime
,
localDateTime1
,
localDateTime2
);
return
holoEventMapper
.
selectList
(
queryWrapper
);
public
List
<
LaneIdAliasNameVO
>
laneIdList
(
CommonCrossIdVO
commonCrossIdVO
)
throws
Exception
{
try
{
List
<
LaneIdAliasNameVO
>
laneIdAliasNameVOS
=
new
ArrayList
<>();
LambdaQueryWrapper
<
CrossBaseLaneInfoPO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
CrossBaseLaneInfoPO:
:
getCrossId
,
commonCrossIdVO
.
getCrossId
());
queryWrapper
.
eq
(
CrossBaseLaneInfoPO:
:
getType
,
"2"
);
List
<
CrossBaseLaneInfoPO
>
laneInfoPOS
=
crossBaseLaneInfoMapper
.
selectList
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
laneInfoPOS
))
{
for
(
CrossBaseLaneInfoPO
po
:
laneInfoPOS
)
{
LaneIdAliasNameVO
laneIdAliasNameVO
=
new
LaneIdAliasNameVO
();
String
laneId
=
po
.
getId
();
Integer
dir
=
po
.
getDir
();
Integer
turn
=
po
.
getTurn
();
String
dirName
=
BaseEnum
.
SignalDirectionEnum
.
getNameByCode
(
dir
);
String
turnName
=
TurnConvertEnum
.
getDescByKey
(
turn
);
laneIdAliasNameVO
.
setLaneId
(
laneId
);
laneIdAliasNameVO
.
setAliasName
(
String
.
join
(
"-"
,
dirName
,
turnName
,
laneId
.
substring
(
laneId
.
length
()
-
2
)));
laneIdAliasNameVOS
.
add
(
laneIdAliasNameVO
);
}
}
return
laneIdAliasNameVOS
;
}
catch
(
Exception
e
)
{
log
.
error
(
"车道基本信息查询失败:"
,
e
);
throw
new
Exception
(
e
);
}
}
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/CommonCrossIdDateTimeVO.java
View file @
8fafabbc
...
...
@@ -17,7 +17,7 @@ import java.util.Date;
@Data
@NoArgsConstructor
@ApiModel
(
value
=
"CommonCrossIdDateTimeVO"
)
public
class
CommonCrossIdDateTimeVO
extends
PageNumVO
{
public
class
CommonCrossIdDateTimeVO
{
@ApiModelProperty
(
value
=
"路口ID"
)
@NotBlank
(
message
=
"路口编号不能为空"
)
private
String
crossId
;
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/HoloEventVO.java
0 → 100644
View file @
8fafabbc
package
net
.
wanji
.
opt
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2024/05/24 8:57
*/
@Data
@ApiModel
(
value
=
"HoloEventVO"
,
description
=
"全息事件查询实体"
)
public
class
HoloEventVO
extends
CommonCrossIdDateTimeVO
{
@ApiModelProperty
(
value
=
"事件类型"
)
private
String
types
;
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/LaneIdAliasNameVO.java
0 → 100644
View file @
8fafabbc
package
net
.
wanji
.
opt
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author duanruiming
* @date 2024/05/23 9:28
*/
@Data
@ApiModel
(
value
=
"LaneIdAliasNameVO"
,
description
=
"车道名称实体"
)
public
class
LaneIdAliasNameVO
{
@ApiModelProperty
(
value
=
"车道编号"
)
private
String
laneId
;
@ApiModelProperty
(
value
=
"车道别名"
)
private
String
aliasName
;
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/LaneSnapshotIndexVO.java
0 → 100644
View file @
8fafabbc
package
net
.
wanji
.
opt
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* @author duanruiming
* @date 2024/05/23 10:17
*/
@Data
@ApiModel
(
value
=
"LaneSnapshotIndexVO"
,
description
=
"车道快照请求体"
)
public
class
LaneSnapshotIndexVO
extends
PageNumVO
{
@ApiModelProperty
(
value
=
"路口ID"
)
@NotBlank
(
message
=
"路口编号不能为空"
)
private
String
crossId
;
@ApiModelProperty
(
value
=
"开始时间"
)
@NotNull
(
message
=
"开始日期不能为空"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
start
;
@ApiModelProperty
(
value
=
"结束时间"
)
@NotNull
(
message
=
"结束时间不能为空"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
end
;
}
signal-optimize-service/src/main/java/net/wanji/opt/vo/TableQueryVO.java
View file @
8fafabbc
...
...
@@ -72,6 +72,9 @@ public class TableQueryVO {
@ApiModelProperty
(
value
=
"队尾距离(米)"
)
private
double
teamTailDistance
;
@ApiModelProperty
(
value
=
"车头间距方差>车道内空间占有率"
)
private
double
stdSpaceHeadway
;
}
@NoArgsConstructor
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossLaneDataHistPOExt.java
View file @
8fafabbc
...
...
@@ -12,10 +12,6 @@ public class CrossLaneDataHistPOExt extends CrossLaneDataRealTimePO{
private
Integer
dir
;
// 车道序号,从左车道开始编号11、12、13...
private
Integer
sort
;
// 时间占有率
private
Double
timeOccupancy
;
// 空间占有率即车辆负荷比
private
Double
vehicleNumsRatioMean
;
// 转向
private
Integer
turn
;
...
...
wj-databus/src/main/java/net/wanji/databus/po/CrossLaneDataRealTimePO.java
View file @
8fafabbc
package
net
.
wanji
.
databus
.
po
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -72,6 +73,7 @@ public class CrossLaneDataRealTimePO {
@ApiModelProperty
(
value
=
"非机动车流量"
,
notes
=
""
)
private
int
nonMotorFlow
;
@ApiModelProperty
(
value
=
"85位速度(km/h)"
,
notes
=
""
)
@TableField
(
value
=
"v_85"
)
private
double
v85
;
@ApiModelProperty
(
value
=
"大车流量"
,
notes
=
""
)
private
int
trafficFlowA
;
...
...
wj-databus/src/main/resources/mapper/CrossLaneDataHistMapper.xml
View file @
8fafabbc
...
...
@@ -103,8 +103,9 @@
</select>
<select
id=
"selectByCrossIdAndTimeSpan"
resultType=
"net.wanji.databus.po.CrossLaneDataHistPOExt"
>
SELECT t1.id, t2.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.start_time
SELECT t1.id, t2.dir,t2.turn, 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.start_time,
t1.traffic_flow_A, t1.traffic_flow_B, t1.traffic_flow_C,t1.v_85, t1.non_motor_flow, t1.time_occupancy
FROM t_lane_data_hist t1 JOIN t_base_lane_info t2 ON t1.id = t2.id
where t1.cross_id = #{crossId}
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