Commit 330d24ca authored by duanruiming's avatar duanruiming

[update] 车道快照查询500条分页

parent c42b13fa
......@@ -38,7 +38,7 @@ public class LaneSnapshotDataQueryService implements LaneSnapshotService {
@Override
public List<CrossLaneSnapshotDataDTO> queryByCrossIdAndTimeSpan(
String crossId, int startTimeStamp, int endTimeStamp)
String crossId, int startTimeStamp, int endTimeStamp, int pageNum)
throws Exception {
List<CrossLaneSnapshotDataDTO> result = new ArrayList<>();
......@@ -58,8 +58,8 @@ public class LaneSnapshotDataQueryService implements LaneSnapshotService {
searchSourceBuilder
.query(boolQuery)
//.from(0)
.size(500);
.from(pageNum)
.size((pageNum + 1) * 500);
searchRequest.source(searchSourceBuilder);
SearchResponse response = client.search(searchRequest, RequestOptions.DEFAULT);
......
......@@ -10,7 +10,7 @@ import java.util.List;
* @date 2023/10/26 14:12
*/
public interface LaneSnapshotService {
List<CrossLaneSnapshotDataDTO> queryByCrossIdAndTimeSpan(String crossId, int startTimeStamp, int endTimeStamp) throws Exception;
List<CrossLaneSnapshotDataDTO> queryByCrossIdAndTimeSpan(String crossId, int startTimeStamp, int endTimeStamp, int pageNum) throws Exception;
int queryCountsByCrossIdAndTimeSpan(String crossId, int startTimeStamp, int endTimeStamp) throws Exception;
}
......@@ -1319,7 +1319,7 @@ public class TrendServiceImpl implements TrendService {
// 查询秒级数据
List<CrossLaneSnapshotDataDTO> dtoList =
laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, realTimeStartTimeStamp, endTimeStamp);
laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, realTimeStartTimeStamp, endTimeStamp, 0);
tableQueryVO.setRealTimeData(buildRealTimeList(dtoList));
// 查询周期数据
......@@ -1982,9 +1982,10 @@ public class TrendServiceImpl implements TrendService {
String crossId = crossIdDateTimeVO.getCrossId();
int start = (int) (crossIdDateTimeVO.getStart().getTime() / 1000);
int end = (int) (crossIdDateTimeVO.getEnd().getTime() / 1000);
int pageNum = crossIdDateTimeVO.getPageNum();
// 查询秒级数据
List<CrossLaneSnapshotDataDTO> dtoList =
laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, start, end);
laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, start, end, pageNum);
return buildRealTimeList(dtoList);
}
......
......@@ -17,7 +17,7 @@ import java.util.Date;
@Data
@NoArgsConstructor
@ApiModel(value = "CommonCrossIdDateTimeVO")
public class CommonCrossIdDateTimeVO {
public class CommonCrossIdDateTimeVO extends PageNumVO{
@ApiModelProperty(value = "路口ID")
@NotBlank(message = "路口编号不能为空")
private String crossId;
......
package net.wanji.opt.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author duanruiming
* @date 2024/05/22 10:24
*/
@Data
public class PageNumVO {
@ApiModelProperty(value = "当前页码")
private int pageNum;
}
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