|
@@ -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]
|