Эх сурвалжийг харах

3.2.0-轨迹图一键下载错误提示修改

xiaof 2 жил өмнө
parent
commit
d378799b71

+ 5 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -1728,7 +1728,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     }
                 }
                 tSyncExamStudentScoreService.saveOrUpdateBatch(updateTSyncExamStudentScoreList);
-                if (Objects.nonNull(sourceFiles) && sourceFiles.size() > 0) {
+                if (!sourceFiles.isEmpty()) {
                     Zip4jUtil.zipEncryptFile(zipFile.getPath(), sourceFiles, SystemConstant.ZIP_ENCRYPT_PWD);
                     boolean oss = (boolean) map.get(SystemConstant.OSS);
                     JSONObject jsonObject = new JSONObject();
@@ -1743,7 +1743,11 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     jsonObject.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.FILE);
                     TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
                     tbTask.setResultFilePath(jsonObject.toJSONString());
+                } else {
+                    throw ExceptionResultEnum.ERROR.exception("阅卷方式未使用轨迹阅卷,无轨迹图");
                 }
+            } else {
+                throw ExceptionResultEnum.ERROR.exception("没有可下载数据");
             }
             map.computeIfAbsent("count", v -> tSyncExamStudentScoreResultList.size());
             if (Objects.nonNull(errorTSyncExamStudentScoreList) && errorTSyncExamStudentScoreList.size() > 0) {