|
@@ -858,13 +858,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
conceptCommon.setGmtModified(now);
|
|
|
conceptCommon.setModifier(currentUser);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
List<LibraryInfo> extLibraryInfoList = Lists.newArrayList();
|
|
|
addConceptInfoVO.getDetailList().forEach(a->{
|
|
|
List<LibraryInfo> libraryInfoListAll = libraryInfoListAllMap.get(a.getName());
|
|
|
- if(libraryInfoListAll!=null){
|
|
|
+ if(ListUtil.isNotEmpty(libraryInfoListAll)){
|
|
|
libraryInfoListAll = libraryInfoListAll.stream().filter(b->b.getTypeId().intValue()==typeId.intValue()).collect(Collectors.toList());
|
|
|
- if(libraryInfoListAll!=null){
|
|
|
+ if(ListUtil.isNotEmpty(libraryInfoListAll)){
|
|
|
extLibraryInfoList.add(libraryInfoListAll.get(0));
|
|
|
}
|
|
|
}
|
|
@@ -968,19 +968,24 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
|
|
|
List<ConceptCommon> saveOrUpdateConceptCommonList = Lists.newArrayList();
|
|
|
- QueryWrapper<ConceptCommon> conceptCommonQe = new QueryWrapper<>();
|
|
|
- conceptCommonQe.in("concept_id", conceptIds);
|
|
|
- Map<Long,ConceptCommon> conceptCommonMap = conceptCommonFacade.list(conceptCommonQe).stream().collect(Collectors.toMap(ConceptCommon::getConceptId, i->i));
|
|
|
- addConceptInfoVOList.forEach(i->{
|
|
|
+ Map<Long,ConceptCommon> conceptCommonMap = null;
|
|
|
+ if(ListUtil.isNotEmpty(conceptIds)){
|
|
|
+ QueryWrapper<ConceptCommon> conceptCommonQe = new QueryWrapper<>();
|
|
|
+ conceptCommonQe.in("concept_id", conceptIds);
|
|
|
+ conceptCommonMap = conceptCommonFacade.list(conceptCommonQe).stream().collect(Collectors.toMap(ConceptCommon::getConceptId, i->i));
|
|
|
+ }
|
|
|
+ for(AddConceptInfoVO i : addConceptInfoVOList){
|
|
|
if(i.getConceptCommon()!=null){
|
|
|
- if(i.getConceptId()!=null){
|
|
|
+ if(i.getConceptId()!=null&&conceptCommonMap!=null){
|
|
|
i.getConceptCommon().setId(conceptCommonMap.get(i.getConceptId()).getId());
|
|
|
}
|
|
|
i.getConceptCommon().setConceptId(i.getConcept().getId());
|
|
|
saveOrUpdateConceptCommonList.add(i.getConceptCommon());
|
|
|
}
|
|
|
- });
|
|
|
- conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
+ }
|
|
|
+ if(ListUtil.isNotEmpty(saveOrUpdateConceptCommonList)){
|
|
|
+ conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|