deason 2 жил өмнө
parent
commit
ac39de57d0

+ 15 - 0
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/impl/ExamCaptureQueueServiceImpl.java

@@ -106,8 +106,23 @@ public class ExamCaptureQueueServiceImpl implements ExamCaptureQueueService {
 
             // 将抓拍照图片转成Base64格式
             String capturePhotoUrl = ossClient.valueOfOssFilePath(FileStorageUtil.realPath(queue.getFileUrl()));
+            if (StringUtils.isBlank(capturePhotoUrl)) {
+                // 删除错误无效数据
+                log.warn("人脸抓拍图片地址错误!examRecordDataId:{} queueId:{} imgUrl:{}",
+                        queue.getExamRecordDataId(), queue.getId(), queue.getFileUrl());
+                examCaptureQueueRepo.deleteById(queue.getId());
+                continue;
+            }
+
             byte[] capturePhotoBytes = ossClient.download(capturePhotoUrl);
             ImageParm capturePhoto = new ImageBase64Parm(Base64.encodeBase64String(capturePhotoBytes));
+            if (StringUtils.isBlank(capturePhoto.value())) {
+                // 删除错误无效数据
+                log.warn("人脸抓拍图片为空白!examRecordDataId:{} queueId:{} imgUrl:{}",
+                        queue.getExamRecordDataId(), queue.getId(), queue.getFileUrl());
+                examCaptureQueueRepo.deleteById(queue.getId());
+                continue;
+            }
 
             String extMsg = "";
             boolean errFace = false;