Commit 0cc4d1c7 authored by duanruiming's avatar duanruiming

[update] 微观大数据平台-事件查询

parent 68ddffcc
......@@ -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(",");
......
......@@ -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;
}
......@@ -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;
}
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)) {
......
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment