Prechádzať zdrojové kódy

1、医院端获取静态知识

zhaops 4 rokov pred
rodič
commit
5e25bdb94e

+ 13 - 9
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -89,6 +89,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 .eq("lib_name", staticKnowledgeVO.getName())
                 .eq("lib_type", type), false);
         Integer sameType = null;
+        //标准词不存在,同名的是否存在
         if (concept == null) {
             //同名静态知识互取
             if (type.equals(LexiconEnum.LisName.getKey())) {
@@ -104,22 +105,23 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 concept = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("lib_name", staticKnowledgeVO.getName())
-                        .eq("lib_type", sameType), false);
+                        .eq("lib_type", sameType)
+                        .eq("status", StatusEnum.Enable.getKey()), false);
                 if (concept == null) {
                     throw new CommonException(CommonErrorCode.NOT_EXISTS, "标准词不存在");
-                } else {
-                    staticKnowledgeVO.setType(sameType);
                 }
             }
         }
-
         KlConceptStatic staticInfo = this.getOne(new QueryWrapper<KlConceptStatic>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("concept_id", concept.getId())
                 .eq("status", StatusEnum.Enable.getKey()), false);
+        if (staticInfo != null) {
+            staticKnowledgeVO.setType(sameType);
+        }
 
-        //未取到静态知识
-        if (staticInfo == null && sameType == null) {
+        //标准术语存在静态知识不存在,取同名静态知识
+        if (concept != null && staticInfo == null && sameType == null) {
             //同名静态知识互取
             if (type.equals(LexiconEnum.LisName.getKey())) {
                 sameType = LexiconEnum.LisSubName.getKey();
@@ -136,13 +138,15 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                         .eq("lib_name", staticKnowledgeVO.getName())
                         .eq("lib_type", sameType), false);
                 if (sameConcept != null) {
-                    staticKnowledgeVO.setType(sameType);
-                    //存在同名的项,替换原来的项
-                    BeanUtil.copyProperties(sameConcept, concept);
                     staticInfo = this.getOne(new QueryWrapper<KlConceptStatic>()
                             .eq("is_deleted", IsDeleteEnum.N.getKey())
                             .eq("concept_id", sameConcept.getId())
                             .eq("status", StatusEnum.Enable.getKey()), false);
+                    if (staticInfo != null) {
+                        //存在同名的项,替换原来的项
+                        BeanUtil.copyProperties(sameConcept, concept);
+                        staticKnowledgeVO.setType(sameType);
+                    }
                 }
             }
         }