|
@@ -11,8 +11,12 @@ import com.diagbot.dto.KlConceptInfoDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.entity.KlConcept;
|
|
import com.diagbot.entity.KlConcept;
|
|
import com.diagbot.entity.KlConceptCommon;
|
|
import com.diagbot.entity.KlConceptCommon;
|
|
|
|
+import com.diagbot.entity.KlConceptStatic;
|
|
import com.diagbot.entity.KlLexicon;
|
|
import com.diagbot.entity.KlLexicon;
|
|
import com.diagbot.entity.KlLibraryInfo;
|
|
import com.diagbot.entity.KlLibraryInfo;
|
|
|
|
+import com.diagbot.entity.KlRelation;
|
|
|
|
+import com.diagbot.entity.KlRule;
|
|
|
|
+import com.diagbot.entity.KlRuleBase;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.StatusEnum;
|
|
import com.diagbot.enums.StatusEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -63,6 +67,15 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
KlDiseaseFacade klDiseaseFacade;
|
|
KlDiseaseFacade klDiseaseFacade;
|
|
@Autowired
|
|
@Autowired
|
|
KlLexiconFacade klLexiconFacade;
|
|
KlLexiconFacade klLexiconFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ KlConceptStaticFacade klConceptStaticFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ KlRelationFacade klRelationFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ KlRuleFacade klRuleFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ KlRuleBaseFacade klRuleBaseFacade;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param klConceptInfoVO
|
|
* @param klConceptInfoVO
|
|
@@ -365,6 +378,33 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
if (sum == 0) {
|
|
if (sum == 0) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存!");
|
|
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, "该医学标准术语与静态信息存在关系!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //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<>();
|
|
UpdateWrapper<KlConcept> klLibraryUpdate = new UpdateWrapper<>();
|
|
klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("id", klConceptSatarOrdisaVO.getConceptId()).set("status", status).set("gmt_modified", now);
|
|
.eq("id", klConceptSatarOrdisaVO.getConceptId()).set("status", status).set("gmt_modified", now);
|