|
@@ -34,8 +34,6 @@ import java.util.stream.Collectors;
|
|
|
@Component
|
|
|
public class ModuleDetailFacade extends ModuleDetailServiceImpl {
|
|
|
|
|
|
- @Autowired
|
|
|
- private ModuleInfoFacade moduleInfoFacade;
|
|
|
@Autowired
|
|
|
@Qualifier("moduleDetailServiceImpl")
|
|
|
private ModuleDetailService moduleDetailService;
|
|
@@ -90,17 +88,23 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
|
|
|
textList.add(addModuleDetailVO.getText());
|
|
|
}
|
|
|
}
|
|
|
- QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("tag_type", TagTypeEnum.T8.getKey())
|
|
|
- .eq("type", addModuleInfoVO.getTextType())
|
|
|
- .in("name", textList);
|
|
|
- List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+
|
|
|
//将标签id放入map
|
|
|
Map<String, Long> questionIdMap = new HashMap<>();
|
|
|
- for (AddModuleDetailVO addModuleDetailVO : addModuleInfoVO.getModelDetils()) {
|
|
|
- if (StringUtil.isNotEmpty(addModuleDetailVO.getText())) {
|
|
|
- questionIdMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getTagName, questionInfo -> questionInfo.getId()));
|
|
|
+ if (ListUtil.isNotEmpty(textList)){
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("tag_type", TagTypeEnum.T8.getKey())
|
|
|
+ .eq("type", addModuleInfoVO.getTextType())
|
|
|
+ .in("name", textList);
|
|
|
+ List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+
|
|
|
+ for (AddModuleDetailVO addModuleDetailVO : addModuleInfoVO.getModelDetils()) {
|
|
|
+ if (StringUtil.isNotEmpty(addModuleDetailVO.getText())) {
|
|
|
+ questionIdMap = questionInfoList.stream()
|
|
|
+ .collect(Collectors.toMap(QuestionInfo::getTagName,
|
|
|
+ questionInfo -> questionInfo.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
QuestionInfo addquestionInfo = null;
|
|
@@ -132,7 +136,7 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
|
|
|
questionInfoService.saveBatch(addQuestionInfoList);
|
|
|
//查询自定义标签的id
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper1 = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ questionInfoQueryWrapper1.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("type", addModuleInfoVO.getTextType())
|
|
|
.eq("tag_type", TagTypeEnum.T8.getKey());
|
|
|
List<QuestionInfo> questionInfoList1 = questionFacade.list(questionInfoQueryWrapper1);
|