|
@@ -247,21 +247,20 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
|
|
public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
|
|
Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
|
|
Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
|
|
|
|
|
|
- List<Long> conceptIdList = null;
|
|
|
|
- if(StringUtil.isBlank(getAllInformationVO.getLibName())&&StringUtil.isNotBlank(getAllInformationVO.getName())){
|
|
|
|
- getAllInformationVO.setLibName(getAllInformationVO.getName());
|
|
|
|
- }
|
|
|
|
|
|
+ Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(),getAllInformationVO.getSize());
|
|
|
|
+ QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
|
|
if(StringUtil.isNotBlank(getAllInformationVO.getLibName())){
|
|
if(StringUtil.isNotBlank(getAllInformationVO.getLibName())){
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
libraryInfoQe.like("name", getAllInformationVO.getLibName());
|
|
libraryInfoQe.like("name", getAllInformationVO.getLibName());
|
|
libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"type_id", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"type_id", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
- conceptIdList = libraryinfoFacade.list(libraryInfoQe).stream().map(i->i.getConceptId()).distinct().collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> conceptIdList = libraryinfoFacade.list(libraryInfoQe).stream().map(i->i.getConceptId()).distinct().collect(Collectors.toList());
|
|
|
|
+ if(ListUtil.isNotEmpty(conceptIdList)){
|
|
|
|
+ conceptQe.in("id", conceptIdList);
|
|
|
|
+ }else{
|
|
|
|
+ conceptQe.eq("id", -999999999);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
- Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(),getAllInformationVO.getSize());
|
|
|
|
- QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
|
|
|
|
- conceptQe.in(ListUtil.isNotEmpty(conceptIdList), "id", conceptIdList);
|
|
|
|
conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()),"lib_name", getAllInformationVO.getName());
|
|
conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()),"lib_name", getAllInformationVO.getName());
|
|
conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),"is_deleted", getAllInformationVO.getIsDeleted());
|
|
conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),"is_deleted", getAllInformationVO.getIsDeleted());
|
|
@@ -837,7 +836,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOMainList = addConceptInfoVO.getDetailList().stream().filter(i -> i.getIsConcept() == 1).collect(Collectors.toList());
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOMainList = addConceptInfoVO.getDetailList().stream().filter(i -> i.getIsConcept() == 1).collect(Collectors.toList());
|
|
if (addConceptInfoDetailVOMainList.size() == 0) {
|
|
if (addConceptInfoDetailVOMainList.size() == 0) {
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_NULL, lineNumStr + "无标准术语!");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, lineNumStr + "同义词中缺少标准词本体!");
|
|
}
|
|
}
|
|
if (addConceptInfoDetailVOMainList.size() > 1) {
|
|
if (addConceptInfoDetailVOMainList.size() > 1) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, lineNumStr + "标准术语只能有一个!");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, lineNumStr + "标准术语只能有一个!");
|
|
@@ -859,13 +858,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
conceptCommon.setGmtModified(now);
|
|
conceptCommon.setGmtModified(now);
|
|
conceptCommon.setModifier(currentUser);
|
|
conceptCommon.setModifier(currentUser);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
List<LibraryInfo> extLibraryInfoList = Lists.newArrayList();
|
|
List<LibraryInfo> extLibraryInfoList = Lists.newArrayList();
|
|
addConceptInfoVO.getDetailList().forEach(a->{
|
|
addConceptInfoVO.getDetailList().forEach(a->{
|
|
List<LibraryInfo> libraryInfoListAll = libraryInfoListAllMap.get(a.getName());
|
|
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());
|
|
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));
|
|
extLibraryInfoList.add(libraryInfoListAll.get(0));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -969,19 +968,24 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
List<ConceptCommon> saveOrUpdateConceptCommonList = Lists.newArrayList();
|
|
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.getConceptCommon()!=null){
|
|
- if(i.getConceptId()!=null){
|
|
|
|
|
|
+ if(i.getConceptId()!=null&&conceptCommonMap!=null){
|
|
i.getConceptCommon().setId(conceptCommonMap.get(i.getConceptId()).getId());
|
|
i.getConceptCommon().setId(conceptCommonMap.get(i.getConceptId()).getId());
|
|
}
|
|
}
|
|
i.getConceptCommon().setConceptId(i.getConcept().getId());
|
|
i.getConceptCommon().setConceptId(i.getConcept().getId());
|
|
saveOrUpdateConceptCommonList.add(i.getConceptCommon());
|
|
saveOrUpdateConceptCommonList.add(i.getConceptCommon());
|
|
}
|
|
}
|
|
- });
|
|
|
|
- conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
|
|
|
+ }
|
|
|
|
+ if(ListUtil.isNotEmpty(saveOrUpdateConceptCommonList)){
|
|
|
|
+ conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
@SuppressWarnings("deprecation")
|