|
@ -1082,16 +1082,16 @@ public class DcWarningServiceImpl implements IDcWarningService { |
|
|
public String getRadarIncidentVideo(String id) throws Exception { |
|
|
public String getRadarIncidentVideo(String id) throws Exception { |
|
|
String msg = ""; |
|
|
String msg = ""; |
|
|
HashMap<String, Object> stringObjectHashMap = dcWarningMapper.selectDcWarningById(id); |
|
|
HashMap<String, Object> stringObjectHashMap = dcWarningMapper.selectDcWarningById(id); |
|
|
// 给定的时间
|
|
|
// 时间
|
|
|
String givenTime = (String) stringObjectHashMap.get("warningTime"); |
|
|
String givenTime = (String) stringObjectHashMap.get("warningTime"); |
|
|
|
|
|
|
|
|
// 定义日期时间格式
|
|
|
// 定义日期时间格式
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
// 解析给定的时间
|
|
|
// 解析时间
|
|
|
LocalDateTime currentTime = LocalDateTime.parse(givenTime, formatter); |
|
|
LocalDateTime currentTime = LocalDateTime.parse(givenTime, formatter); |
|
|
// 计算 30 秒后的时间
|
|
|
// 计算 30 秒前的时间
|
|
|
LocalDateTime timeAfter30Seconds = currentTime.plus(Duration.ofSeconds(30)); |
|
|
LocalDateTime timeAfter30Seconds = currentTime.plus(Duration.ofSeconds(-30)); |
|
|
|
|
|
|
|
|
// 格式化时间
|
|
|
// 格式化时间
|
|
|
String formattedTime = timeAfter30Seconds.format(formatter); |
|
|
String formattedTime = timeAfter30Seconds.format(formatter); |
|
@ -1109,7 +1109,7 @@ public class DcWarningServiceImpl implements IDcWarningService { |
|
|
JsonNode code = jsonNodelist.get(0).get("cameraIndexCode"); |
|
|
JsonNode code = jsonNodelist.get(0).get("cameraIndexCode"); |
|
|
// 使用 textValue() 方法获取纯字符串
|
|
|
// 使用 textValue() 方法获取纯字符串
|
|
|
String codestring = code.textValue(); |
|
|
String codestring = code.textValue(); |
|
|
com.alibaba.fastjson.JSONObject jsonObject = videoController.downloadCameraVideo(codestring, formattedTime, 1); |
|
|
com.alibaba.fastjson.JSONObject jsonObject = videoController.downloadCameraVideo(codestring, formattedTime, 2); |
|
|
|
|
|
|
|
|
if (jsonObject.get("code").toString().equals("500")) { |
|
|
if (jsonObject.get("code").toString().equals("500")) { |
|
|
return null; |
|
|
return null; |
|
@ -1136,12 +1136,12 @@ public class DcWarningServiceImpl implements IDcWarningService { |
|
|
JsonNode paramsNode = otherConfigurationNode.get("params"); |
|
|
JsonNode paramsNode = otherConfigurationNode.get("params"); |
|
|
JsonNode eventsNode = paramsNode.get("events"); |
|
|
JsonNode eventsNode = paramsNode.get("events"); |
|
|
|
|
|
|
|
|
// 假设只有一个事件,我们只处理第一个事件
|
|
|
// 假设只有一个事件,只处理第一个事件
|
|
|
JsonNode eventDataNode = eventsNode.get(0); |
|
|
JsonNode eventDataNode = eventsNode.get(0); |
|
|
JsonNode dataNode2 = eventDataNode.get("data"); |
|
|
JsonNode dataNode2 = eventDataNode.get("data"); |
|
|
JsonNode vehicleRcogResultNode = dataNode2.get("vehicleRcogResult"); |
|
|
JsonNode vehicleRcogResultNode = dataNode2.get("vehicleRcogResult"); |
|
|
|
|
|
|
|
|
// 假设只有一个 vehicleRcogResult 对象
|
|
|
// vehicleRcogResult 对象
|
|
|
JsonNode targetAttrsNode = vehicleRcogResultNode.get(0).get("targetAttrs"); |
|
|
JsonNode targetAttrsNode = vehicleRcogResultNode.get(0).get("targetAttrs"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|