|
@@ -297,24 +297,27 @@ public class MedRetrievalFacade {
|
|
|
|
|
|
List<StaticKnowledgeIndexDTO> retList = klConceptFacade.staticIndex(staticKnowledgeIndexVO);
|
|
|
|
|
|
- // 查询收藏静态知识检索
|
|
|
+ if(retList.size() > 0){
|
|
|
+ // 查询静态知识检索收藏字段值
|
|
|
// 1. 获取查询出的所有静态知识条目 ID
|
|
|
- List<Long> ids = retList.stream()
|
|
|
- .map(StaticKnowledgeIndexDTO::getId)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ 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));
|
|
|
+ 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.parallelStream().forEach(dto -> {
|
|
|
+ Integer collectionStatus = collectionStatusMap.get(dto.getId());
|
|
|
+ dto.setCollectionStatus(collectionStatus);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
retList.forEach(i -> {
|
|
|
//前端展示
|
|
@@ -363,30 +366,39 @@ public class MedRetrievalFacade {
|
|
|
case 100:
|
|
|
dto.setType(1);
|
|
|
dto.setTypeName("诊断");
|
|
|
+ break;
|
|
|
case 101:
|
|
|
dto.setType(2);
|
|
|
dto.setTypeName("药品");
|
|
|
+ break;
|
|
|
case 107:
|
|
|
dto.setType(3);
|
|
|
dto.setTypeName("检验套餐");
|
|
|
+ break;
|
|
|
case 108:
|
|
|
dto.setType(4);
|
|
|
dto.setTypeName("检验细项");
|
|
|
+ break;
|
|
|
case 109:
|
|
|
dto.setType(5);
|
|
|
dto.setTypeName("检查");
|
|
|
+ break;
|
|
|
case 106:
|
|
|
dto.setType(7);
|
|
|
dto.setTypeName("手术和操作");
|
|
|
+ break;
|
|
|
case 124:
|
|
|
dto.setType(8);
|
|
|
dto.setTypeName("量表/医学计算公式");
|
|
|
+ break;
|
|
|
case 123:
|
|
|
dto.setType(9);
|
|
|
dto.setTypeName("护理");
|
|
|
+ break;
|
|
|
case 130:
|
|
|
dto.setType(10);
|
|
|
dto.setTypeName("政策法规");
|
|
|
+ break;
|
|
|
}
|
|
|
retList.add(dto);
|
|
|
}
|