|
@@ -163,6 +163,18 @@ public class NeoFacade {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void symptomVitalCache() {
|
|
|
+ List<String> diseaseProperty = nodeRepository.getSymptomClass();
|
|
|
+ if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
|
+ Map map = diseaseProperty.stream().collect(Collectors.toMap(
|
|
|
+ k -> RedisEnum.symptomVitalType.getName() + k,
|
|
|
+ v -> v,
|
|
|
+ (v1, v2) -> (v2)
|
|
|
+ ));
|
|
|
+ redisTemplate.opsForValue().multiSet(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 返回图谱中所有症状缓存信息
|
|
|
*
|
|
@@ -476,12 +488,11 @@ public class NeoFacade {
|
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|
|
|
- List<String> symptomCache = getSymptomCache();
|
|
|
- //取交集
|
|
|
- symptoms.retainAll(symptomCache);
|
|
|
- long start = System.currentTimeMillis();
|
|
|
- List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, symptoms);
|
|
|
- long end = System.currentTimeMillis();
|
|
|
+ List<String> sv = redisUtil.getSv(symptoms);
|
|
|
+// List<String> symptomCache = getSymptomCache();
|
|
|
+// //取交集
|
|
|
+// symptoms.retainAll(symptomCache);
|
|
|
+ List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, sv);
|
|
|
return allDis_bySymptom;
|
|
|
}
|
|
|
|
|
@@ -505,11 +516,8 @@ public class NeoFacade {
|
|
|
*/
|
|
|
public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms) {
|
|
|
List<String> allDis = Lists.newArrayList();
|
|
|
- /*List<Symptom> byNameIn = symptomNameRepository.findByNameIn(symptoms);
|
|
|
- allDis = byNameIn.parallelStream()
|
|
|
- .map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
|
- .collect(Collectors.toList());*/
|
|
|
- allDis = symptomNameRepository.getDisBySymptoms(symptoms);
|
|
|
+// allDis = symptomNameRepository.getDisBySymptoms(symptoms);
|
|
|
+ allDis = symptomNameRepository.getDisBySymptoms_1(symptoms);
|
|
|
return allDis;
|
|
|
}
|
|
|
|