Browse Source

1、术语关联映射

zhaops 3 years ago
parent
commit
af9cbbf1b5
1 changed files with 13 additions and 8 deletions
  1. 13 8
      src/main/java/com/diagbot/facade/MappingConfigFacade.java

+ 13 - 8
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -1106,7 +1106,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
 
         //医院术语名称不允许为空
         if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)医院术语为空:"
                     + emptyNumList.stream().map(Object::toString)
                     .collect(Collectors.joining("、"))
                     + "。导入取消,请修改后再试。\n");
@@ -1261,7 +1261,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
 
         //医院术语名称不允许为空
         if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)医院术语为空:"
                     + emptyNumList.stream().map(Object::toString)
                     .collect(Collectors.joining("、"))
                     + "。导入取消,请修改后再试。\n");
@@ -1394,9 +1394,11 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                         .collect(Collectors.toList()));
                 RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
                 RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-                Map<String, List<Long>> packMap = respDTO.data.stream()
+                Map<String, List<Long>> packMap = new HashMap<>();
+                respDTO.data.stream()
                         .collect(Collectors.groupingBy(IndexBatchDTO::getName,
                                 Collectors.mapping(IndexBatchDTO::getId, Collectors.toList())));
+
                 conceptVO.setType(ConceptTypeEnum.Lis.getKey());
                 conceptVO.setNames(tempList.stream()
                         .filter(i -> StringUtil.isNotBlank(i.getHisDetailName())
@@ -1404,11 +1406,14 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                         .map(MappingConfigWrapper::getUniqueName)
                         .distinct()
                         .collect(Collectors.toList()));
-                respDTO = cdssCoreClient.getConceptNames(conceptVO);
-                RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-                Map<String, List<Long>> lisMap = respDTO.data.stream()
-                        .collect(Collectors.groupingBy(IndexBatchDTO::getName,
-                                Collectors.mapping(IndexBatchDTO::getId, Collectors.toList())));
+                Map<String, List<Long>> lisMap = new HashMap<>();
+                if (ListUtil.isNotEmpty(conceptVO.getNames())) {
+                    respDTO = cdssCoreClient.getConceptNames(conceptVO);
+                    RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+                    lisMap = respDTO.data.stream()
+                            .collect(Collectors.groupingBy(IndexBatchDTO::getName,
+                                    Collectors.mapping(IndexBatchDTO::getId, Collectors.toList())));
+                }
 
                 for (MappingConfigWrapper item : tempList) {
                     if (StringUtil.isBlank(item.getUniqueName())) {