浏览代码

考试报告生成,校本题库列表完善

tags/正式3.10.2
雍文秀 1年前
父节点
当前提交
f0db9c0206

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java 查看文件

@@ -110,6 +110,7 @@ public class EReportGenerateService {
110 110
         List<Map> classes = eClassMapper.listByExamId(examid);
111 111
         Integer exammode = eReportGenerateMapper.getExamModeById(examid);
112 112
         List<Map> subjects = eReportGenerateMapper.listSubject(examid, exammode);
113
+        if(N_Utils.isListEmpty(subjects)) throw new Exception("没有结束的科目");
113 114
         List<ERPaperVo> papers = new ArrayList<>();
114 115
         Map<String, String> subjectMap = new HashMap<>();
115 116
         Map<String, ERPaperVo> paperMap = new HashMap<>();

+ 19
- 6
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionService.java 查看文件

@@ -13,6 +13,7 @@ import com.xhkjedu.sstudy.vo.question.QuestionCollectVo;
13 13
 import com.xhkjedu.sstudy.vo.question.QuestionVo;
14 14
 import com.xhkjedu.sstudy.vo.subjectbook.DirectorVo;
15 15
 import com.xhkjedu.utils.N_Utils;
16
+import org.springframework.scheduling.annotation.Async;
16 17
 import org.springframework.stereotype.Service;
17 18
 import org.springframework.transaction.annotation.Transactional;
18 19
 import org.springframework.util.CollectionUtils;
@@ -272,17 +273,29 @@ public class QuestionService {
272 273
         if (N_Utils.isNotEmpty(questionids)) {
273 274
             List<Map<String, String>> sonList = questionMapper.listSonQuestionForSelect(questionids);
274 275
             for (Map<String, Object> map : list) {
275
-                if (map.get("qlevel").toString().equals("2")) {
276
-                    Object questionid = map.get("questionid");
277
-                    List<Map<String, String>> sonqlist = sonList.stream().filter(
278
-                            s -> s.get("questionpid").equals(questionid)).collect(Collectors.toList());
279
-                    map.put("sonqlist", sonqlist);
280
-                }
276
+                setSonQList(sonList, map);
281 277
             }
282 278
         }
283 279
         return list;
284 280
     }
285 281
 
282
+    /**
283
+     * @Description 处理试题子题
284
+     * @Date 2023/8/16 8:38
285
+     * @Author YWX
286
+     * @Param [sonList, map]
287
+     * @Return void
288
+     **/
289
+    @Async("asyncPoolTaskExecutor")
290
+    public void setSonQList(List<Map<String, String>> sonList, Map<String, Object> map) {
291
+        if (map.get("qlevel").toString().equals("2")) {
292
+            Object questionid = map.get("questionid");
293
+            List<Map<String, String>> sonqlist = sonList.stream().filter(
294
+                    s -> s.get("questionpid").equals(questionid)).collect(Collectors.toList());
295
+            map.put("sonqlist", sonqlist);
296
+        }
297
+    }
298
+
286 299
     /**
287 300
      * 试题收藏
288 301
      * @Param [collect]

正在加载...
取消
保存