|
@@ -1423,6 +1423,8 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
public RespDTO updateNeoDisease(NeoParamVO singleDisease) {
|
|
|
RespDTO respDTO = RespDTO.onSuc(true);;
|
|
|
Long disId = singleDisease.getId();
|
|
|
+ //先删除
|
|
|
+ this.neo4jDelete(disId);
|
|
|
String disName = this.getDisName(disId);
|
|
|
if(StringUtils.isNotEmpty(disName)){
|
|
|
diseaseRepository.mergeDis(disName,disId,0);
|
|
@@ -2052,20 +2054,67 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|
|
Long disId = singleDisease.getId();
|
|
|
RespDTO respDTO = null;
|
|
|
if(disId != null){
|
|
|
+ this.neo4jDelete(disId);
|
|
|
+ respDTO = RespDTO.onSuc(true);
|
|
|
+ }else {
|
|
|
+ respDTO = RespDTO.onError(disId +" 删除失败!!!");
|
|
|
+ }
|
|
|
+ return respDTO;
|
|
|
+ }
|
|
|
+ //删除
|
|
|
+ public void neo4jDelete(Long disId) {
|
|
|
+ if (disId != null) {
|
|
|
diseaseRepository.deleteRelation1(disId);
|
|
|
diseaseRepository.deleteRelation2(disId);
|
|
|
diseaseRepository.deleteRelation3(disId);
|
|
|
diseaseRepository.deleteRelation4(disId);
|
|
|
- diseaseRepository.deleteRelation5(disId);
|
|
|
+// diseaseRepository.deleteRelation5(disId);
|
|
|
diseaseRepository.deleteRelation6(disId);
|
|
|
diseaseRepository.deleteRelation7(disId);
|
|
|
diseaseRepository.deleteRelation8(disId);
|
|
|
diseaseRepository.deleteRelation9(disId);
|
|
|
- respDTO = RespDTO.onSuc(true);
|
|
|
- }else {
|
|
|
- respDTO = RespDTO.onError(disId +" 删除失败!!!");
|
|
|
+ List<String> allCode = this.getAllCode(disId);
|
|
|
+ if(allCode.size()>0){
|
|
|
+ for (String conName:allCode) {
|
|
|
+ diseaseRepository.deleteRelation10(conName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- return respDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取一个诊断依据的全部code
|
|
|
+ * @param disId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<String> getAllCode(Long disId){
|
|
|
+ List<String> codeList = new ArrayList<>();
|
|
|
+ conn = this.getConn();
|
|
|
+ Statement st = null;
|
|
|
+ ResultSet rs = null;
|
|
|
+ try {
|
|
|
+ String code ,name;
|
|
|
+ String sql = "SELECT dis_name,code FROM `kl_diagnose_detail` where diagnose_id="+disId+" and code != \"\"";
|
|
|
+ st = conn.createStatement();
|
|
|
+ rs = st.executeQuery(sql);
|
|
|
+ while (rs.next()){
|
|
|
+ name = rs.getString("dis_name");
|
|
|
+ code = rs.getString("code");
|
|
|
+ codeList.add(name+code);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ try {
|
|
|
+ rs.close();
|
|
|
+ st.close();
|
|
|
+ } catch (SQLException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return codeList;
|
|
|
}
|
|
|
|
|
|
@Override
|