|
|
@@ -10,6 +10,8 @@ import java.util.stream.Collectors; |
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.carapi.radar.helper.RadarDataHelper; |
|
|
|
import com.ningdatech.carapi.road.model.entity.ComprehensiveSituation; |
|
|
|
import com.ningdatech.carapi.road.model.entity.TrafficFlow; |
|
|
@@ -180,11 +182,11 @@ public class RoadMonitorManage { |
|
|
|
} |
|
|
|
|
|
|
|
private void setDefaultScores(ComprehensiveSituationVO vo) { |
|
|
|
vo.setRoadScore(100); |
|
|
|
vo.setCarScore(100); |
|
|
|
vo.setDriverScore(100); |
|
|
|
vo.setEnvironmentScore(100); |
|
|
|
vo.setRoadSafetyIndex(100); |
|
|
|
vo.setRoadScore(85); |
|
|
|
vo.setCarScore(85); |
|
|
|
vo.setDriverScore(85); |
|
|
|
vo.setEnvironmentScore(85); |
|
|
|
vo.setRoadSafetyIndex(85); |
|
|
|
} |
|
|
|
|
|
|
|
private void getDataVo(String dataKey, ComprehensiveSituationVO vo, Jedis jedis) { |
|
|
@@ -390,21 +392,22 @@ public class RoadMonitorManage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public List<RoadDangerBehaviorVO> getRoadDangerBehaviorData(RoadMonitorReq req) { |
|
|
|
public PageVo<RoadDangerBehaviorVO> getRoadDangerBehaviorData(RoadMonitorReq req) { |
|
|
|
List<String> regionList = req.getRegionList(); |
|
|
|
// 从列表中查询数据 |
|
|
|
List<RoadBehaviorAnalysis> list = roadBehaviorAnalysisService.list(Wrappers.lambdaQuery(RoadBehaviorAnalysis.class) |
|
|
|
.in(RoadBehaviorAnalysis::getRegion, regionList) |
|
|
|
.like(StringUtils.isNoneBlank(req.getBehavior()),RoadBehaviorAnalysis::getBehavior, req.getBehavior()) |
|
|
|
.eq(Objects.nonNull(req.getType()),RoadBehaviorAnalysis::getType, req.getType()) |
|
|
|
.ge(Objects.nonNull(req.getStartTime()), RoadBehaviorAnalysis::getBehaviorTime, req.getStartTime()) |
|
|
|
.le(Objects.nonNull(req.getEndTime()), RoadBehaviorAnalysis::getBehaviorTime, req.getEndTime()) |
|
|
|
.eq(Objects.nonNull(req.getIsWarn()),RoadBehaviorAnalysis::getIsWarn, req.getIsWarn()) |
|
|
|
.orderByDesc(RoadBehaviorAnalysis::getBehaviorTime)); |
|
|
|
if (CollUtil.isEmpty(list)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
Page<RoadBehaviorAnalysis> pageResult = roadBehaviorAnalysisService.page(new Page<>(req.getPageNumber(), req.getPageSize()), |
|
|
|
Wrappers.lambdaQuery(RoadBehaviorAnalysis.class) |
|
|
|
.in(RoadBehaviorAnalysis::getRegion, regionList) |
|
|
|
.like(StringUtils.isNoneBlank(req.getBehavior()), RoadBehaviorAnalysis::getBehavior, req.getBehavior()) |
|
|
|
.eq(Objects.nonNull(req.getType()), RoadBehaviorAnalysis::getType, req.getType()) |
|
|
|
.ge(Objects.nonNull(req.getStartTime()), RoadBehaviorAnalysis::getBehaviorTime, req.getStartTime()) |
|
|
|
.le(Objects.nonNull(req.getEndTime()), RoadBehaviorAnalysis::getBehaviorTime, req.getEndTime()) |
|
|
|
.eq(Objects.nonNull(req.getIsWarn()), RoadBehaviorAnalysis::getIsWarn, req.getIsWarn()) |
|
|
|
.orderByDesc(RoadBehaviorAnalysis::getBehaviorTime)); |
|
|
|
if (CollUtil.isEmpty(pageResult.getRecords())){ |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
return list.stream().map(roadBehaviorAnalysis -> { |
|
|
|
List<RoadDangerBehaviorVO> collect = pageResult.getRecords().stream().map(roadBehaviorAnalysis -> { |
|
|
|
RoadDangerBehaviorVO vo = new RoadDangerBehaviorVO(); |
|
|
|
vo.setId(roadBehaviorAnalysis.getId()); |
|
|
|
vo.setRecord(roadBehaviorAnalysis.getBehavior()); |
|
|
@@ -418,6 +421,7 @@ public class RoadMonitorManage { |
|
|
|
vo.setIsHandled(roadBehaviorAnalysis.getIsHandled()); |
|
|
|
return vo; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
return PageVo.of(collect,pageResult.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
public void videoDownload(VideoDownloadReq req, HttpServletResponse response) { |
|
|
|