|
@@ -287,9 +287,9 @@ public class GeoHazardMonitorTokenController {
|
|
|
return SM4Utils.encryptData_ECB(s1, "4370780c9a8c43e5");
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/test")
|
|
|
- public void test() {
|
|
|
- String alarmUrl = alarmHistoryPlay("34020000001320507005", "34020000001320507005",new Date());
|
|
|
+ @GetMapping("/test/{code}")
|
|
|
+ public void test(@PathVariable String code) {
|
|
|
+ String alarmUrl = alarmHistoryPlay(code, code,new Date());
|
|
|
log.info(alarmUrl);
|
|
|
}
|
|
|
|
|
@@ -380,13 +380,13 @@ public class GeoHazardMonitorTokenController {
|
|
|
if ("200".equals(result)) {
|
|
|
String path = apiSummary(cameraCode + "/" + channel+"/"+seconds+"-"+second);
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotEmpty(path)){
|
|
|
- String codes = HttpUtils.sendGet(startRecording(cameraCode, "playback"));
|
|
|
+ String codes = HttpUtils.sendGet(startRecording(cameraCode + "/" + channel+"/"+seconds+"-"+second));
|
|
|
log.info("codes------>" + codes);
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
// 使用SimpleDateFormat将Date对象格式化为指定样式的字符串
|
|
|
String formattedDate = sdf.format(alarmDate);
|
|
|
log.info("-----formattedDate-----------" + formattedDate);
|
|
|
- String records = getQueryRecords(alarmDate + "/playback", formattedDate,"flv");
|
|
|
+ String records = getQueryRecords(cameraCode + "/" + channel+"/"+seconds+"-"+second, formattedDate,"flv");
|
|
|
log.info("-----records-----------" + records);
|
|
|
return records;
|
|
|
}
|
|
@@ -443,12 +443,11 @@ public class GeoHazardMonitorTokenController {
|
|
|
* 开启录制功能
|
|
|
*
|
|
|
* @param cameraCode 相机编码
|
|
|
- * @param channel 相机通道
|
|
|
* @return
|
|
|
*/
|
|
|
- public String startRecording(String cameraCode, String channel) {
|
|
|
- log.info("-----startRecording------" + bakUrl + "/recordpro/api/start?streamPath=" + cameraCode + "/" + channel + "&type=mp4");
|
|
|
- return bakUrl + "/recordpro/api/start?streamPath=" + cameraCode + "/" + channel + "&type=mp4";
|
|
|
+ public String startRecording(String cameraCode) {
|
|
|
+ log.info("-----startRecording------" + bakUrl + "/recordpro/api/start?streamPath=" + cameraCode + "&type=mp4");
|
|
|
+ return bakUrl + "/recordpro/api/start?streamPath=" + cameraCode +"&type=mp4";
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -461,7 +460,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
log.info("-----getQueryRecords-------date----" + date);
|
|
|
log.info("-----getQueryRecords-------type----" + type);
|
|
|
try {
|
|
|
- TimeUnit.SECONDS.sleep(60 * 10);
|
|
|
+ TimeUnit.SECONDS.sleep(90 * 10);
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -489,7 +488,6 @@ public class GeoHazardMonitorTokenController {
|
|
|
log.info("size------------------>" + size);
|
|
|
log.info("path------------------>" + path);
|
|
|
log.info("created------------------>" + created);
|
|
|
- //判断主码流是否订阅者是2
|
|
|
if (Integer.valueOf(size) > 1000) {
|
|
|
list.add(created + "=" + path);
|
|
|
}
|
|
@@ -504,7 +502,7 @@ public class GeoHazardMonitorTokenController {
|
|
|
|
|
|
public String records(List<String> objects) {
|
|
|
|
|
|
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSXXX");
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
|
OffsetDateTime maxTime = null;
|
|
|
|
|
|
for (String timeString : objects) {
|