|
@@ -297,6 +297,25 @@ public class MedRetrievalFacade {
|
|
|
|
|
|
List<StaticKnowledgeIndexDTO> retList = klConceptFacade.staticIndex(staticKnowledgeIndexVO);
|
|
|
|
|
|
+ // 查询收藏静态知识检索
|
|
|
+ // 1. 获取查询出的所有静态知识条目 ID
|
|
|
+ List<Long> ids = retList.stream()
|
|
|
+ .map(StaticKnowledgeIndexDTO::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 2. 查询所有已收藏集合状态并将其映射到 ID
|
|
|
+ Map<Long, Integer> collectionStatusMap = klConceptFacade.lambdaQuery()
|
|
|
+ .in(KlConcept::getId, ids)
|
|
|
+ .list()
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(KlConcept::getId, KlConcept::getCollectionStatus));
|
|
|
+
|
|
|
+ // 3. 更新 DTO 的集合状态,加入收藏字段
|
|
|
+ retList.parallelStream().forEach(dto -> {
|
|
|
+ Integer collectionStatus = collectionStatusMap.get(dto.getId());
|
|
|
+ dto.setCollectionStatus(collectionStatus);
|
|
|
+ });
|
|
|
+
|
|
|
retList.forEach(i -> {
|
|
|
//前端展示
|
|
|
if (staticKnowledgeIndexVO.getHasInfo().equals(1)) {
|
|
@@ -400,6 +419,25 @@ public class MedRetrievalFacade {
|
|
|
|
|
|
List<ClassicCaseIndexDTO> retList = klConceptFacade.caseIndex(staticKnowledgeIndexVO);
|
|
|
|
|
|
+ // 查询收藏静态知识检索
|
|
|
+ // 1. 获取查询出的所有静态知识条目 ID
|
|
|
+ List<Long> ids = retList.stream()
|
|
|
+ .map(ClassicCaseIndexDTO::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 2. 查询所有已收藏集合状态并将其映射到 ID
|
|
|
+ Map<Long, Integer> collectionStatusMap = klConceptFacade.lambdaQuery()
|
|
|
+ .in(KlConcept::getId, ids)
|
|
|
+ .list()
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(KlConcept::getId, KlConcept::getCollectionStatus));
|
|
|
+
|
|
|
+ // 3. 更新 DTO 的集合状态,加入收藏字段
|
|
|
+ retList.parallelStream().forEach(dto -> {
|
|
|
+ Integer collectionStatus = collectionStatusMap.get(dto.getId());
|
|
|
+ dto.setCollectionStatus(collectionStatus);
|
|
|
+ });
|
|
|
+
|
|
|
retList.forEach(i -> {
|
|
|
//前端展示
|
|
|
if (staticKnowledgeIndexVO.getHasInfo().equals(1)) {
|