|
@@ -19,6 +19,7 @@ import com.diagbot.service.IntroduceMapService;
|
|
|
import com.diagbot.service.impl.IntroduceInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.IdVO;
|
|
|
import com.diagbot.vo.IntroduceDetailVO;
|
|
@@ -275,23 +276,25 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
List<IntroduceMap> introduceMapList = introduceMapFacade.list(introduceMapQueryWrapper);
|
|
|
|
|
|
List<Long> questionIds = introduceMapList.stream().map(introduceMap -> introduceMap.getQuestionId()).collect(Collectors.toList());
|
|
|
- QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- questionInfoQueryWrapper.in("id", questionIds).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
+ if(ListUtil.isNotEmpty(questionIds)) {
|
|
|
+ QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ questionInfoQueryWrapper.in("id", questionIds).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
|
|
|
- List<QuestionShortDTO> questionShortDTOList = Lists.newLinkedList();
|
|
|
- String tagName = "";
|
|
|
- for (QuestionInfo questionInfo : questionInfoList) {
|
|
|
- QuestionShortDTO questionShortDTO = new QuestionShortDTO();
|
|
|
- BeanUtil.copyProperties(questionInfo, questionShortDTO);
|
|
|
- questionShortDTOList.add(questionShortDTO);
|
|
|
- tagName += questionInfo.getTagName() + ",";
|
|
|
- }
|
|
|
- if (tagName.endsWith(",")) {
|
|
|
- tagName = tagName.substring(0, tagName.length() - 1);
|
|
|
+ List<QuestionShortDTO> questionShortDTOList = Lists.newLinkedList();
|
|
|
+ String tagName = "";
|
|
|
+ for (QuestionInfo questionInfo : questionInfoList) {
|
|
|
+ QuestionShortDTO questionShortDTO = new QuestionShortDTO();
|
|
|
+ BeanUtil.copyProperties(questionInfo, questionShortDTO);
|
|
|
+ questionShortDTOList.add(questionShortDTO);
|
|
|
+ tagName += questionInfo.getTagName() + ",";
|
|
|
+ }
|
|
|
+ if (tagName.endsWith(",")) {
|
|
|
+ tagName = tagName.substring(0, tagName.length() - 1);
|
|
|
+ }
|
|
|
+ introducePageDTO.setTagName(tagName);
|
|
|
+ introducePageDTO.setQuestionList(questionShortDTOList);
|
|
|
}
|
|
|
- introducePageDTO.setTagName(tagName);
|
|
|
- introducePageDTO.setQuestionList(questionShortDTOList);
|
|
|
|
|
|
//未关联的标签
|
|
|
/*QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
|