|
@@ -19,7 +19,9 @@ 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;
|
|
|
import com.diagbot.vo.IntroduceMapVO;
|
|
|
import com.diagbot.vo.IntroducePageVO;
|
|
@@ -185,10 +187,11 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
/**
|
|
|
* 批量删除提示信息 逻辑删除
|
|
|
*
|
|
|
- * @param ids
|
|
|
+ * @param idVOList
|
|
|
* @return
|
|
|
*/
|
|
|
- public Boolean deleteRecords(Long[] ids) {
|
|
|
+ public Boolean deleteRecords(List<IdVO> idVOList) {
|
|
|
+ List<Long> ids = idVOList.stream().map(idVO -> idVO.getId()).collect(Collectors.toList());
|
|
|
//删除已有映射关系
|
|
|
UpdateWrapper<IntroduceMap> introduceMapUpdateWrapper = new UpdateWrapper<>();
|
|
|
introduceMapUpdateWrapper.in("introduce_id", ids).
|
|
@@ -273,26 +276,28 @@ 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<>();
|
|
|
+ /*QueryWrapper<QuestionInfo> unRelatedQuestionWrapper = new QueryWrapper<>();
|
|
|
unRelatedQuestionWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("sub_type", 0)
|
|
|
.notIn("id", questionIds);
|
|
@@ -300,7 +305,13 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
|
|
|
List<QuestionShortDTO> unRelatedQuestionDTOList
|
|
|
= BeanUtil.listCopyTo(unRelatedQuestionList, QuestionShortDTO.class);
|
|
|
- introducePageDTO.setUnRelatedQuestionList(unRelatedQuestionDTOList);
|
|
|
+ introducePageDTO.setUnRelatedQuestionList(unRelatedQuestionDTOList);*/
|
|
|
+
|
|
|
+ //提示信息明细
|
|
|
+ QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper=new QueryWrapper<>();
|
|
|
+ introduceDetailQueryWrapper.eq("is_deleted",IsDeleteEnum.N).eq("introduce_id",id).orderByAsc("order_no");
|
|
|
+ List<IntroduceDetail> introduceDetailList=introduceDetailFacade.list(introduceDetailQueryWrapper);
|
|
|
+ introducePageDTO.setDetails(introduceDetailList);
|
|
|
|
|
|
return introducePageDTO;
|
|
|
}
|