Quellcode durchsuchen

just format code styles.

deason vor 6 Jahren
Ursprung
Commit
77fd4f08da

+ 12 - 53
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/PaperController.java

@@ -22,11 +22,8 @@ import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailUnitExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
 import cn.com.qmth.examcloud.core.questions.service.export.ExportPaperAbstractService;
-
 import com.google.gson.Gson;
-
 import io.swagger.annotations.ApiOperation;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -68,12 +65,13 @@ public class PaperController extends ControllerSupport {
 
     @Autowired
     QuesService quesService;
-    
+
     @Autowired
     ExportServiceManageRepo exportServiceManageRepo;
 
     /**
      * 根据Id获取试卷
+     *
      * @param paperId
      * @return
      */
@@ -590,13 +588,13 @@ public class PaperController extends ControllerSupport {
     @ApiOperation(value = "预览试卷页面")
     @GetMapping(value = "/paper/pdf/{paperId}")
     public String viewPaper(Model model, @PathVariable String paperId) {
-    	Paper paperBase = paperRepo.findOne(paperId);
-    	ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
-    	if (esm == null) {
+        Paper paperBase = paperRepo.findOne(paperId);
+        ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
+        if (esm == null) {
             esm = exportServiceManageRepo.findByOrgName("山东大学");
         }
-    	ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
-        PaperExp paper  = exportPaperAbstractService.previewPDF(paperId);
+        ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
+        PaperExp paper = exportPaperAbstractService.previewPDF(paperId);
         model.addAttribute("htmlList", JsonUtil.toJson(ParsePaper.convertPaperHtml(paper)));
         model.addAttribute("courseName", paper.getCourseName());
         model.addAttribute("courseNo", paper.getCourseNo());
@@ -608,13 +606,13 @@ public class PaperController extends ControllerSupport {
     @ApiOperation(value = "预览试卷答案页面")
     @GetMapping(value = "/paper/answer/pdf/{paperId}")
     public String viewPaperAnswer(Model model, @PathVariable String paperId) {
-    	Paper paperBase = paperRepo.findOne(paperId);
-    	ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
-    	if (esm == null) {
+        Paper paperBase = paperRepo.findOne(paperId);
+        ExportServiceManage esm = exportServiceManageRepo.findByOrgId(paperBase.getOrgId());
+        if (esm == null) {
             esm = exportServiceManageRepo.findByOrgName("山东大学");
         }
-    	ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
-        PaperExp paper  = exportPaperAbstractService.previewPDF(paperId);
+        ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
+        PaperExp paper = exportPaperAbstractService.previewPDF(paperId);
         model.addAttribute("htmlList", JsonUtil.toJson(ParsePaper.convertAnswerHtml(paper)));
         model.addAttribute("courseNo", paper.getCourseNo());
         model.addAttribute("courseName", paper.getCourseName());
@@ -623,45 +621,6 @@ public class PaperController extends ControllerSupport {
         return html;
     }
 
-    /**
-     * 根据id获取试卷的html片段集合
-     */
-    /*@ApiOperation(value = "根据id获取试卷的html片段集合", notes = "根据id获取试卷的html片段集合")
-    @GetMapping(value = "/paper/pdf/{paperId}")
-    public ModelAndView getPaperPDFById(@PathVariable String paperId) {
-        ModelAndView view = new ModelAndView("paper_bak");
-        Map<String, Object> mag;
-        try {
-            mag = paperService.getPaperPDF(paperId, "paper");
-            view.addObject("htmlList", JsonUtil.toJson(mag.get("htmlList")));
-            view.addObject("courseName", mag.get("courseName"));
-            view.addObject("courseNo", mag.get("courseNo"));
-            return view;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return view;
-        }
-    }*/
-
-    /**
-     * 根据id获取试卷答案的html片段集合
-     */
-    /*@ApiOperation(value = "根据id获取试卷的html片段集合", notes = "根据id获取试卷的html片段集合")
-    @GetMapping(value = "/paper/answer/pdf/{paperId}")
-    public ModelAndView getPaperAnswerPDFById(@PathVariable String paperId) {
-        ModelAndView view = new ModelAndView("paperAnswer_bak");
-        Map<String, Object> mag;
-        try {
-            mag = paperService.getPaperPDF(paperId, "answer");
-            view.addObject("htmlList", JsonUtil.toJson(mag.get("htmlList")));
-            view.addObject("courseName", mag.get("courseName"));
-            view.addObject("courseNo", mag.get("courseNo"));
-            return view;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return view;
-        }
-    }*/
     @ApiOperation(value = "传送到印刷平台", notes = "传送到印刷平台")
     @GetMapping(value = "/sendPrint/{paperId}/{examId}/{orgId}")
     public ResponseEntity<Object> sendPrint(@PathVariable String paperId,