|
@@ -1,30 +1,9 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import java.io.InputStream;
|
|
|
-import java.text.DecimalFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
-import org.apache.poi.ss.usermodel.Cell;
|
|
|
-import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
+import com.diagbot.dto.ConceptBaseDTO;
|
|
|
import com.diagbot.dto.GetAllConceptDTO;
|
|
|
import com.diagbot.dto.GetAllInformationDTO;
|
|
|
import com.diagbot.dto.GetAllLisConceptDTO;
|
|
@@ -34,21 +13,47 @@ import com.diagbot.entity.Concept;
|
|
|
import com.diagbot.entity.Lexicon;
|
|
|
import com.diagbot.entity.LibraryInfo;
|
|
|
import com.diagbot.entity.Medical;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.LibraryInfoService;
|
|
|
import com.diagbot.service.impl.ConceptServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.ParamConvertUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddConceptInfoDetailVO;
|
|
|
import com.diagbot.vo.AddConceptInfoVO;
|
|
|
+import com.diagbot.vo.ConceptExistVO;
|
|
|
import com.diagbot.vo.GetAllConceptVO;
|
|
|
import com.diagbot.vo.GetAllInformationVO;
|
|
|
import com.diagbot.vo.GetAllLisConceptVO;
|
|
|
import com.diagbot.vo.GetConceptInfoDetailVO;
|
|
|
+import com.diagbot.vo.IndexVO;
|
|
|
import com.diagbot.vo.RemoveConceptInfoVO;
|
|
|
+import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.io.InputStream;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 术语查询业务层
|
|
@@ -587,5 +592,67 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据名称和类型获取概念列表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) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据名称和词性获取概念列表
|
|
|
+ *
|
|
|
+ * @param nameList
|
|
|
+ * @param libType
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ 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);
|
|
|
+ List<Concept> list = this.list(conceptQueryWrapper);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public List<ConceptBaseDTO> indexFac(IndexVO indexVO) {
|
|
|
+ // 类型转换
|
|
|
+ Integer libType = ParamConvertUtil.conceptConvert2Lib(indexVO.getType());
|
|
|
+ if(libType == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "类型不匹配");
|
|
|
+ }
|
|
|
+ indexVO.setLibType(libType);
|
|
|
+ return this.index(indexVO);
|
|
|
+ }
|
|
|
}
|