deason 5 سال پیش
والد
کامیت
47082f3138

+ 11 - 0
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/ExportPaperController.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.core.questions.api;
 
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.questions.dao.ExportServiceManageRepo;
 import cn.com.qmth.examcloud.core.questions.dao.entity.ExportServiceManage;
 import cn.com.qmth.examcloud.core.questions.service.ExportPaperService;
@@ -55,6 +56,11 @@ public class ExportPaperController {
         try {
             String psw = request.getParameter("psw");
             ExportServiceManage esm = exportServiceManageRepo.findByOrgName(orgName);
+
+            if (esm == null) {
+                throw new StatusException("500", String.format("学校【%s】尚未配置导出模板!", orgName));
+            }
+
             exportPaperService.exportPaperFile(id, esm.getExportServiceName(), exportContentList, response, loginName, examType, psw);
         } catch (Exception e) {
             log.error("导出异常:" + e);
@@ -83,6 +89,11 @@ public class ExportPaperController {
         log.info("批量导出");
         List<String> paperList = Stream.of(paperIds.split(",")).collect(Collectors.toList());
         ExportServiceManage esm = exportServiceManageRepo.findByOrgName(orgName);
+
+        if (esm == null) {
+            throw new StatusException("500", String.format("学校【%s】尚未配置导出模板!", orgName));
+        }
+
         try {
             exportPaperService.exportPaperFiles(paperList, esm.getExportServiceName(), exportContentList, response, loginName, examType);
         } catch (Exception e) {

+ 8 - 8
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/temp/DdExcelService.java

@@ -33,14 +33,14 @@ import java.util.*;
 @Service("ddExcelService")
 public class DdExcelService {
     private static final Logger log = LoggerFactory.getLogger(DdExcelService.class);
-    private final String exportExcelPath = "D:/exportExcel.xlsx";
-    private final String xianExcelPath = "D:/xianExcelNew.xlsx";
-    private final String paperExcelPath = "D:/paperExcel.xlsx";
-    private final String paperExcelPathNew = "D:/paperExcelNew.xlsx";
-    private final String quesExcelPath = "D:/quesExcel.xlsx";
-    private final String quesExcelPathNew = "D:/quesExcelNew.xlsx";
-    private final String paperStructExcelPath = "D:/paperStructExcel.xlsx";
-    private final String paperStructExcelPathNew = "D:/paperStructExcelNew.xlsx";
+    private final String exportExcelPath = "D:/home/paper/exportExcel.xlsx";
+    private final String xianExcelPath = "D:/home/paper/xianExcelNew.xlsx";
+    private final String paperExcelPath = "D:/home/paper/paperExcel.xlsx";
+    private final String paperExcelPathNew = "D:/home/paper/paperExcelNew.xlsx";
+    private final String quesExcelPath = "D:/home/paper/quesExcel.xlsx";
+    private final String quesExcelPathNew = "D:/home/paper/quesExcelNew.xlsx";
+    private final String paperStructExcelPath = "D:/home/paper/paperStructExcel.xlsx";
+    private final String paperStructExcelPathNew = "D:/home/paper/paperStructExcelNew.xlsx";
     @Autowired
     private QuesRepo quesRepo;
     @Autowired