فهرست منبع

图谱数据统计

zhaops 5 سال پیش
والد
کامیت
5f29ad2889

+ 3 - 1
bi-service/src/main/java/com/diagbot/aggregate/BiAggregate.java

@@ -19,11 +19,13 @@ public class BiAggregate {
     public List<BIItemDTO> biAll(
             @DataConsumer("conceptDetailBI") List<BIItemDTO> biItemDTOListA,
             @DataConsumer("queryLibTypeCou") List<BIItemDTO> biItemDTOListB,
-            @DataConsumer("precGetCount") List<BIItemDTO> biItemDTOListC){
+            @DataConsumer("precGetCount") List<BIItemDTO> biItemDTOListC,
+            @DataConsumer("neoStatistics") List<BIItemDTO> biItemDTOListD) {
         List<BIItemDTO> res = ListUtil.newArrayList();
         res.addAll(biItemDTOListA);
         res.addAll(biItemDTOListB);
         res.addAll(biItemDTOListC);
+        res.addAll(biItemDTOListD);
         return res;
     }
 }

+ 49 - 0
bi-service/src/main/java/com/diagbot/aggregate/NeoAgg.java

@@ -0,0 +1,49 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.client.NeoServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.google.common.collect.Lists;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/17 10:26
+ */
+@Component
+public class NeoAgg {
+    @Autowired
+    private NeoServiceClient neoServiceClient;
+
+    @DataProvider("neoStatistics")
+    public List<BIItemDTO> neoStatistics() {
+        List<BIItemDTO> biItemDTOList = neoServiceClient.neoStatistics();
+        if (ListUtil.isEmpty(biItemDTOList)) {
+            BIItemDTO disease = new BIItemDTO();
+            disease.setModuleName("疾病");
+            disease.setItemName("图谱推送的疾病");
+            disease.setCount(0);
+            biItemDTOList.add(disease);
+
+            BIItemDTO diseaseForChild = new BIItemDTO();
+            diseaseForChild.setModuleName("疾病");
+            diseaseForChild.setItemName("图谱推送的儿科疾病");
+            diseaseForChild.setCount(0);
+            biItemDTOList.add(diseaseForChild);
+
+            BIItemDTO gauge = new BIItemDTO();
+            gauge.setModuleName("量表");
+            gauge.setItemName("量表总数");
+            gauge.setCount(0);
+            biItemDTOList.add(diseaseForChild);
+        }
+        return biItemDTOList;
+    }
+}

+ 20 - 0
bi-service/src/main/java/com/diagbot/client/NeoServiceClient.java

@@ -0,0 +1,20 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.NeoServiceHystrix;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @Description:图谱服务
+ * @Author:zhaops
+ * @time: 2019/10/17 10:21
+ */
+@FeignClient(name = "neo", url = "${neo.server.address}", fallback = NeoServiceHystrix.class)
+public interface NeoServiceClient {
+    @PostMapping("/knowledge/neoStatistics")
+    List<BIItemDTO> neoStatistics();
+}

+ 24 - 0
bi-service/src/main/java/com/diagbot/client/hystrix/NeoServiceHystrix.java

@@ -0,0 +1,24 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.NeoServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:图谱服务
+ * @Author:zhaops
+ * @time: 2019/10/17 10:21
+ */
+@Component
+@Slf4j
+public class NeoServiceHystrix implements NeoServiceClient {
+    @Override
+    public List<BIItemDTO> neoStatistics() {
+        log.error("【hystrix】调用{}异常", "neoStatistics");
+        return null;
+    }
+}

+ 5 - 1
config-server/src/main/resources/shared/bi-service-dev.yml

@@ -95,4 +95,8 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-io.github.lvyahui8.spring.base-packages: com.diagbot.aggregate
+io.github.lvyahui8.spring.base-packages: com.diagbot.aggregate
+
+neo:
+  server:
+    address: http://192.168.2.234:5004

+ 4 - 0
config-server/src/main/resources/shared/bi-service-local.yml

@@ -96,3 +96,7 @@ mybatis-plus:
     cache-enabled: false
 
 io.github.lvyahui8.spring.base-packages: com.diagbot.aggregate
+
+neo:
+  server:
+    address: http://192.168.2.234:5004

+ 4 - 0
config-server/src/main/resources/shared/bi-service-pro.yml

@@ -96,3 +96,7 @@ mybatis-plus:
     cache-enabled: false
 
 io.github.lvyahui8.spring.base-packages: com.diagbot.aggregate
+
+neo:
+  server:
+    address: http://192.168.2.234:5004

+ 4 - 0
config-server/src/main/resources/shared/bi-service-test.yml

@@ -96,3 +96,7 @@ mybatis-plus:
     cache-enabled: false
 
 io.github.lvyahui8.spring.base-packages: com.diagbot.aggregate
+
+neo:
+  server:
+    address: http://192.168.2.241:5004