瀏覽代碼

评分优化

wangfeng 5 年之前
父節點
當前提交
4e38573faf

+ 17 - 0
mrman-service/src/main/java/com/diagbot/dto/AnalyzeMessageDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-06-19 10:47
+ */
+@Setter
+@Getter
+public class AnalyzeMessageDTO {
+    private List<String> messages;
+}

+ 12 - 3
mrman-service/src/main/java/com/diagbot/facade/StdBehospitalInfoFacade.java

@@ -3,7 +3,9 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.BehospitalInfoHystrixClient;
+import com.diagbot.dto.AnalyzeMessageDTO;
 import com.diagbot.dto.MedQcresultDetailAllDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SthospitalInfoFindDTO;
 import com.diagbot.dto.SthospitalInfoPageDTO;
 import com.diagbot.dto.SthospitalInfoStatiDTO;
@@ -32,6 +34,7 @@ import org.springframework.stereotype.Component;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author wangfeng
@@ -171,18 +174,24 @@ public class StdBehospitalInfoFacade extends StdBehospitalInfoServiceImpl {
         return stdBehospitalInfoService.getStatistic(sthospitalInfoStatiVO);
     }
 
-    public boolean analyze() {
+    public AnalyzeMessageDTO analyze() {
+        AnalyzeMessageDTO analyzeMessageDTO =  new AnalyzeMessageDTO();
         QueryWrapper<StdBehospitalInfo> stdBehospitalInfoQuery = new QueryWrapper<>();
         stdBehospitalInfoQuery.eq("is_deleted", IsDeleteEnum.N.getKey());
         List<StdBehospitalInfo> list = stdBehospitalInfoService.list(stdBehospitalInfoQuery);
+        List<String> messages = new ArrayList<>();
         if (ListUtil.isNotEmpty(list)) {
             for (StdBehospitalInfo data : list) {
                 AnalyzeApiVO analyzeApiVO = new AnalyzeApiVO();
                 analyzeApiVO.setBehospitalCode(data.getBehospitalCode());
                 analyzeApiVO.setHospitalId(data.getHospitalId());
-                behospitalInfoHystrixClient.analyzeApi(analyzeApiVO);
+                RespDTO<Map<String, Object>> mapRespDTO = behospitalInfoHystrixClient.analyzeApi(analyzeApiVO);
+                if(mapRespDTO.data == null){
+                    messages.add(mapRespDTO.msg+data.getBehospitalCode());
+                }
             }
         }
-        return true;
+        analyzeMessageDTO.setMessages(messages);
+        return analyzeMessageDTO;
     }
 }

+ 4 - 3
mrman-service/src/main/java/com/diagbot/web/StdBehospitalInfoController.java

@@ -3,6 +3,7 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.AnalyzeMessageDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SthospitalInfoFindDTO;
 import com.diagbot.dto.SthospitalInfoPageDTO;
@@ -93,8 +94,8 @@ public class StdBehospitalInfoController {
     @PostMapping("/analyze")
     @SysLogger("analyze")
     @Transactional
-    public RespDTO<Boolean> analyze() {
-        boolean res = stdBehospitalInfoFacade.analyze();
-        return RespDTO.onSuc(res);
+    public RespDTO<AnalyzeMessageDTO> analyze() {
+        AnalyzeMessageDTO data = stdBehospitalInfoFacade.analyze();
+        return RespDTO.onSuc(data);
     }
 }