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
0cc4d1c7
Commit
0cc4d1c7
authored
Jun 24, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 微观大数据平台-事件查询
parent
68ddffcc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
+22
-6
LaneSnapshotDataQueryService.java
...et/wanji/opt/service/es/LaneSnapshotDataQueryService.java
+11
-1
LaneSnapshotService.java
...in/java/net/wanji/opt/service/es/LaneSnapshotService.java
+2
-1
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+7
-4
LaneSnapshotIndexVO.java
...e/src/main/java/net/wanji/opt/vo/LaneSnapshotIndexVO.java
+2
-0
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/es/LaneSnapshotDataQueryService.java
View file @
0cc4d1c7
...
...
@@ -37,7 +37,7 @@ public class LaneSnapshotDataQueryService implements LaneSnapshotService {
@Override
public
List
<
CrossLaneSnapshotDataDTO
>
queryByCrossIdAndTimeSpan
(
String
crossId
,
int
startTimeStamp
,
int
endTimeStamp
,
int
pageNum
,
String
laneId
)
String
crossId
,
int
startTimeStamp
,
int
endTimeStamp
,
int
pageNum
,
String
laneId
,
boolean
overFlow
)
throws
Exception
{
List
<
CrossLaneSnapshotDataDTO
>
result
=
new
ArrayList
<>();
...
...
@@ -50,10 +50,20 @@ public class LaneSnapshotDataQueryService implements LaneSnapshotService {
.
gte
(
startTimeStamp
)
.
lte
(
endTimeStamp
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
()
.
must
(
matchQuery
)
.
must
(
rangeQuery
);
// 是否是溢出事件
MatchQueryBuilder
overFlowQuery
=
null
;
if
(
overFlow
)
{
overFlowQuery
=
QueryBuilders
.
matchQuery
(
"overflow"
,
true
);
boolQuery
.
must
(
overFlowQuery
);
}
// 车道号筛选
String
[]
split
=
null
;
if
(
StringUtils
.
isNotBlank
(
laneId
))
{
split
=
laneId
.
split
(
","
);
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/es/LaneSnapshotService.java
View file @
0cc4d1c7
...
...
@@ -11,7 +11,8 @@ import java.util.List;
*/
public
interface
LaneSnapshotService
{
List
<
CrossLaneSnapshotDataDTO
>
queryByCrossIdAndTimeSpan
(
String
crossId
,
int
startTimeStamp
,
int
endTimeStamp
,
int
pageNum
,
String
laneId
)
throws
Exception
;
int
endTimeStamp
,
int
pageNum
,
String
laneId
,
boolean
overFlow
)
throws
Exception
;
int
queryCountsByCrossIdAndTimeSpan
(
String
crossId
,
int
startTimeStamp
,
int
endTimeStamp
)
throws
Exception
;
}
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
0cc4d1c7
...
...
@@ -1326,7 +1326,7 @@ public class TrendServiceImpl implements TrendService {
// 查询秒级数据
List
<
CrossLaneSnapshotDataDTO
>
dtoList
=
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
realTimeStartTimeStamp
,
endTimeStamp
,
0
,
null
);
endTimeStamp
,
0
,
null
,
false
);
tableQueryVO
.
setRealTimeData
(
buildRealTimeList
(
dtoList
));
// 查询周期数据
...
...
@@ -1949,9 +1949,11 @@ public class TrendServiceImpl implements TrendService {
int
end
=
(
int
)
(
laneSnapshotIndexVO
.
getEnd
().
getTime
()
/
1000
);
int
pageNum
=
laneSnapshotIndexVO
.
getPageNum
();
String
laneId
=
laneSnapshotIndexVO
.
getLaneId
();
boolean
overFlow
=
laneSnapshotIndexVO
.
isOverFlow
();
// 查询秒级数据
List
<
CrossLaneSnapshotDataDTO
>
dtoList
=
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
pageNum
,
laneId
);
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
pageNum
,
laneId
,
overFlow
);
List
<
TableQueryVO
.
RealTimeDataElement
>
result
=
buildRealTimeList
(
dtoList
);
List
<
TableQueryVO
.
RealTimeDataElement
>
sorts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
...
...
@@ -2007,8 +2009,9 @@ public class TrendServiceImpl implements TrendService {
results
.
add
(
holoEventInfoPO
);
}
}
}
else
{
results
=
holoEventInfoPOS
;
}
results
=
holoEventInfoPOS
;
return
results
;
}
catch
(
Exception
e
)
{
log
.
error
(
"全息事件查询异常:"
,
e
);
...
...
@@ -2181,7 +2184,7 @@ public class TrendServiceImpl implements TrendService {
String
laneId
=
laneSnapshotIndexVO
.
getLaneId
();
// 查询秒级数据
List
<
CrossLaneSnapshotDataDTO
>
dtoList
=
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
-
1
,
laneId
);
laneSnapshotDataQueryService
.
queryByCrossIdAndTimeSpan
(
crossId
,
start
,
end
,
-
1
,
laneId
,
false
);
List
<
TableQueryVO
.
RealTimeDataElement
>
result
=
buildRealTimeList
(
dtoList
);
List
<
TableQueryVO
.
RealTimeDataElement
>
dataList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
...
...
signal-optimize-service/src/main/java/net/wanji/opt/vo/LaneSnapshotIndexVO.java
View file @
0cc4d1c7
...
...
@@ -27,4 +27,6 @@ public class LaneSnapshotIndexVO extends PageNumVO {
@NotNull
(
message
=
"结束时间不能为空"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
end
;
@ApiModelProperty
(
value
=
"溢出数据"
)
private
boolean
overFlow
;
}
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