|
@@ -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) {
|