deason преди 3 години
родител
ревизия
0bfdddf140

+ 1 - 0
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/client/ExamProcessController.java

@@ -208,6 +208,7 @@ public class ExamProcessController extends ControllerSupport {
             String realMD5 = DigestUtils.md5Hex(file.getInputStream());
             String tempMD5 = fileMd5Array[i];
             if (!realMD5.equals(tempMD5)) {
+                log.warn("realMD5 = {}, tempMD5 = {}", realMD5, tempMD5);
                 throw new StatusException("400403", "文件MD5验证失败");
             }
 

+ 1 - 2
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/OfflineExamServiceImpl.java

@@ -271,7 +271,6 @@ public class OfflineExamServiceImpl implements OfflineExamService {
     }
 
     @Override
-    @Transactional
     public void submitPaper(Long examRecordDataId, FileInfo fileInfo, Long userId) {
         if (fileInfo.getFileSize() > Constants.ANSWER_FILE_MAX_SIZE * Constants.M_SIZE) {
             throw new StatusException("400402", "文件大小不能超过" + Constants.ANSWER_FILE_MAX_SIZE + "M");
@@ -341,7 +340,7 @@ public class OfflineExamServiceImpl implements OfflineExamService {
         // 上传文件
         for (FileInfo fileInfo : fileInfoList) {
             if (!matchFileTypes(new String[]{uploadFileType}, fileInfo.getFileSuffix())) {
-                throw new StatusException("400401", "文件格式不正确");
+                throw new StatusException("400401", "请上传【" + uploadFileType + "】类型的文件");
             }
 
             String fileNewName = createOfflineFileName(bean) + fileInfo.getFileSuffix();