|
@@ -37,6 +37,7 @@ import com.diagbot.vo.KlConceptInfoVO;
|
|
|
import com.diagbot.vo.KlConceptSatarOrdisaVO;
|
|
|
import com.diagbot.vo.KlConceptSaveSubVO;
|
|
|
import com.diagbot.vo.KlConceptSaveVO;
|
|
|
+import com.diagbot.vo.KlLibraryInfoVO;
|
|
|
import com.diagbot.vo.SearchConceptVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -88,14 +89,52 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<KlConceptInfoDTO> getConceptInfoPage(KlConceptInfoVO klConceptInfoVO) {
|
|
|
- IPage<KlConceptInfoDTO> conceptPage = getConceptPage(klConceptInfoVO);
|
|
|
- List<String> userIds = conceptPage.getRecords().stream()
|
|
|
- .map(i -> i.getModifierId()).distinct().collect(Collectors.toList());
|
|
|
- RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
|
|
|
- RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
|
|
|
- conceptPage.getRecords().forEach(i -> {
|
|
|
- i.setModifierName(respDTO.data.get(i.getModifierId()));
|
|
|
- });
|
|
|
+ if (StringUtil.isNotBlank(klConceptInfoVO.getSynonymName())) {
|
|
|
+ KlLibraryInfoVO klLibraryInfoVO = new KlLibraryInfoVO();
|
|
|
+ BeanUtil.copyProperties(klConceptInfoVO, klLibraryInfoVO);
|
|
|
+ List<Long> conceptIdList = klLibraryInfoFacade.getLib(klLibraryInfoVO)
|
|
|
+ .stream().map(KlLibraryInfo::getConceptId).distinct().collect(Collectors.toList());
|
|
|
+ if (ListUtil.isEmpty(conceptIdList)) {
|
|
|
+ conceptIdList.add(-999999999L);
|
|
|
+ }
|
|
|
+ klConceptInfoVO.setConceptIdList(conceptIdList);
|
|
|
+ }
|
|
|
+ IPage<KlConceptInfoDTO> conceptPage = this.getConceptPage2(klConceptInfoVO);
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(conceptPage.getRecords())) {
|
|
|
+ //获取用户
|
|
|
+ List<String> userIds = conceptPage.getRecords().stream()
|
|
|
+ .map(KlConceptInfoDTO::getModifierId).distinct().collect(Collectors.toList());
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
|
|
|
+ RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
|
|
|
+ //获取同义词
|
|
|
+ List<Long> conceptIds = conceptPage.getRecords().stream()
|
|
|
+ .map(KlConceptInfoDTO::getConceptId).distinct().collect(Collectors.toList());
|
|
|
+ QueryWrapper<KlLibraryInfo> qw = new QueryWrapper<>();
|
|
|
+ qw.in("concept_id", conceptIds)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .orderByDesc("concept_id")
|
|
|
+ .orderByDesc("is_concept");
|
|
|
+ Map<Long, List<KlLibraryInfo>> libMap = klLibraryInfoFacade.list(qw)
|
|
|
+ .stream().collect(Collectors.groupingBy(KlLibraryInfo::getConceptId));
|
|
|
+ //获取类型
|
|
|
+ List<Integer> libTypes = conceptPage.getRecords().stream()
|
|
|
+ .map(KlConceptInfoDTO::getLibType).distinct().collect(Collectors.toList());
|
|
|
+ QueryWrapper<KlLexicon> qwLib = new QueryWrapper<>();
|
|
|
+ qwLib.in("code", libTypes)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ Map<Integer, String> lexiconMap = klLexiconFacade.list(qwLib)
|
|
|
+ .stream().collect(Collectors.toMap(KlLexicon::getCode, KlLexicon::getName));
|
|
|
+ //组装结果
|
|
|
+ conceptPage.getRecords().forEach(i -> {
|
|
|
+ i.setTypeName(lexiconMap.get(i.getLibType()));
|
|
|
+ i.setSynonymName(libMap.get(i.getConceptId())
|
|
|
+ .stream()
|
|
|
+ .map(KlLibraryInfo::getName)
|
|
|
+ .collect(Collectors.joining("、")));
|
|
|
+ i.setModifierName(respDTO.data.get(i.getModifierId()));
|
|
|
+ });
|
|
|
+ }
|
|
|
return conceptPage;
|
|
|
}
|
|
|
|