|
@@ -262,15 +262,24 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
*/
|
|
|
public GetConceptInfoDTO getConceptInfoDetail(GetConceptInfoDetailVO getConceptInfoDetailVO) {
|
|
|
GetConceptInfoDTO getConceptInfoDTO = new GetConceptInfoDTO();
|
|
|
+
|
|
|
+ Concept concept = this.getById(getConceptInfoDetailVO.getConceptId());
|
|
|
+ if (concept == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS);
|
|
|
+ }
|
|
|
|
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
|
|
|
libraryInfoQe.eq("concept_id", getConceptInfoDetailVO.getConceptId());
|
|
|
- List<LibraryInfo> libraryInfoList = libraryinfoFacade.list(libraryInfoQe);
|
|
|
+ List<GetConceptInfoDetailDTO> getConceptInfoDetailDTOList = BeanUtil.listCopyTo(libraryinfoFacade.list(libraryInfoQe), GetConceptInfoDetailDTO.class);
|
|
|
+ getConceptInfoDetailDTOList.forEach(i->{
|
|
|
+ i.setType(LexiconTypeEnum.getName(i.getTypeId().intValue()));
|
|
|
+ });
|
|
|
|
|
|
- getConceptInfoDTO.setLibName(BeanUtil.listCopyTo(libraryInfoList.stream().filter(i -> i.getIsConcept() != null && i.getIsConcept() == 1).collect(Collectors.toList()), GetConceptInfoDetailDTO.class));
|
|
|
- getConceptInfoDTO.setOtherNames(BeanUtil.listCopyTo(libraryInfoList.stream().filter(i -> i.getIsConcept() == null || i.getIsConcept() == 0).collect(Collectors.toList()), GetConceptInfoDetailDTO.class));
|
|
|
+ getConceptInfoDTO.setLibName(getConceptInfoDetailDTOList.stream().filter(i -> i.getIsConcept() != null && i.getIsConcept() == 1).collect(Collectors.toList()));
|
|
|
+ getConceptInfoDTO.setOtherNames(getConceptInfoDetailDTOList.stream().filter(i -> i.getIsConcept() == null || i.getIsConcept() == 0).collect(Collectors.toList()));
|
|
|
|
|
|
- Integer isHasCommon = lexiconFacade.getById(libraryInfoList.get(0).getTypeId()).getIsHasCommon();
|
|
|
+ Integer isHasCommon = lexiconFacade.getById(concept.getLibType()).getIsHasCommon();
|
|
|
+ getConceptInfoDTO.setIsHasCommon(isHasCommon);
|
|
|
if (isHasCommon == 1) {
|
|
|
QueryWrapper<ConceptCommon> conceptCommonQe = new QueryWrapper<>();
|
|
|
conceptCommonQe.eq("concept_id", getConceptInfoDetailVO.getConceptId());
|
|
@@ -345,7 +354,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
BeanUtil.copyProperties(addConceptInfoDetailVOMain, libraryInfoMain);
|
|
|
libraryInfoMain.setGmtCreate(now);
|
|
|
libraryInfoMain.setCreator(currentUser);
|
|
|
- libraryInfoMain.setType(addConceptInfoVO.getType());
|
|
|
libraryInfoMain.setTypeId(lexicon.getId());
|
|
|
libraryinfoFacade.save(libraryInfoMain);
|
|
|
concept.setLibId(libraryInfoMain.getId());
|
|
@@ -412,7 +420,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
for (LibraryInfo i : saveOrUpdateLibraryInfoList) {
|
|
|
i.setId(null);
|
|
|
i.setConceptId(conceptId);
|
|
|
- i.setType(addConceptInfoVO.getType());
|
|
|
i.setTypeId(lexicon.getId());
|
|
|
}
|
|
|
libraryInfoMain.setIsConcept(1);
|