wangliang 8 місяців тому
батько
коміт
e6583bb2f7

+ 5 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TCPaperStructController.java

@@ -203,17 +203,15 @@ public class TCPaperStructController {
                                              @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
                                              @ApiParam(value = "培养方案id", required = true) @RequestParam Long cultureProgramId) {
         ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(cultureProgramId, courseId);
-
         List<PaperStructDimensionResult> paperStructDimensionResultList = null;
         TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
         if (Objects.isNull(tcPaperStruct) || (Objects.isNull(tcPaperStruct.getPaperStruct()) && Objects.isNull(tcPaperStruct.getPaperStructDimension()))) {
             List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumber(examId, paperNumber);
-            if (CollectionUtils.isEmpty(markQuestionList)) {
-                throw ExceptionResultEnum.ERROR.exception("未找到试卷结构");
-            }
-            paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
-            for (MarkQuestion markQuestion : markQuestionList) {
-                paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
+            if (!CollectionUtils.isEmpty(markQuestionList)) {
+                paperStructDimensionResultList = new ArrayList<>(markQuestionList.size());
+                for (MarkQuestion markQuestion : markQuestionList) {
+                    paperStructDimensionResultList.add(new PaperStructDimensionResult(markQuestion.getMainNumber(), markQuestion.getSubNumber(), examId, markQuestion.getPaperNumber(), new BigDecimal(markQuestion.getTotalScore())));
+                }
             }
         } else {
             ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId(), true);

+ 1 - 4
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCPaperStructServiceImpl.java

@@ -19,7 +19,6 @@ import com.qmth.teachcloud.obe.been.excel.PaperStructDto;
 import com.qmth.teachcloud.obe.been.result.ObeCourseWeightResult;
 import com.qmth.teachcloud.obe.been.result.report.PaperStructDimensionResult;
 import com.qmth.teachcloud.obe.entity.ObeCourseOutline;
-import com.qmth.teachcloud.obe.entity.TCFinalScore;
 import com.qmth.teachcloud.obe.entity.TCPaperStruct;
 import com.qmth.teachcloud.obe.mapper.TCPaperStructMapper;
 import com.qmth.teachcloud.obe.service.*;
@@ -173,10 +172,8 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
                         if (Objects.nonNull(tcPaperStructDb.getPaperStruct()) && !Objects.equals(tcPaperStructDb.getPaperStruct(), tcPaperStruct.getPaperStruct())) {
                             throw ExceptionResultEnum.ERROR.exception("导入的试卷结构不一致,请检查");
                         }
-//                        tcFinalScoreService.remove(cultureProgramId, courseId, paperNumber, examId);
-//                        trBasicInfoService.clearReportData(cultureProgramId, courseId, paperNumber, examId, true);
                     }
-                    if (Objects.nonNull(tcPaperStructDb.getPaperStructDimension())) {
+                    if (Objects.nonNull(tcPaperStructDb) && Objects.nonNull(tcPaperStructDb.getPaperStructDimension())) {
                         tcPaperStruct.updateInfo(tcPaperStructDb.getPaperStructDimension(), sysUser.getId());
                     }
                     tcPaperStructService.remove(cultureProgramId, courseId, paperNumber, examId);