Procházet zdrojové kódy

标准术语停用校验2

wangfeng před 4 roky
rodič
revize
d69272ad4f

+ 26 - 25
cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -378,33 +378,34 @@ public class KlConceptFacade extends KlConceptServiceImpl {
         if (sum == 0) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存!");
         }
-        //kl_concept_static 静态信息
-        int conceptStaticSum = klConceptStaticFacade.count(new QueryWrapper<KlConceptStatic>().eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
-        if (conceptStaticSum > 0) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与静态信息存在关系!");
-        }
+        if (status == StatusEnum.Disable.getKey()) {
+            //kl_concept_static 静态信息
+            int conceptStaticSum = klConceptStaticFacade.count(new QueryWrapper<KlConceptStatic>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (conceptStaticSum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与静态信息存在关系!");
+            }
 
-        //kl_relation
-        int relationsum = klRelationFacade.count(new QueryWrapper<KlRelation>().eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("start_id", klConceptSatarOrdisaVO.getConceptId()).or()
-                .eq("end_id", klConceptSatarOrdisaVO.getConceptId()));
-        if (relationsum > 0) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与树形结构或疾病相关存在关系!");
-        }
-        //kl_rule
-        int rulesum = klRuleFacade.count(new QueryWrapper<KlRule>().eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
-        if (rulesum > 0) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与规则维护存在关系!");
-        }
-        //kl_rule_base
-        int ruleBasesum = klRuleBaseFacade.count(new QueryWrapper<KlRuleBase>().eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
-        if (ruleBasesum > 0) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与规则维护明细存在关系!");
+            //kl_relation
+            int relationsum = klRelationFacade.count(new QueryWrapper<KlRelation>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("start_id", klConceptSatarOrdisaVO.getConceptId()).or()
+                    .eq("end_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (relationsum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与树形结构或疾病相关存在关系!");
+            }
+            //kl_rule
+            int rulesum = klRuleFacade.count(new QueryWrapper<KlRule>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (rulesum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与规则维护存在关系!");
+            }
+            //kl_rule_base
+            int ruleBasesum = klRuleBaseFacade.count(new QueryWrapper<KlRuleBase>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("concept_id", klConceptSatarOrdisaVO.getConceptId()));
+            if (ruleBasesum > 0) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医学标准术语与规则维护明细存在关系!");
+            }
         }
-
         UpdateWrapper<KlConcept> klLibraryUpdate = new UpdateWrapper<>();
         klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("id", klConceptSatarOrdisaVO.getConceptId()).set("status", status).set("gmt_modified", now);