diff --git a/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java b/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java index ce6395c2..cb195ecb 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/ICloudRecordService.java @@ -32,7 +32,8 @@ public interface ICloudRecordService { /** * 添加合并任务 */ - String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost); + String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, + String endTime, String callId, String remoteHost, boolean filterMediaServer); /** 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 bb36e644..8e062f6a 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 @@ -109,7 +109,8 @@ public class CloudRecordServiceImpl implements ICloudRecordService { } @Override - public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, String callId, String remoteHost) { + public String addTask(String app, String stream, MediaServerItem mediaServerItem, String startTime, String endTime, + String callId, String remoteHost, boolean filterMediaServer) { // 参数校验 assert app != null; assert stream != null; @@ -125,8 +126,11 @@ public class CloudRecordServiceImpl implements ICloudRecordService { endTimeStamp = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime); } + List mediaServers = new ArrayList<>(); + mediaServers.add(mediaServerItem); // 检索相关的录像文件 - List filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp, endTimeStamp, callId, null); + List filePathList = cloudRecordServiceMapper.queryRecordFilePathList(app, stream, startTimeStamp, + endTimeStamp, callId, filterMediaServer ? mediaServers : null); if (filePathList == null || filePathList.isEmpty()) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "未检索到视频文件"); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java index d2c5414d..de9def58 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/cloudRecord/CloudRecordController.java @@ -177,7 +177,7 @@ public class CloudRecordController { remoteHost = request.getScheme() + "://" + request.getLocalAddr() + ":" + mediaServerItem.getRecordAssistPort(); } } - return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost); + return cloudRecordService.addTask(app, stream, mediaServerItem, startTime, endTime, callId, remoteHost, mediaServerId != null); } @ResponseBody