|
@@ -88,8 +88,29 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("lib_name", staticKnowledgeVO.getName())
|
|
|
.eq("lib_type", type), false);
|
|
|
+ Integer sameType = null;
|
|
|
if (concept == null) {
|
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "标准词不存在");
|
|
|
+ //同名静态知识互取
|
|
|
+ if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
|
+ sameType = LexiconEnum.LisSubName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.LisSubName.getKey())) {
|
|
|
+ sameType = LexiconEnum.LisName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.PacsName.getKey())) {
|
|
|
+ sameType = LexiconEnum.PacsSubName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.PacsSubName.getKey())) {
|
|
|
+ sameType = LexiconEnum.PacsName.getKey();
|
|
|
+ }
|
|
|
+ if (sameType != null) {
|
|
|
+ concept = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("lib_name", staticKnowledgeVO.getName())
|
|
|
+ .eq("lib_type", sameType), false);
|
|
|
+ if (concept == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "标准词不存在");
|
|
|
+ } else {
|
|
|
+ staticKnowledgeVO.setType(sameType);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
KlConceptStatic staticInfo = this.getOne(new QueryWrapper<KlConceptStatic>()
|
|
@@ -97,6 +118,35 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
|
.eq("concept_id", concept.getId())
|
|
|
.eq("status", StatusEnum.Enable.getKey()), false);
|
|
|
|
|
|
+ //未取到静态知识
|
|
|
+ if (staticInfo == null && sameType == null) {
|
|
|
+ //同名静态知识互取
|
|
|
+ if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
|
+ sameType = LexiconEnum.LisSubName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.LisSubName.getKey())) {
|
|
|
+ sameType = LexiconEnum.LisName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.PacsName.getKey())) {
|
|
|
+ sameType = LexiconEnum.PacsSubName.getKey();
|
|
|
+ } else if (type.equals(LexiconEnum.PacsSubName.getKey())) {
|
|
|
+ sameType = LexiconEnum.PacsName.getKey();
|
|
|
+ }
|
|
|
+ if (sameType != null) {
|
|
|
+ KlConcept sameConcept = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .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) {
|
|
|
//检验子项或检查子项向上级取静态知识
|
|
|
if (type.equals(LexiconEnum.LisSubName.getKey())
|
|
@@ -209,6 +259,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
|
* @param klConceptStaticPageVO
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Override
|
|
|
public IPage<KlConceptStaticDTO> getPage(KlConceptStaticPageVO klConceptStaticPageVO) {
|
|
|
Integer type = convertType(klConceptStaticPageVO.getType(), 1);
|
|
|
klConceptStaticPageVO.setType(type);
|
|
@@ -252,6 +303,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
|
* @param staticKnowledgeIndexPageVO
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Override
|
|
|
public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
|
|
|
staticKnowledgeIndexPageVO.setTypeIds(new ArrayList<>());
|
|
|
|