From fc77b3f819b3143387b90a4d631725e7c6513ecd Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 01 十二月 2023 15:49:18 +0800
Subject: [PATCH] 支持重新接入zlm的时候检查拉流代理数据是否异常,异常数据自动移除
---
src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java | 31 ++++++++++++-------------------
1 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java
index 1a8adb1..d9d6fe3 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/CloudRecordServiceImpl.java
@@ -124,6 +124,9 @@
remoteHost = "http://" + mediaServerItem.getStreamIp() + ":" + mediaServerItem.getRecordAssistPort();
}
}
+ if (mediaServerItem.getRecordAssistPort() == 0) {
+ throw new ControllerException(ErrorCode.ERROR100.getCode(), "涓洪厤缃瓵ssist鏈嶅姟");
+ }
Long startTimeStamp = null;
Long endTimeStamp = null;
if (startTime != null) {
@@ -148,7 +151,7 @@
}
@Override
- public JSONArray queryTask(String taskId, String mediaServerId, Boolean isEnd) {
+ public JSONArray queryTask(String app, String stream, String callId, String taskId, String mediaServerId, Boolean isEnd) {
MediaServerItem mediaServerItem = null;
if (mediaServerId == null) {
mediaServerItem = mediaServerService.getDefaultMediaServer();
@@ -158,7 +161,7 @@
if (mediaServerItem == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "鏈壘鍒板彲鐢ㄧ殑娴佸獟浣�");
}
- JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, taskId, isEnd);
+ JSONObject result = assistRESTfulUtils.queryTaskList(mediaServerItem, app, stream, callId, taskId, isEnd);
if (result.getInteger("code") != 0) {
throw new ControllerException(result.getInteger("code"), result.getString("msg"));
}
@@ -166,7 +169,7 @@
}
@Override
- public void changeCollect(String type, boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId, String collectType) {
+ public int changeCollect(boolean result, String app, String stream, String mediaServerId, String startTime, String endTime, String callId) {
// 寮�濮嬫椂闂村拰缁撴潫鏃堕棿鍦ㄦ暟鎹簱涓兘鏄互绉掍负鍗曚綅鐨�
Long startTimeStamp = null;
Long endTimeStamp = null;
@@ -203,34 +206,24 @@
throw new ControllerException(ErrorCode.ERROR100.getCode(), "鏈壘鍒板緟鏀惰棌鐨勮棰�");
}
int limitCount = 50;
+ int resultCount = 0;
if (all.size() > limitCount) {
for (int i = 0; i < all.size(); i += limitCount) {
int toIndex = i + limitCount;
if (i + limitCount > all.size()) {
toIndex = all.size();
}
- if ("collect".equals(collectType)) {
- cloudRecordServiceMapper.updateCollectList(result, all.subList(i, toIndex));
- }else if ("reserve".equals(collectType)) {
- cloudRecordServiceMapper.updateReserveList(result, all.subList(i, toIndex));
- }
+ resultCount += cloudRecordServiceMapper.updateCollectList(result, all.subList(i, toIndex));
}
}else {
- if ("collect".equals(collectType)) {
- cloudRecordServiceMapper.updateCollectList(result, all);
- }else if ("reserve".equals(collectType)) {
- cloudRecordServiceMapper.updateReserveList(result, all);
- }
+ resultCount = cloudRecordServiceMapper.updateCollectList(result, all);
}
+ return resultCount;
}
@Override
- public void changeCollectById(Integer recordId, String collectType, boolean result) {
- if ("collect".equals(collectType)) {
- cloudRecordServiceMapper.changeCollectById(result, recordId);
- }else if ("reserve".equals(collectType)) {
- cloudRecordServiceMapper.changeReserveById(result, recordId);
- }
+ public int changeCollectById(Integer recordId, boolean result) {
+ return cloudRecordServiceMapper.changeCollectById(result, recordId);
}
}
--
Gitblit v1.8.0