|
@@ -38,8 +38,6 @@ import io.github.lvyahui8.spring.facade.DataFacade;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
-import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -67,9 +65,6 @@ public class NeoFacade {
|
|
@Autowired
|
|
@Autowired
|
|
RedisUtil redisUtil;
|
|
RedisUtil redisUtil;
|
|
@Autowired
|
|
@Autowired
|
|
- @Qualifier("redisTemplateForSimilar")
|
|
|
|
- RedisTemplate redisTemplate;
|
|
|
|
- @Autowired
|
|
|
|
SymptomFeatureService symptomFeatureService;
|
|
SymptomFeatureService symptomFeatureService;
|
|
@Autowired
|
|
@Autowired
|
|
KlDiseaseCorrespondingService klDiseaseCorrespondingService;
|
|
KlDiseaseCorrespondingService klDiseaseCorrespondingService;
|
|
@@ -102,7 +97,7 @@ public class NeoFacade {
|
|
Collectors.toMap(k -> RedisEnum.drugType.getName() + k.getDrugType(),
|
|
Collectors.toMap(k -> RedisEnum.drugType.getName() + k.getDrugType(),
|
|
v -> v.getDrugs(), (v1, v2) -> (v2)));
|
|
v -> v.getDrugs(), (v1, v2) -> (v2)));
|
|
if (redisMap != null && redisMap.size() > 0) {
|
|
if (redisMap != null && redisMap.size() > 0) {
|
|
- redisTemplate.opsForValue().multiSet(redisMap);
|
|
|
|
|
|
+ redisUtil.multiSet(redisMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -120,7 +115,7 @@ public class NeoFacade {
|
|
},
|
|
},
|
|
(v1, v2) -> (v2)
|
|
(v1, v2) -> (v2)
|
|
));
|
|
));
|
|
- redisTemplate.opsForValue().multiSet(map);
|
|
|
|
|
|
+ redisUtil.multiSet(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -135,7 +130,7 @@ public class NeoFacade {
|
|
Map<String, Long> collect = y.stream().collect(Collectors.toMap(TranHospitalFilter::getUniqueName, TranHospitalFilter::getDocNum, (existing, replacement) -> replacement));
|
|
Map<String, Long> collect = y.stream().collect(Collectors.toMap(TranHospitalFilter::getUniqueName, TranHospitalFilter::getDocNum, (existing, replacement) -> replacement));
|
|
data.put(RedisEnum.diseaseFilter.getName() + x.toString(), collect);
|
|
data.put(RedisEnum.diseaseFilter.getName() + x.toString(), collect);
|
|
});
|
|
});
|
|
- redisTemplate.opsForValue().multiSet(data);
|
|
|
|
|
|
+ redisUtil.multiSet(data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -159,7 +154,7 @@ public class NeoFacade {
|
|
},
|
|
},
|
|
(v1, v2) -> (v2)
|
|
(v1, v2) -> (v2)
|
|
));
|
|
));
|
|
- redisTemplate.opsForValue().multiSet(map);
|
|
|
|
|
|
+ redisUtil.multiSet(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -499,7 +494,25 @@ public class NeoFacade {
|
|
try {
|
|
try {
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
Map<String, RuleDTO> map = DataFacade.get("getAllRules", invokeParams, Map.class);
|
|
Map<String, RuleDTO> map = DataFacade.get("getAllRules", invokeParams, Map.class);
|
|
- redisTemplate.opsForValue().multiSet(map);
|
|
|
|
|
|
+ // // TODO 过敏原添加自身过敏
|
|
|
|
+ // for (String key : map.keySet()) {
|
|
|
|
+ // if (key.startsWith(RedisEnum.allRule.getName() + LexiconEnum.Medicine.getKey()) && key.endsWith("_1")) {
|
|
|
|
+ // RuleDTO ruleDTO = map.get(key);
|
|
|
|
+ // List<RuleConditionDTO> ruleConditionDTOList = ruleDTO.getRuleConditionDTOList();
|
|
|
|
+ // RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
|
|
|
|
+ // ruleConditionDTO.setHasSubCond(1);
|
|
|
|
+ // ruleConditionDTO.setRuleGroup("11");
|
|
|
|
+ // List<RuleBaseDTO> ruleBaseDTOList = new ArrayList<>();
|
|
|
|
+ // RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
|
|
|
|
+ // ruleBaseDTO.setBaseLibName(ruleDTO.getLibName());
|
|
|
|
+ // ruleBaseDTO.setBaseLibType(ruleDTO.getLibType());
|
|
|
|
+ // ruleBaseDTO.setBaseType(BaseTypeEnum.B1.getKey());
|
|
|
|
+ // ruleBaseDTOList.add(ruleBaseDTO);
|
|
|
|
+ // ruleConditionDTO.setRuleBaseDTOList(ruleBaseDTOList);
|
|
|
|
+ // ruleConditionDTOList.add(ruleConditionDTO);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ redisUtil.multiSet(map);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有规则失败" + e.getMessage());
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有规则失败" + e.getMessage());
|
|
}
|
|
}
|
|
@@ -508,14 +521,14 @@ public class NeoFacade {
|
|
public void allBaseDiagnose() {
|
|
public void allBaseDiagnose() {
|
|
List<BaseDiagnoseDTO> list = klDiagnoseBaseFacade.getAllBaseDiagnose();
|
|
List<BaseDiagnoseDTO> list = klDiagnoseBaseFacade.getAllBaseDiagnose();
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
- redisTemplate.opsForValue().set(RedisEnum.allBaseDiagnose.getName(), list);
|
|
|
|
|
|
+ redisUtil.set(RedisEnum.allBaseDiagnose.getName(), list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void allBaseRegulation() {
|
|
public void allBaseRegulation() {
|
|
List<BaseRegulationDTO> list = klRegulationBaseFacade.getSelectBase(new ArrayList<>());
|
|
List<BaseRegulationDTO> list = klRegulationBaseFacade.getSelectBase(new ArrayList<>());
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
if (ListUtil.isNotEmpty(list)) {
|
|
- redisTemplate.opsForValue().set(RedisEnum.allBaseRegulation.getName(), list);
|
|
|
|
|
|
+ redisUtil.set(RedisEnum.allBaseRegulation.getName(), list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|