|
@@ -592,17 +592,24 @@ public class PaperController extends ControllerSupport {
|
|
|
@GetMapping(value = "/paper/pdf/{paperId}")
|
|
|
public String viewPaper(Model model, @PathVariable String paperId) {
|
|
|
Paper paperBase = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperId));
|
|
|
- ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
|
|
|
- if (esm == null) {
|
|
|
- esm = exportServiceManageRepo.findByOrgName("山东大学");
|
|
|
+ if (paperBase == null) {
|
|
|
+ throw new StatusException("500", "试卷信息不存在!");
|
|
|
}
|
|
|
- ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
|
|
|
+
|
|
|
+ ExportServiceManage manager = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
|
|
|
+ if (manager == null) {
|
|
|
+ manager = exportServiceManageRepo.findByOrgName("山东大学");
|
|
|
+ }
|
|
|
+ ExportPaperAbstractService exportPaperAbstractService = SpringContextUtils.getBean(ExportPaperAbstractService.class, manager.getExportServiceName());
|
|
|
+
|
|
|
PaperExp paper = exportPaperAbstractService.previewPDF(paperId);
|
|
|
model.addAttribute("htmlList", JsonUtil.toJson(ParsePaper.convertPaperHtml(paper)));
|
|
|
model.addAttribute("courseName", paper.getCourseName());
|
|
|
model.addAttribute("courseNo", paper.getCourseNo());
|
|
|
model.addAttribute("courseLevel", paper.getCourseLevel());
|
|
|
- String html = esm.getExportServiceName() + "_paper";
|
|
|
+
|
|
|
+ //String html = esm.getExportServiceName() + "_paper";
|
|
|
+ String html = "sddxExportPaperService_paper";
|
|
|
return html;
|
|
|
}
|
|
|
|
|
@@ -611,17 +618,24 @@ public class PaperController extends ControllerSupport {
|
|
|
@GetMapping(value = "/paper/answer/pdf/{paperId}")
|
|
|
public String viewPaperAnswer(Model model, @PathVariable String paperId) {
|
|
|
Paper paperBase = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperId));
|
|
|
- ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
|
|
|
- if (esm == null) {
|
|
|
- esm = exportServiceManageRepo.findByOrgName("山东大学");
|
|
|
+ if (paperBase == null) {
|
|
|
+ throw new StatusException("500", "试卷答案信息不存在!");
|
|
|
}
|
|
|
- ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
|
|
|
+
|
|
|
+ ExportServiceManage manager = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
|
|
|
+ if (manager == null) {
|
|
|
+ manager = exportServiceManageRepo.findByOrgName("山东大学");
|
|
|
+ }
|
|
|
+ ExportPaperAbstractService exportPaperAbstractService = SpringContextUtils.getBean(ExportPaperAbstractService.class, manager.getExportServiceName());
|
|
|
+
|
|
|
PaperExp paper = exportPaperAbstractService.previewPDF(paperId);
|
|
|
model.addAttribute("htmlList", JsonUtil.toJson(ParsePaper.convertAnswerHtml(paper)));
|
|
|
model.addAttribute("courseNo", paper.getCourseNo());
|
|
|
model.addAttribute("courseName", paper.getCourseName());
|
|
|
model.addAttribute("courseLevel", paper.getCourseLevel());
|
|
|
- String html = esm.getExportServiceName() + "_answer";
|
|
|
+
|
|
|
+ //String html = esm.getExportServiceName() + "_answer";
|
|
|
+ String html = "sddxExportPaperService_answer";
|
|
|
return html;
|
|
|
}
|
|
|
|