|
@@ -12,6 +12,7 @@ import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.KlConcept;
|
|
|
import com.diagbot.entity.KlConceptCommon;
|
|
|
import com.diagbot.entity.KlDisease;
|
|
|
+import com.diagbot.entity.KlLexicon;
|
|
|
import com.diagbot.entity.KlLibraryInfo;
|
|
|
import com.diagbot.entity.KlLis;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -61,6 +62,8 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
KlLisFacade klLisFacade;
|
|
|
@Autowired
|
|
|
KlDiseaseFacade klDiseaseFacade;
|
|
|
+ @Autowired
|
|
|
+ KlLexiconFacade klLexiconFacade;
|
|
|
|
|
|
/**
|
|
|
* @param klConceptInfoVO
|
|
@@ -108,6 +111,8 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
public Boolean saveConceptInfo(KlConceptSaveVO klConceptSaveVO) {
|
|
|
Date now = DateUtil.now();
|
|
|
boolean res = false;
|
|
|
+ //校验只能有一条数据
|
|
|
+ checkLibType(klConceptSaveVO);
|
|
|
// 校验名称是否相同
|
|
|
int count = this.count(new QueryWrapper<KlConcept>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -174,6 +179,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
klLibraryInfoSub.setConceptId(conceptId);
|
|
|
klLibraryInfoSub.setName(klConceptSaveVO.getSynonymName());
|
|
|
klLibraryInfoSub.setSpell(klConceptSaveVO.getSpell());
|
|
|
+ klLibraryInfoSub.setTypeId(klConceptSaveVO.getLibType());
|
|
|
klLibraryInfoSub.setIsConcept(klConceptSaveVO.getIsConcept());
|
|
|
klLibraryInfoSub.setRemark(klConceptSaveVO.getRemark());
|
|
|
klLibraryInfoSub.setCreator(UserUtils.getCurrentPrincipleID());
|
|
@@ -386,4 +392,18 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
return this.update(klLibraryUpdate);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ private void checkLibType(KlConceptSaveVO klConceptSaveVO) {
|
|
|
+ QueryWrapper<KlLexicon> klLexiconQuery = new QueryWrapper<>();
|
|
|
+ klLexiconQuery.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("only_one", 1);
|
|
|
+ List<KlLexicon> klLexiconList = klLexiconFacade.list(klLexiconQuery);
|
|
|
+ if (klLexiconList.contains(klConceptSaveVO.getLibType())) {
|
|
|
+ int count = this.count(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("lib_type", klConceptSaveVO.getLibType()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该基础术语词性只能有一个");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|