|
@@ -239,7 +239,10 @@ public class NeoFacade {
|
|
|
List<String> symptomCache = getSymptomCache();
|
|
|
//取交集
|
|
|
symptoms.retainAll(symptomCache);
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
List<String> allDis_bySymptom = pushDis(symptomNameRepository, symptoms);
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ System.out.println("并行消耗:"+(end - start) / 1000.0 + "秒");
|
|
|
return allDis_bySymptom;
|
|
|
}
|
|
|
|
|
@@ -254,7 +257,7 @@ public class NeoFacade {
|
|
|
public List<String> pushDis(SymptomNameRepository symptomNameRepository,List<String> symptoms){
|
|
|
List<String> allDis = Lists.newArrayList();
|
|
|
if(ListUtil.isNotEmpty(symptoms)){
|
|
|
- symptoms.forEach(x ->{
|
|
|
+ symptoms.parallelStream().forEach(x ->{
|
|
|
List<Symptom> byNameIs = symptomNameRepository.findByNameIs(x);
|
|
|
if(ListUtil.isNotEmpty(byNameIs)){
|
|
|
List<String> diseases = byNameIs.stream().filter(z -> z.getDisease() != null && z.getDisease().size() > 0)
|