Pārlūkot izejas kodu

1、异常处理
2、推理结果关联医院术语

zhaops 4 gadi atpakaļ
vecāks
revīzija
afc05714de

+ 5 - 4
src/main/java/com/diagbot/aggregate/AssemblePushAggregate.java

@@ -2,6 +2,7 @@ package com.diagbot.aggregate;
 
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushScaleDTO;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.facade.MappingConfigFacade;
 import com.diagbot.util.ListUtil;
@@ -40,7 +41,7 @@ public class AssemblePushAggregate {
             @DataConsumer("retDiagMap") Map<String, List<PushBaseDTO>> retDiagMap,
             @DataConsumer("retOperation") List<PushBaseDTO> retOperation,
             @DataConsumer("retDrug") List<PushBaseDTO> retDrug,
-            @DataConsumer("retScale") List<PushBaseDTO> retScale,
+            @DataConsumer("retScale") List<PushScaleDTO> retScale,
             @DataConsumer("retNurse") List<PushBaseDTO> retNurse) {
         //检验
         if (ListUtil.isNotEmpty(retLis)) {
@@ -222,10 +223,10 @@ public class AssemblePushAggregate {
     }
 
     @DataProvider("retScale")
-    public List<PushBaseDTO> retScale(@InvokeParameter("pushDTO") PushDTO data,
-                                      @InvokeParameter("hospitalId") Long hospitalId) {
+    public List<PushScaleDTO> retScale(@InvokeParameter("pushDTO") PushDTO data,
+                                       @InvokeParameter("hospitalId") Long hospitalId) {
         //量表
-        List<PushBaseDTO> retScale = new ArrayList<>();
+        List<PushScaleDTO> retScale = new ArrayList<>();
         if (ListUtil.isNotEmpty(data.getScale())) {
             retScale = data.getScale();
             List<String> uniqueNameList = retScale.stream()

+ 17 - 1
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -12,6 +12,8 @@ import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.SysUser;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
@@ -67,6 +69,8 @@ public class KlConceptStaticFacade {
         RespDTO<List<StaticKnowledgeIndexDTO>> respDTO = cdssCoreClient.staticKnowledgeIndex(staticKnowledgeIndexVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             retList = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
 
         if (staticKnowledgeIndexVO.getHasInfo() != null && staticKnowledgeIndexVO.getHasInfo().equals(1)) {
@@ -104,7 +108,7 @@ public class KlConceptStaticFacade {
             StaticKnowledgeDTO staticKnowledgeDTO = respDTO.data;
             return staticKnowledgeDTO;
         } else {
-            return null;
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
     }
 
@@ -151,6 +155,8 @@ public class KlConceptStaticFacade {
         RespDTO<Page<KlConceptStaticDTO>> respDTO = cdssCoreClient.getPage(klConceptStaticPageVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             page = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         List<KlConceptStaticDTO> records = page.getRecords();
         List<Long> userIds = records.stream().map(KlConceptStaticDTO::getModifier)
@@ -191,6 +197,8 @@ public class KlConceptStaticFacade {
         RespDTO<Page<StaticKnowledgeIndexPageDTO>> respDTO = cdssCoreClient.staticIndexPage(staticKnowledgeIndexPageVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             page = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         return page;
     }
@@ -209,6 +217,8 @@ public class KlConceptStaticFacade {
         RespDTO<Boolean> respDTO = cdssCoreClient.saveOrUpdateRecord(klConceptStaticVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             success = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         return success;
     }
@@ -227,6 +237,8 @@ public class KlConceptStaticFacade {
         RespDTO<Boolean> respDTO = cdssCoreClient.changeStatus(changeStatusVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             success = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         return success;
     }
@@ -242,6 +254,8 @@ public class KlConceptStaticFacade {
         RespDTO<KlConceptStaticDTO> respDTO = cdssCoreClient.getRecordById(idVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             klConceptStaticDTO = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         return klConceptStaticDTO;
     }
@@ -257,6 +271,8 @@ public class KlConceptStaticFacade {
         RespDTO<Boolean> respDTO = cdssCoreClient.isExist(klConceptStaticVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
             exist = respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
         return exist;
     }