|
@@ -16,6 +16,7 @@ import com.diagbot.service.impl.ConceptServiceImpl;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.ParamConvertUtil;
|
|
|
import com.diagbot.vo.ConceptBaseVO;
|
|
|
+import com.diagbot.vo.ConceptExistVO;
|
|
|
import com.diagbot.vo.ConceptSearchVO;
|
|
|
import com.diagbot.vo.ConceptUsualVO;
|
|
|
import com.diagbot.vo.RetrievalVO;
|
|
@@ -116,12 +117,48 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
public List<Concept> getListByNamesAndType(List<String> nameList, Integer libType) {
|
|
|
QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("lib_name", nameList)
|
|
|
- .eq("lib_type", libType);
|
|
|
+ .in("lib_name", nameList);
|
|
|
+ if (libType != null) {
|
|
|
+ conceptQueryWrapper.eq("lib_type", libType);
|
|
|
+ }
|
|
|
List<Concept> list = this.list(conceptQueryWrapper);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据名称和类型获取概念列表Map
|
|
|
+ *
|
|
|
+ * @param conceptExistVO 搜索参数
|
|
|
+ * @return 术语id和术语 Map
|
|
|
+ */
|
|
|
+ public Map<String, Long> getConceptMap(ConceptExistVO conceptExistVO) {
|
|
|
+ // 入参验证
|
|
|
+ if (ListUtil.isEmpty(conceptExistVO.getNameList())) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "名称列表不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (conceptExistVO.getType() == null) {
|
|
|
+ Integer libType = ParamConvertUtil.conceptConvert2Lib(conceptExistVO.getType());
|
|
|
+ if (libType == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "类型不匹配");
|
|
|
+ }
|
|
|
+ conceptExistVO.setLibType(libType);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取结构
|
|
|
+ List<Concept> concepts
|
|
|
+ = this.getListByNamesAndType(conceptExistVO.getNameList(), conceptExistVO.getLibType());
|
|
|
+
|
|
|
+ //出参封装
|
|
|
+ Map<String, Long> map = new HashMap<>();
|
|
|
+ if (ListUtil.isNotEmpty(concepts)) {
|
|
|
+ map = concepts.stream().collect(Collectors.toMap(r -> r.getLibName(), r -> r.getId()));
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取常用标签
|
|
|
*
|