|
@@ -162,12 +162,19 @@ public class KlConceptCollectionFacade {
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
List<KlConcept> concepts = klConceptFacade.list(new QueryWrapper<KlConcept>()
|
|
List<KlConcept> concepts = klConceptFacade.list(new QueryWrapper<KlConcept>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("status", StatusEnum.Enable.getKey())
|
|
|
|
|
|
+ //.eq("status", StatusEnum.Enable.getKey())
|
|
.in("id", conceptIds));
|
|
.in("id", conceptIds));
|
|
|
|
|
|
if (ListUtil.isEmpty(concepts)) {
|
|
if (ListUtil.isEmpty(concepts)) {
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "基础术语不存在或已禁用");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "保存失败,基础术语不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (KlConcept concept : concepts) {
|
|
|
|
+ if (concept.getStatus().equals(StatusEnum.Disable.getKey())) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "保存失败,存在已禁用基础术语");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
List<Long> saveConceptIds = concepts.stream().map(KlConcept::getId).collect(Collectors.toList());
|
|
List<Long> saveConceptIds = concepts.stream().map(KlConcept::getId).collect(Collectors.toList());
|
|
|
|
|
|
//删除已有记录
|
|
//删除已有记录
|
|
@@ -363,27 +370,34 @@ public class KlConceptCollectionFacade {
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("lib_type", conceptCollectionVO.getConceptLibType())
|
|
.eq("lib_type", conceptCollectionVO.getConceptLibType())
|
|
.in("lib_name", conceptNames));
|
|
.in("lib_name", conceptNames));
|
|
- Map<String, Long> klConceptMap = new HashMap<>();
|
|
|
|
|
|
+ Map<String, KlConcept> klConceptMap = new HashMap<>();
|
|
|
|
|
|
if (ListUtil.isNotEmpty(klConceptList)) {
|
|
if (ListUtil.isNotEmpty(klConceptList)) {
|
|
- klConceptMap = klConceptList.stream().collect(Collectors.toMap(KlConcept::getLibName, KlConcept::getId));
|
|
|
|
|
|
+ klConceptMap = klConceptList.stream().collect(Collectors.toMap(KlConcept::getLibName, v -> v));
|
|
}
|
|
}
|
|
|
|
|
|
List<ConceptCollectionBaseVO> matchList = Lists.newLinkedList();
|
|
List<ConceptCollectionBaseVO> matchList = Lists.newLinkedList();
|
|
List<ConceptCollectionBaseVO> unMatchList = Lists.newLinkedList();
|
|
List<ConceptCollectionBaseVO> unMatchList = Lists.newLinkedList();
|
|
|
|
+ List<ConceptCollectionBaseVO> disableList = Lists.newLinkedList();
|
|
for (String name : conceptNames) {
|
|
for (String name : conceptNames) {
|
|
ConceptCollectionBaseVO baseVO = new ConceptCollectionBaseVO();
|
|
ConceptCollectionBaseVO baseVO = new ConceptCollectionBaseVO();
|
|
baseVO.setConceptLibName(name);
|
|
baseVO.setConceptLibName(name);
|
|
baseVO.setConceptLibType(conceptCollectionVO.getConceptLibType());
|
|
baseVO.setConceptLibType(conceptCollectionVO.getConceptLibType());
|
|
if (klConceptMap.containsKey(name)) {
|
|
if (klConceptMap.containsKey(name)) {
|
|
- baseVO.setConceptId(klConceptMap.get(name));
|
|
|
|
- matchList.add(baseVO);
|
|
|
|
|
|
+ KlConcept baseConcept = klConceptMap.get(name);
|
|
|
|
+ baseVO.setConceptId(baseConcept.getId());
|
|
|
|
+ if (baseConcept.getStatus().equals(StatusEnum.Enable.getKey())) {
|
|
|
|
+ matchList.add(baseVO);
|
|
|
|
+ } else {
|
|
|
|
+ disableList.add(baseVO);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
unMatchList.add(baseVO);
|
|
unMatchList.add(baseVO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
retDTO.setMatchList(matchList);
|
|
retDTO.setMatchList(matchList);
|
|
retDTO.setUnMatchList(unMatchList);
|
|
retDTO.setUnMatchList(unMatchList);
|
|
|
|
+ retDTO.setDisableList(disableList);
|
|
|
|
|
|
return retDTO;
|
|
return retDTO;
|
|
}
|
|
}
|