|
@@ -22,9 +22,9 @@ import cn.com.qmth.examcloud.support.cache.bean.OrgPropertyCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
|
import cn.com.qmth.examcloud.support.enums.ExamProperties;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
-import cn.com.qmth.examcloud.support.filestorage.FileStorageUtil;
|
|
|
+import cn.com.qmth.examcloud.support.fss.FssFactory;
|
|
|
+import cn.com.qmth.examcloud.support.fss.FssHelper;
|
|
|
import cn.com.qmth.examcloud.support.helper.ExamCacheTransferHelper;
|
|
|
-import cn.com.qmth.examcloud.web.aliyun.OssClient;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -61,9 +61,6 @@ public class ExamCaptureQueueServiceImpl implements ExamCaptureQueueService {
|
|
|
@Autowired
|
|
|
private ExamRecordDataService examRecordDataService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private OssClient ossClient;
|
|
|
-
|
|
|
@Override
|
|
|
public void handlerExamCaptureQueuesByExamRecordDataId(Long examRecordDataId, List<ExamCaptureQueueEntity> queues, FaceApiParam param) throws Exception {
|
|
|
if (CollectionUtils.isEmpty(queues)) {
|
|
@@ -103,8 +100,8 @@ public class ExamCaptureQueueServiceImpl implements ExamCaptureQueueService {
|
|
|
basePhoto = new ImageBase64Parm(CommonUtils.toBase64(studentCache.getPhotoPath()));
|
|
|
log.warn("old data basePhotoUrl:{}", studentCache.getPhotoPath());
|
|
|
} else {
|
|
|
- String basePhotoUrl = ossClient.valueOfOssFilePath(studentCache.getPhotoPath());
|
|
|
- byte[] basePhotoBytes = ossClient.download(basePhotoUrl);
|
|
|
+ String basePhotoPath = FssHelper.fixFilePath(studentCache.getPhotoPath());
|
|
|
+ byte[] basePhotoBytes = FssFactory.getInstance().readFile(basePhotoPath);
|
|
|
basePhoto = new ImageBase64Parm(Base64.encodeBase64String(basePhotoBytes));
|
|
|
}
|
|
|
|
|
@@ -112,8 +109,8 @@ public class ExamCaptureQueueServiceImpl implements ExamCaptureQueueService {
|
|
|
queue.setFaceCompareStartTime(System.currentTimeMillis());
|
|
|
|
|
|
|
|
|
- String capturePhotoUrl = ossClient.valueOfOssFilePath(FileStorageUtil.realPath(queue.getFileUrl()));
|
|
|
- if (StringUtils.isBlank(capturePhotoUrl)) {
|
|
|
+ String capturePhotoPath = FssHelper.fixFilePath(queue.getFileUrl());
|
|
|
+ if (StringUtils.isBlank(capturePhotoPath)) {
|
|
|
|
|
|
log.warn("人脸抓拍图片地址错误!examRecordDataId:{} queueId:{} imgUrl:{}", queue.getExamRecordDataId(),
|
|
|
queue.getId(), queue.getFileUrl());
|
|
@@ -121,7 +118,7 @@ public class ExamCaptureQueueServiceImpl implements ExamCaptureQueueService {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- byte[] capturePhotoBytes = ossClient.download(capturePhotoUrl);
|
|
|
+ byte[] capturePhotoBytes = FssFactory.getInstance().readFile(capturePhotoPath);
|
|
|
ImageParm capturePhoto = new ImageBase64Parm(Base64.encodeBase64String(capturePhotoBytes));
|
|
|
if (StringUtils.isBlank(capturePhoto.value())) {
|
|
|
|