|
@@ -7,9 +7,12 @@ import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.RetrievalDTO;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
+import com.diagbot.vo.ExistListByConceptIdsVO;
|
|
|
+import com.diagbot.vo.GetStaticKnowledgeVO;
|
|
|
import com.diagbot.vo.RetrievalVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -67,7 +70,9 @@ public class RetrievalFacade {
|
|
|
retrievalDTO.setConceptId(conceptRetrievalDTO.getSelfId());
|
|
|
retrievalDTO.setName(conceptRetrievalDTO.getSelfName());
|
|
|
if (StringUtil.isNotEmpty(conceptRetrievalDTO.getParentName())) {//parent不为空时说明有子项,返回父级id
|
|
|
- retrievalDTO.setQuestionId(questionInfoMap.get(conceptRetrievalDTO.getParentName()).getId());
|
|
|
+ if(null != questionInfoMap.get(conceptRetrievalDTO.getParentName())){//如果匹配到就添加questionId
|
|
|
+ retrievalDTO.setQuestionId(questionInfoMap.get(conceptRetrievalDTO.getParentName()).getId());
|
|
|
+ }
|
|
|
retrievalDTO.setRetrievalName(conceptRetrievalDTO.getParentName());
|
|
|
} else {//parent为空时说明没有子项返回本体id
|
|
|
if(null != questionInfoMap.get(conceptRetrievalDTO.getSelfName())){//如果匹配到就添加questionId
|
|
@@ -86,4 +91,33 @@ public class RetrievalFacade {
|
|
|
}
|
|
|
return retrievalDTOS;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 静态知识标签检索
|
|
|
+ *
|
|
|
+ * @param getStaticKnowledgeVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO){
|
|
|
+ RetrievalVO retrievalVO = new RetrievalVO();
|
|
|
+ RetrievalDTO retrievalDTO = new RetrievalDTO();
|
|
|
+ BeanUtil.copyProperties(getStaticKnowledgeVO,retrievalVO);
|
|
|
+ List<RetrievalDTO> retrievalDTOList = this.getTagInfos(retrievalVO);
|
|
|
+ List<RetrievalDTO> staticRetrievalList = new ArrayList<>();
|
|
|
+ List<Long> cenceptIdList = retrievalDTOList.stream().map(RetrievalDTO::getConceptId).collect(Collectors.toList());
|
|
|
+ ExistListByConceptIdsVO existListByConceptIdsVO = new ExistListByConceptIdsVO();
|
|
|
+ existListByConceptIdsVO.setConceptIds(cenceptIdList);
|
|
|
+ RespDTO<List<Long>> existConceptIdList = aiptServiceClient.existListByConceptIds(existListByConceptIdsVO);
|
|
|
+ RespDTOUtil.respNGDeal(existConceptIdList,"获取静态知识失败");
|
|
|
+ for (RetrievalDTO retrievalDTOInfo : retrievalDTOList) {
|
|
|
+ for (Long concept : existConceptIdList.data) {
|
|
|
+ if (retrievalDTOInfo.getConceptId().intValue() == concept.intValue()){
|
|
|
+ retrievalDTO = new RetrievalDTO();
|
|
|
+ BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
|
|
|
+ staticRetrievalList.add(retrievalDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return staticRetrievalList;
|
|
|
+ }
|
|
|
}
|