浏览代码

错题展示

caozixuan 4 年之前
父节点
当前提交
5fddbdbdba

+ 4 - 5
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/ReportCommonServiceImpl.java

@@ -436,13 +436,12 @@ public class ReportCommonServiceImpl implements ReportCommonService {
         Set<String> paperTypeSet = questionDatasource.stream().map(TBPaperStructResult::getPaperType).collect(Collectors.toSet());
         List<QuestionResult> questionList = new ArrayList<>();
         for (String paperType : paperTypeSet) {
-            List<TBPaperStructResult> cellList = questionDatasource.stream()
-                    .filter(e -> paperType.equals(e.getPaperType())).collect(Collectors.toList());
+            List<TBPaperStructResult> errorCellList = questionDatasource.stream()
+                    .filter(e -> paperType.equals(e.getPaperType()) && PaperStructJudgeEnum.NOT_QUITE_RIGHT.equals(e.getPaperStructJudge())).collect(Collectors.toList());
 
-            for (TBPaperStructResult cell : cellList) {
+            for (TBPaperStructResult cell : errorCellList) {
                 cell.setPaperType(null);
             }
-            List<TBPaperStructResult> errorCellList = cellList.stream().filter(e -> PaperStructJudgeEnum.NOT_QUITE_RIGHT.equals(e.getPaperStructJudge())).collect(Collectors.toList());
             Set<String> knowledgeDimensionSet = new HashSet<>(), abilityDimensionSet = new HashSet<>();
 
             // 获取考察点集合
@@ -499,7 +498,7 @@ public class ReportCommonServiceImpl implements ReportCommonService {
                 }
                 abilityDimensionList.add(new DimensionInfoResult(dimensionCode, dimensionName));
             }
-            questionList.add(new QuestionResult(paperType, cellList, dimensionList, abilityDimensionList));
+            questionList.add(new QuestionResult(paperType, errorCellList, dimensionList, abilityDimensionList));
         }
         return new QuestionListResult(questionList);
     }