|
@@ -286,17 +286,27 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
List<Long> questionIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getQuestionId()).collect(Collectors.toList());
|
|
|
List<Long> moduleIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getRelationModule()).collect(Collectors.toList());
|
|
|
//获取标签信息
|
|
|
- QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("id", questionIdList);
|
|
|
- List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
- Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
|
|
|
+ Map<Long, QuestionInfo> questionInfoMap = new HashMap<>();
|
|
|
+ if (ListUtil.isNotEmpty(questionIdList)) {
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", questionIdList);
|
|
|
+ List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+ questionInfoMap = questionInfoList.stream()
|
|
|
+ .collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
|
|
|
+ }
|
|
|
+
|
|
|
//获取模板信息
|
|
|
- QueryWrapper<ModuleInfo> getRelationModuleWapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("id", moduleIdList);
|
|
|
- List<ModuleInfo> moduleInfoList = this.list(getRelationModuleWapper);
|
|
|
- Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream().collect(Collectors.toMap(ModuleInfo::getId, m -> moduleInfo));
|
|
|
+ Map<Long, ModuleInfo> moduleInfoMap = new HashMap<>();
|
|
|
+ if (ListUtil.isNotEmpty(moduleIdList)) {
|
|
|
+ QueryWrapper<ModuleInfo> getRelationModuleWapper = new QueryWrapper<>();
|
|
|
+ getRelationModuleWapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("id", moduleIdList);
|
|
|
+ List<ModuleInfo> moduleInfoList = this.list(getRelationModuleWapper);
|
|
|
+ moduleInfoMap = moduleInfoList.stream()
|
|
|
+ .collect(Collectors.toMap(ModuleInfo::getId, m -> moduleInfo));
|
|
|
+ }
|
|
|
+
|
|
|
//循环给出参赋值
|
|
|
for (ModuleDetail moduleDetail : moduleDetailList) {
|
|
|
getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
|