Ver código fonte

Merge branch 'dev/diagbotcloud20191015_bi' into develop

# Conflicts:
#	knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
gaodm 5 anos atrás
pai
commit
1d14d41684
47 arquivos alterados com 2178 adições e 114 exclusões
  1. 5 0
      bi-service/pom.xml
  2. 31 0
      bi-service/src/main/java/com/diagbot/aggregate/BiAggregate.java
  3. 43 0
      bi-service/src/main/java/com/diagbot/aggregate/KnowledgemanAgg.java
  4. 49 0
      bi-service/src/main/java/com/diagbot/aggregate/NeoAgg.java
  5. 32 0
      bi-service/src/main/java/com/diagbot/aggregate/PrecmanAgg.java
  6. 14 0
      bi-service/src/main/java/com/diagbot/client/IcssmanServiceClient.java
  7. 24 0
      bi-service/src/main/java/com/diagbot/client/KnowledgemanServiceClient.java
  8. 19 0
      bi-service/src/main/java/com/diagbot/client/NeoServiceClient.java
  9. 19 0
      bi-service/src/main/java/com/diagbot/client/PrecmanServiceClient.java
  10. 16 0
      bi-service/src/main/java/com/diagbot/client/hystrix/IcssmanServiceHystrix.java
  11. 31 0
      bi-service/src/main/java/com/diagbot/client/hystrix/KnowledgemanServiceHystrix.java
  12. 24 0
      bi-service/src/main/java/com/diagbot/client/hystrix/NeoServiceHystrix.java
  13. 23 0
      bi-service/src/main/java/com/diagbot/client/hystrix/PrecmanServiceHystrix.java
  14. 0 1
      bi-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  15. 28 0
      bi-service/src/main/java/com/diagbot/dto/BIDTO.java
  16. 17 0
      bi-service/src/main/java/com/diagbot/dto/BIItemDTO.java
  17. 18 0
      bi-service/src/main/java/com/diagbot/dto/BIModuleDTO.java
  18. 18 0
      bi-service/src/main/java/com/diagbot/dto/PrecCountDTO.java
  19. 64 0
      bi-service/src/main/java/com/diagbot/enums/StatisticsDetailTypeEnum.java
  20. 58 0
      bi-service/src/main/java/com/diagbot/enums/StatisticsTypeEnum.java
  21. 243 0
      bi-service/src/main/java/com/diagbot/facade/StatisticsFacade.java
  22. 34 0
      bi-service/src/main/java/com/diagbot/web/StatisticsController.java
  23. 0 110
      bi-service/src/main/java/com/diagbot/web/SysLogController.java
  24. 5 0
      config-server/src/main/resources/shared/bi-service-dev.yml
  25. 5 0
      config-server/src/main/resources/shared/bi-service-local.yml
  26. 5 0
      config-server/src/main/resources/shared/bi-service-pro.yml
  27. 5 0
      config-server/src/main/resources/shared/bi-service-test.yml
  28. 1049 0
      docs/020.20191016BI数据统计/init_user.sql
  29. 2 0
      knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  30. 2 0
      knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  31. 17 0
      knowledgeman-service/src/main/java/com/diagbot/dto/BIItemDTO.java
  32. 18 1
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java
  33. 12 0
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  34. 9 1
      knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptDetailMapper.java
  35. 8 0
      knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptMapper.java
  36. 8 0
      knowledgeman-service/src/main/java/com/diagbot/service/ConceptDetailService.java
  37. 12 0
      knowledgeman-service/src/main/java/com/diagbot/service/impl/ConceptDetailServiceImpl.java
  38. 9 0
      knowledgeman-service/src/main/java/com/diagbot/web/ConceptController.java
  39. 12 1
      knowledgeman-service/src/main/java/com/diagbot/web/ConceptDetailController.java
  40. 36 0
      knowledgeman-service/src/main/resources/mapper/ConceptDetailMapper.xml
  41. 35 0
      knowledgeman-service/src/main/resources/mapper/ConceptMapper.xml
  42. 1 0
      precman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  43. 1 0
      precman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  44. 17 0
      precman-service/src/main/java/com/diagbot/dto/BIItemDTO.java
  45. 17 0
      precman-service/src/main/java/com/diagbot/dto/PrecCountDTO.java
  46. 40 0
      precman-service/src/main/java/com/diagbot/facade/CountFacade.java
  47. 43 0
      precman-service/src/main/java/com/diagbot/web/CountController.java

+ 5 - 0
bi-service/pom.xml

@@ -154,6 +154,11 @@
             <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 31 - 0
bi-service/src/main/java/com/diagbot/aggregate/BiAggregate.java

@@ -0,0 +1,31 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.util.ListUtil;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/10/16 13:37
+ */
+@Component
+public class BiAggregate {
+    @DataProvider("biAll")
+    public List<BIItemDTO> biAll(
+            @DataConsumer("conceptDetailBI") List<BIItemDTO> biItemDTOListA,
+            @DataConsumer("queryLibTypeCou") List<BIItemDTO> biItemDTOListB,
+            @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;
+    }
+}

+ 43 - 0
bi-service/src/main/java/com/diagbot/aggregate/KnowledgemanAgg.java

@@ -0,0 +1,43 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.client.KnowledgemanServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+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: gaodm
+ * @time: 2019/10/16 13:29
+ */
+@Component
+public class KnowledgemanAgg {
+    @Autowired
+    private KnowledgemanServiceClient knowledgemanServiceClient;
+
+    @DataProvider("conceptDetailBI")
+    public List<BIItemDTO> conceptDetailBI(){
+        List<BIItemDTO> biItemDTOList = Lists.newLinkedList();
+        RespDTO<List<BIItemDTO>> cdResp = knowledgemanServiceClient.conceptDetailBI();
+        if (RespDTOUtil.respIsOK(cdResp)) {
+            biItemDTOList.addAll(cdResp.data);
+        }
+        return biItemDTOList;
+    }
+
+    @DataProvider("queryLibTypeCou")
+    public List<BIItemDTO> queryLibTypeCou(){
+        List<BIItemDTO> biItemDTOList = Lists.newLinkedList();
+        RespDTO<List<BIItemDTO>> conceptResp = knowledgemanServiceClient.queryLibTypeCou();
+        if (RespDTOUtil.respIsOK(conceptResp)) {
+            biItemDTOList.addAll(conceptResp.data);
+        }
+        return biItemDTOList;
+    }
+}

+ 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;
+    }
+}

+ 32 - 0
bi-service/src/main/java/com/diagbot/aggregate/PrecmanAgg.java

@@ -0,0 +1,32 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.client.PrecmanServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+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: gaodm
+ * @time: 2019/10/16 13:35
+ */
+@Component
+public class PrecmanAgg {
+    @Autowired
+    private PrecmanServiceClient precmanServiceClient;
+    @DataProvider("precGetCount")
+    public List<BIItemDTO> precGetCount(){
+        List<BIItemDTO> biItemDTOList = Lists.newLinkedList();
+        RespDTO<BIItemDTO> precResp = precmanServiceClient.getCount();
+        if (RespDTOUtil.respIsOK(precResp)) {
+            biItemDTOList.add(precResp.data);
+        }
+        return biItemDTOList;
+    }
+}

+ 14 - 0
bi-service/src/main/java/com/diagbot/client/IcssmanServiceClient.java

@@ -0,0 +1,14 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.IcssmanServiceHystrix;
+import org.springframework.cloud.openfeign.FeignClient;
+
+/**
+ * @Description: 调用ICSS后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@FeignClient(value = "icssman-service", fallback = IcssmanServiceHystrix.class)
+public interface IcssmanServiceClient {
+
+}

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

@@ -0,0 +1,24 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.KnowledgemanServiceHystrix;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.PrecCountDTO;
+import com.diagbot.dto.RespDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @Description: 调用知识库后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@FeignClient(value = "knowledgeman-service", fallback = KnowledgemanServiceHystrix.class)
+public interface KnowledgemanServiceClient {
+    @PostMapping("/conceptDetail/conceptDetailBI")
+    RespDTO<List<BIItemDTO>> conceptDetailBI();
+
+    @PostMapping("/concept/queryLibTypeCou")
+    RespDTO<List<BIItemDTO>> queryLibTypeCou();
+}

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

@@ -0,0 +1,19 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.NeoServiceHystrix;
+import com.diagbot.dto.BIItemDTO;
+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();
+}

+ 19 - 0
bi-service/src/main/java/com/diagbot/client/PrecmanServiceClient.java

@@ -0,0 +1,19 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.PrecmanServiceHystrix;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @Description: 调用智能预问诊后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@FeignClient(value = "precman-service", fallback = PrecmanServiceHystrix.class)
+public interface PrecmanServiceClient {
+
+    @PostMapping("/count_prec/getCount")
+    RespDTO<BIItemDTO> getCount();
+}

+ 16 - 0
bi-service/src/main/java/com/diagbot/client/hystrix/IcssmanServiceHystrix.java

@@ -0,0 +1,16 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.IcssmanServiceClient;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 调用ICSS后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@Component
+@Slf4j
+public class IcssmanServiceHystrix implements IcssmanServiceClient {
+
+}

+ 31 - 0
bi-service/src/main/java/com/diagbot/client/hystrix/KnowledgemanServiceHystrix.java

@@ -0,0 +1,31 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.KnowledgemanServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.PrecCountDTO;
+import com.diagbot.dto.RespDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 调用知识库后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@Component
+@Slf4j
+public class KnowledgemanServiceHystrix implements KnowledgemanServiceClient {
+    @Override
+    public RespDTO<List<BIItemDTO>> conceptDetailBI() {
+        log.error("【hystrix】调用{}异常", "conceptDetailBI");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<BIItemDTO>> queryLibTypeCou() {
+        log.error("【hystrix】调用{}异常", "queryLibTypeCou");
+        return null;
+    }
+}

+ 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;
+    }
+}

+ 23 - 0
bi-service/src/main/java/com/diagbot/client/hystrix/PrecmanServiceHystrix.java

@@ -0,0 +1,23 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.PrecmanServiceClient;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 调用智能预问诊后台
+ * @author: gaodm
+ * @time: 2019/10/15 11:08
+ */
+@Component
+@Slf4j
+public class PrecmanServiceHystrix implements PrecmanServiceClient {
+
+    @Override
+    public RespDTO<BIItemDTO> getCount() {
+        log.error("【hystrix】调用{}异常", "getCount");
+        return null;
+    }
+}

+ 0 - 1
bi-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import java.util.List;
 import java.util.Map;
 
-
 /**
  * @Description: 调用用户服务
  * @author: gaodm

+ 28 - 0
bi-service/src/main/java/com/diagbot/dto/BIDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 16:30
+ */
+@Getter
+@Setter
+public class BIDTO {
+    private BIModuleDTO diagnose;
+    private BIModuleDTO symptom;
+    private BIModuleDTO vital;
+    private BIModuleDTO lis;
+    private BIModuleDTO pacs;
+    private BIModuleDTO drug;
+    private BIModuleDTO operation;
+    private BIModuleDTO gauge;
+    private BIModuleDTO prec;
+    private BIModuleDTO treat;
+    private BIModuleDTO conceptDetail;
+    private Date gmtOperate;
+}

+ 17 - 0
bi-service/src/main/java/com/diagbot/dto/BIItemDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 15:32
+ */
+@Getter
+@Setter
+public class BIItemDTO {
+    private String moduleName;
+    private String itemName;
+    private Integer count;
+}

+ 18 - 0
bi-service/src/main/java/com/diagbot/dto/BIModuleDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 16:30
+ */
+@Getter
+@Setter
+public class BIModuleDTO {
+    private String moduleName;
+    private List<BIItemDTO> items;
+}

+ 18 - 0
bi-service/src/main/java/com/diagbot/dto/PrecCountDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @description: 返回预问诊统计内容
+ * @author: zhoutg
+ * @date: 2019/10/15 14:22
+ */
+@Getter
+@Setter
+public class PrecCountDTO {
+
+    @ApiModelProperty(value = "症状数量")
+    private int symptomNum;
+}

+ 64 - 0
bi-service/src/main/java/com/diagbot/enums/StatisticsDetailTypeEnum.java

@@ -0,0 +1,64 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/22 10:23
+ */
+public enum StatisticsDetailTypeEnum implements KeyedNamed {
+    DiseaseCount(1, "疾病总数"),
+    NeoDiseaseCount(2, "图谱推送的疾病"),
+    NeoPediatricDiseaseCount(3, "图谱推送的儿科疾病"),
+    SymptomCount(4, "症状标准词"),
+    VitalResultCount(5, "体征结果"),
+    VitalIndexCount(6, "体征指标"),
+    LisPackageCount(7, "化验套餐"),
+    LisDetailCount(8, "化验明细"),
+    PacsItemCount(9, "辅检项目"),
+    DrugCount(10, "药品通用名"),
+    OperationCount(11, "手术项目"),
+    GaugeCount(12, "量表总数"),
+    PrecSymptomCount(13, "预问诊症状条目"),
+    TreatCount(14, "治疗数目"),
+    ConceptDetailCount(15, "静态知识总数"),
+    ConceptDetailDiseaseCount(16, "疾病"),
+    LisTableCount(17, "化验公表项");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    StatisticsDetailTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static StatisticsDetailTypeEnum getEnum(int key) {
+        for (StatisticsDetailTypeEnum item : StatisticsDetailTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        StatisticsDetailTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 58 - 0
bi-service/src/main/java/com/diagbot/enums/StatisticsTypeEnum.java

@@ -0,0 +1,58 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 17:00
+ */
+public enum StatisticsTypeEnum implements KeyedNamed {
+    DIAGNOSE(1, "疾病"),
+    SYMPTOM(2, "症状"),
+    VITAL(3, "体征"),
+    LIS(4, "化验"),
+    PACS(5, "辅检"),
+    DRUG(6, "药品"),
+    OPERATION(7, "手术"),
+    GAUGE(8, "量表"),
+    PREC(9, "智能预问诊"),
+    TREAT(10, "治疗"),
+    CONCEPT_DETAIL(11, "静态知识");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    StatisticsTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static StatisticsTypeEnum getEnum(int key) {
+        for (StatisticsTypeEnum item : StatisticsTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        StatisticsTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 243 - 0
bi-service/src/main/java/com/diagbot/facade/StatisticsFacade.java

@@ -0,0 +1,243 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.BIDTO;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.BIModuleDTO;
+import com.diagbot.enums.StatisticsDetailTypeEnum;
+import com.diagbot.enums.StatisticsTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.google.common.collect.Lists;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 16:23
+ */
+@Component
+public class StatisticsFacade {
+    @Autowired
+    DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
+
+    public BIDTO count() {
+        BIDTO bidto = new BIDTO();
+        List<BIItemDTO> biItemDTOList = ListUtil.newArrayList();
+        try {
+            biItemDTOList
+                    = dataBeanAggregateQueryFacade.get("biAll", null, List.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        Map<String, List<BIItemDTO>> map = EntityUtil.makeEntityListMap(biItemDTOList, "moduleName");
+        bidto.setDiagnose(getBIModuleDTO(map, StatisticsTypeEnum.DIAGNOSE.getKey()));
+        bidto.setSymptom(getBIModuleDTO(map, StatisticsTypeEnum.SYMPTOM.getKey()));
+        bidto.setVital(getBIModuleDTO(map, StatisticsTypeEnum.VITAL.getKey()));
+        bidto.setLis(getBIModuleDTO(map, StatisticsTypeEnum.LIS.getKey()));
+        bidto.setPacs(getBIModuleDTO(map, StatisticsTypeEnum.PACS.getKey()));
+        bidto.setDrug(getBIModuleDTO(map, StatisticsTypeEnum.DRUG.getKey()));
+        bidto.setOperation(getBIModuleDTO(map, StatisticsTypeEnum.OPERATION.getKey()));
+        bidto.setGauge(getBIModuleDTO(map, StatisticsTypeEnum.GAUGE.getKey()));
+        bidto.setPrec(getBIModuleDTO(map, StatisticsTypeEnum.PREC.getKey()));
+        bidto.setTreat(getBIModuleDTO(map, StatisticsTypeEnum.TREAT.getKey()));
+        bidto.setConceptDetail(getBIModuleDTO(map, StatisticsTypeEnum.CONCEPT_DETAIL.getKey()));
+        bidto.setGmtOperate(DateUtil.now());
+
+        return bidto;
+    }
+
+    public BIModuleDTO getBIModuleDTO(Map<String, List<BIItemDTO>> map, Integer key) {
+        BIModuleDTO biModuleDTO = new BIModuleDTO();
+        List<BIItemDTO> queryItemList = Lists.newLinkedList();
+        Map<String, BIItemDTO> biItemMap = new LinkedHashMap<>();
+        if (map.get(StatisticsTypeEnum.getName(key)) != null) {
+            List<BIItemDTO> biItemDTOList = map.get(StatisticsTypeEnum.getName(key));
+            biItemMap = EntityUtil.makeEntityMap(biItemDTOList, "itemName");
+        }
+        switch (StatisticsTypeEnum.getEnum(key)) {
+            case DIAGNOSE:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DiseaseCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DiseaseCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.DIAGNOSE.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DiseaseCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoDiseaseCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoDiseaseCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.DIAGNOSE.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoDiseaseCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoPediatricDiseaseCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoPediatricDiseaseCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.DIAGNOSE.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.NeoPediatricDiseaseCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case SYMPTOM:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.SymptomCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.SymptomCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.SYMPTOM.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.SymptomCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case VITAL:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalResultCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalResultCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.VITAL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalResultCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalIndexCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalIndexCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.VITAL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.VitalIndexCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case LIS:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisPackageCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisPackageCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.LIS.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisPackageCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisDetailCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisDetailCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.LIS.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisDetailCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case PACS:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.PACS.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case DRUG:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.DRUG.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case OPERATION:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.OperationCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.OperationCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.OPERATION.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.OperationCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case GAUGE:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.GaugeCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.GaugeCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.GAUGE.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.GaugeCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case PREC:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PrecSymptomCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PrecSymptomCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.PREC.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PrecSymptomCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case TREAT:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.TreatCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.TreatCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.TREAT.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.TreatCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            case CONCEPT_DETAIL:
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.CONCEPT_DETAIL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailDiseaseCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailDiseaseCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.CONCEPT_DETAIL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.ConceptDetailDiseaseCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisTableCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisTableCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.CONCEPT_DETAIL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.LisTableCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.CONCEPT_DETAIL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.PacsItemCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                if (biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey())) != null) {
+                    queryItemList.add(biItemMap.get(StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey())));
+                } else {
+                    BIItemDTO biItemDTO = getItem(StatisticsTypeEnum.getName(StatisticsTypeEnum.CONCEPT_DETAIL.getKey()),
+                            StatisticsDetailTypeEnum.getName(StatisticsDetailTypeEnum.DrugCount.getKey()), 0);
+                    queryItemList.add(biItemDTO);
+                }
+                break;
+            default:
+                biModuleDTO = null;
+                break;
+
+        }
+        if (biModuleDTO != null) {
+            biModuleDTO.setModuleName(StatisticsTypeEnum.getName(key));
+            biModuleDTO.setItems(queryItemList);
+        }
+        return biModuleDTO;
+    }
+
+
+    public BIItemDTO getItem(String moduleName, String itemName, Integer count) {
+        BIItemDTO biItemDTO = new BIItemDTO();
+        biItemDTO.setModuleName(moduleName);
+        biItemDTO.setItemName(itemName);
+        biItemDTO.setCount(count);
+        return biItemDTO;
+    }
+}

+ 34 - 0
bi-service/src/main/java/com/diagbot/web/StatisticsController.java

@@ -0,0 +1,34 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BIDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.StatisticsFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 17:33
+ */
+@RestController
+@RequestMapping("/statistics")
+@SuppressWarnings("unchecked")
+@Api(value = "BI-统计相关API", tags = { "BI-统计相关API" })
+public class StatisticsController {
+    @Autowired
+    StatisticsFacade statisticsFacade;
+
+    @ApiOperation(value = "数据统计[by:zhaops]", notes = "")
+    @PostMapping("/count")
+    @SysLogger("count")
+    public RespDTO<BIDTO> count() {
+        BIDTO data = statisticsFacade.count();
+        return RespDTO.onSuc(data);
+    }
+}

+ 0 - 110
bi-service/src/main/java/com/diagbot/web/SysLogController.java

@@ -1,110 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.SysLog;
-import com.diagbot.facade.SysLogFacade;
-import com.diagbot.vo.SysLogVo;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Date;
-
-/**
- * @Description: 日志操作控制层
- * @author: gaodm
- * @time: 2018/8/30 10:12
- */
-@RestController
-@RequestMapping("/log")
-public class SysLogController {
-
-    @Autowired
-    private SysLogFacade sysLogFacade;
-
-    /**
-     * 新增日志信息
-     *
-     * @param sysLogVo 新增日志输入参数
-     * @return 新增日志是否成功
-     */
-    @ApiOperation(value = "添加日志", notes = "添加日志")
-    @PostMapping("/add")
-    @SysLogger("postLog")
-    public RespDTO add(@RequestBody SysLogVo sysLogVo) {
-        //初始化新增日志信息
-        SysLog sysLog = new SysLog();
-        sysLog.setGmtCreate(new Date());
-        sysLog.setIp(sysLogVo.getIp());
-        sysLog.setMethod(sysLogVo.getMethod());
-        sysLog.setOperation(sysLogVo.getOperation());
-        sysLog.setParams(sysLogVo.getParams());
-        return RespDTO.onSuc(sysLogFacade.save(sysLog) ? "添加成功" : "添加失败");
-    }
-
-    /**
-     * 删除日志
-     *
-     * @param id 日志信息ID
-     * @return 删除是否成功
-     */
-    @ApiOperation(value = "删除日志", notes = "删除日志")
-    @DeleteMapping("/delete/{id}")
-    @SysLogger("deleteLog")
-    public RespDTO delete(@PathVariable(value = "id") Integer id) {
-        return RespDTO.onSuc(sysLogFacade.removeById(id) ? "删除成功" : "删除失败");
-    }
-
-    /**
-     * 修改日志
-     *
-     * @param sysLog 修改日志输入参数
-     * @return 修改是否成功
-     */
-    @ApiOperation(value = "修改日志", notes = "修改日志")
-    @PostMapping("/update")
-    @SysLogger("updateLog")
-    public RespDTO update(@RequestBody SysLog sysLog) {
-        return RespDTO.onSuc(sysLogFacade.updateById(sysLog) ? "修改成功" : "修改失败");
-    }
-
-    /**
-     * 获取日志列表
-     *
-     * @return 日志列信息
-     */
-    @ApiOperation(value = "获取日志列表", notes = "获取日志列表")
-    @GetMapping("/list")
-    @SysLogger("listLog")
-    public RespDTO list() {
-        Wrapper<SysLog> wrapper = new QueryWrapper<>();
-        return RespDTO.onSuc(sysLogFacade.list(wrapper));
-    }
-
-    /**
-     * 获取日志翻页信息
-     *
-     * @return 日志翻页信息
-     */
-    @ApiOperation(value = "获取日志翻页信息", notes = "获取日志翻页信息")
-    @GetMapping("/page")
-    @SysLogger("pageLog")
-    public RespDTO page() {
-        //初始化日志翻页参数
-        IPage<SysLog> wrapper = new Page<>();
-        return RespDTO.onSuc(sysLogFacade.page(wrapper, null));
-    }
-}
-

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

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

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

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

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

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

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

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

Diferenças do arquivo suprimidas por serem muito extensas
+ 1049 - 0
docs/020.20191016BI数据统计/init_user.sql


+ 2 - 0
knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -41,6 +41,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/versionInfo/getVersionInfoOuter").permitAll()
                 .antMatchers("/diagnose/initNeo").permitAll()
                 .antMatchers("/lisMapping/getUniqueNameWithList").permitAll()
+                .antMatchers("/conceptDetail/conceptDetailBI").permitAll()
+                .antMatchers("/concept/queryLibTypeCou").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 2 - 0
knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -104,6 +104,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/versionInfo/getVersionInfoOuter", request)
                 || matchers("/diagnose/initNeo", request)
                 || matchers("/lisMapping/getUniqueNameWithList", request)
+                || matchers("/conceptDetail/conceptDetailBI", request)
+                || matchers("/concept/queryLibTypeCou", request)
                 || matchers("/", request)) {
             return true;
         }

+ 17 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/BIItemDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 15:32
+ */
+@Getter
+@Setter
+public class BIItemDTO {
+    private String moduleName;
+    private String itemName;
+    private Integer count;
+}

+ 18 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
 import com.diagbot.dto.GetConceptDetailListDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Concept;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconTypeEnum;
@@ -16,6 +18,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.ConceptDetailService;
 import com.diagbot.service.impl.ConceptDetailServiceImpl;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddConceptDetailVO;
@@ -23,12 +26,15 @@ import com.diagbot.vo.ConceptIndexVO;
 import com.diagbot.vo.GetConceptDetailListVO;
 import com.diagbot.vo.GetConceptDetailVO;
 import com.diagbot.vo.RemoveConceptDetailVO;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
+import javax.swing.text.html.parser.Entity;
 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;
@@ -46,6 +52,8 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
     @Autowired
     @Qualifier("conceptDetailServiceImpl")
     private ConceptDetailService conceptDetailService;
+    @Autowired
+    private ConceptFacade conceptFacade;
 
     /**
      * 获取医学术语命名列表
@@ -165,4 +173,13 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
         return retList;
     }
 
-}
+    /**
+     * 静态知识数量统计
+     *
+     * @return
+     */
+    public List<BIItemDTO> conceptDetailBI() {
+        List<BIItemDTO> retList = conceptDetailService.conDetailCount();
+        return retList;
+    }
+}

+ 12 - 0
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.ICSSManServiceClient;
 import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.GetAllConceptDTO;
@@ -21,6 +22,7 @@ import com.diagbot.entity.Lexicon;
 import com.diagbot.entity.LibraryInfo;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.Relation;
+import com.diagbot.entity.ScaleContent;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.enums.DiseaseClassifyEnum;
 import com.diagbot.enums.IsDeleteEnum;
@@ -119,6 +121,8 @@ public class ConceptFacade extends ConceptServiceImpl {
     private LisMappingFacade lisMappingFacade;
     @Autowired
     private ICSSManServiceClient icssManServiceClient;
+    @Autowired
+    private ScaleContentFacade scaleContentFacade;
 
     /**
      * 获取所有化验公表项
@@ -1218,6 +1222,14 @@ public class ConceptFacade extends ConceptServiceImpl {
         }
     }
 
+    /**
+     * 知识库标准化-获取医学数据统计
+     * @return
+     */
+    public List<BIItemDTO> queryLibTypeCou(){
+        return this.baseMapper.queryLibTypeCou();
+    }
+
     /**
      * 根据概念Id列表获取概念列表Map
      *

+ 9 - 1
knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptDetailMapper.java

@@ -2,6 +2,7 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.GetConceptDetailListDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
@@ -32,5 +33,12 @@ public interface ConceptDetailMapper extends BaseMapper<ConceptDetail> {
 	 * @return
 	 */
 	public List<ConceptIndexDTO> index(ConceptIndexVO conceptIndexVO);
-   
+
+	/**
+	 * 统计
+	 *
+	 * @return
+	 */
+	public List<BIItemDTO> conDetailCount();
+
 }

+ 8 - 0
knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptMapper.java

@@ -2,6 +2,7 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptWithOrderRes;
@@ -15,6 +16,7 @@ import com.diagbot.vo.IndexLexiconVO;
 import com.diagbot.vo.IndexVO;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -69,5 +71,11 @@ public interface ConceptMapper extends BaseMapper<Concept> {
      * @return
      */
     List<ConceptBaseDTO> indexByLexicon(IndexLexiconVO indexLexiconVO);
+
+    /**
+     * 知识库标准化-获取医学数据统计
+     * @return
+     */
+    List<BIItemDTO> queryLibTypeCou();
     
 }

+ 8 - 0
knowledgeman-service/src/main/java/com/diagbot/service/ConceptDetailService.java

@@ -1,6 +1,7 @@
 package com.diagbot.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
 import com.diagbot.entity.ConceptDetail;
@@ -34,4 +35,11 @@ public interface ConceptDetailService extends IService<ConceptDetail> {
      * @return
      */
     public List<ConceptIndexDTO> index(ConceptIndexVO conceptIndexVO);
+
+    /**
+     * 统计
+     *
+     * @return
+     */
+    public List<BIItemDTO> conDetailCount();
 }

+ 12 - 0
knowledgeman-service/src/main/java/com/diagbot/service/impl/ConceptDetailServiceImpl.java

@@ -1,5 +1,6 @@
 package com.diagbot.service.impl;
 
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
 import com.diagbot.entity.ConceptDetail;
@@ -33,4 +34,15 @@ public class ConceptDetailServiceImpl extends ServiceImpl<ConceptDetailMapper, C
     public List<ConceptIndexDTO> index(ConceptIndexVO conceptIndexVO) {
         return baseMapper.index(conceptIndexVO);
     }
+
+
+    /**
+     * 统计
+     *
+     * @return
+     */
+    @Override
+    public List<BIItemDTO> conDetailCount() {
+        return baseMapper.conDetailCount();
+    }
 }

+ 9 - 0
knowledgeman-service/src/main/java/com/diagbot/web/ConceptController.java

@@ -2,6 +2,7 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.GetAllConceptDTO;
 import com.diagbot.dto.GetAllForRelationDTO;
@@ -112,6 +113,14 @@ public class ConceptController {
         return RespDTO.onSuc(conceptFacade.conceptInfoExcelIm(file));
     }
 
+    @ApiOperation(value = "知识库标准化-获取医学数据统计[by:rengb]")
+    @PostMapping("/queryLibTypeCou")
+    @SysLogger("queryLibTypeCou")
+    @ApiIgnore
+    public RespDTO<List<BIItemDTO>> queryLibTypeCou() {
+        return RespDTO.onSuc(conceptFacade.queryLibTypeCou());
+    }
+
     /**
      * 根据概念Id列表获取概念列表Map
      *

+ 12 - 1
knowledgeman-service/src/main/java/com/diagbot/web/ConceptDetailController.java

@@ -2,6 +2,7 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BIItemDTO;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptIndexDTO;
 import com.diagbot.dto.GetConceptDetailListDTO;
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
 import java.util.List;
@@ -79,4 +81,13 @@ public class ConceptDetailController {
         List<ConceptIndexDTO> data = conceptDetailFacade.indexFac(conceptIndexVO);
         return RespDTO.onSuc(data);
     }
-}
+
+    @ApiOperation(value = "数据统计-静态知识数据统计[by:zhaops]", notes = "")
+    @PostMapping("/conceptDetailBI")
+    @SysLogger("conceptDetailBI")
+    @ApiIgnore
+    public RespDTO<List<BIItemDTO>> conceptDetailBI() {
+        List<BIItemDTO> data = conceptDetailFacade.conceptDetailBI();
+        return RespDTO.onSuc(data);
+    }
+}

+ 36 - 0
knowledgeman-service/src/main/resources/mapper/ConceptDetailMapper.xml

@@ -60,4 +60,40 @@
         AND a.lib_type not in(12,13,14)
 		ORDER BY a.gmt_modified DESC
     </select>
+
+    <select id="conDetailCount" resultType="com.diagbot.dto.BIItemDTO">
+        SELECT
+            "静态知识" AS moduleName,
+            "静态知识总数" AS itemName,
+            count(DISTINCT kc.id) AS count
+        FROM
+            kl_concept kc,
+            kl_concept_detail kcd
+        WHERE
+            kc.is_deleted = 'N'
+            AND kcd.is_deleted = 'N'
+            AND kc.id = kcd.concept_id
+
+        UNION
+
+        SELECT DISTINCT
+            "静态知识" AS moduleName,
+            CASE
+            WHEN t2.lib_type = 18 THEN '疾病'
+            WHEN t2.lib_type = 46 THEN '化验公表项'
+            WHEN t2.lib_type = 16 THEN '辅检项目'
+            WHEN t2.lib_type = 10 THEN '药品通用名'
+            ELSE ''
+            END AS itemName,
+            COUNT(t2.id) AS count
+        FROM
+            (SELECT DISTINCT concept_id FROM kl_concept_detail WHERE is_deleted = "N") t1,
+            kl_concept t2
+        WHERE
+            t1.concept_id = t2.id
+            AND t2.is_deleted = "N"
+            AND t2.lib_type IN (18, 46, 16, 10)
+        GROUP BY
+            lib_type
+    </select>
 </mapper>

+ 35 - 0
knowledgeman-service/src/main/resources/mapper/ConceptMapper.xml

@@ -291,5 +291,40 @@
 		and (a.name like concat('%',#{name},'%')
 		or a.spell like concat('%',#{name},'%'))
 	</select>
+
+	<select id="queryLibTypeCou" parameterType="list" resultType="com.diagbot.dto.BIItemDTO">
+		SELECT
+		a.moduleName,
+		a.itemName,
+		CASE WHEN b.lib_type IS NULL THEN 0 else b.count END AS count
+		FROM
+		(SELECT
+		id,
+		CASE WHEN id=18 then '疾病'
+		WHEN id=1 THEN '症状'
+		WHEN id=35 OR id=33 THEN '体征'
+		WHEN id=12 OR id=13 THEN '化验'
+		WHEN id=16 THEN '辅检'
+		WHEN id=10 THEN '药品'
+		WHEN id=25 THEN '手术'
+		WHEN id=11 THEN '治疗'
+		ELSE '' END AS moduleName,
+		CASE WHEN id=18 THEN '疾病总数'
+		WHEN id=1 THEN '症状标准词'
+		WHEN id=25 THEN '手术项目'
+		WHEN id=11 THEN '治疗数目'
+		ELSE `name` END AS itemName
+		FROM kl_lexicon
+		WHERE id in (18,1,35,33,12,13,16,10,25,11)
+		) a
+		LEFT JOIN
+		(SELECT
+		lib_type,COUNT(id) AS count
+		FROM kl_concept
+		WHERE lib_type in (18,1,35,33,12,13,16,10,25,11)
+		AND is_deleted='N'
+		GROUP BY lib_type) b
+		ON a.id=b.lib_type
+	</select>
     
 </mapper>

+ 1 - 0
precman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -28,6 +28,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
                 .antMatchers("/file_prec/uploadImage").permitAll()
                 .antMatchers("/dictionaryInfo_prec/getList").permitAll()
+                .antMatchers("/count_prec/getCount").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
precman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -91,6 +91,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/hystrix/**", request)
                 || matchers("/file_prec/uploadImage", request)
                 || matchers("/dictionaryInfo_prec/getList", request)
+                || matchers("/count_prec/getCount", request)
                 || matchers("/", request)) {
             return true;
         }

+ 17 - 0
precman-service/src/main/java/com/diagbot/dto/BIItemDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/15 15:32
+ */
+@Getter
+@Setter
+public class BIItemDTO {
+    private String moduleName;
+    private String itemName;
+    private Integer count;
+}

+ 17 - 0
precman-service/src/main/java/com/diagbot/dto/PrecCountDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+/**
+ * @description: 返回预问诊统计内容
+ * @author: zhoutg
+ * @date: 2019/10/15 14:22
+ */
+@Getter
+@Setter
+public class PrecCountDTO {
+
+    @ApiModelProperty(value = "症状数量")
+    private int symptomNum;
+}

+ 40 - 0
precman-service/src/main/java/com/diagbot/facade/CountFacade.java

@@ -0,0 +1,40 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.QuestionTypeEnum;
+import com.diagbot.enums.TagTypeEnum;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class CountFacade {
+
+    @Autowired
+    QuestionFacade questionFacade;
+
+    /**
+     * 返回统计信息
+     *
+     * @return
+     */
+    public BIItemDTO getCount() {
+        BIItemDTO biItemDTO = new BIItemDTO();
+        int symptomNum = questionFacade.count(new QueryWrapper<QuestionInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("type", QuestionTypeEnum.Symptom.getKey())
+                .eq("tag_type", TagTypeEnum.T4.getKey())
+        );
+        biItemDTO.setModuleName("智能预问诊");
+        biItemDTO.setItemName("预问诊症状条目");
+        biItemDTO.setCount(symptomNum);
+        return biItemDTO;
+    }
+}

+ 43 - 0
precman-service/src/main/java/com/diagbot/web/CountController.java

@@ -0,0 +1,43 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.BIItemDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.CountFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * <p>
+ * 统计 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@RequestMapping("/count_prec")
+@RestController
+@SuppressWarnings("unchecked")
+@Api(value = "预问诊统计API", tags = { "预问诊统计API" })
+@ApiIgnore
+public class CountController {
+
+
+    @Autowired
+    CountFacade countFacade;
+
+    @ApiOperation(value = "返回预问诊统计信息[by:zhoutg]",
+            notes = "")
+    @PostMapping("/getCount")
+    @SysLogger("getCount")
+    public RespDTO<BIItemDTO> getCount() {
+        BIItemDTO data = countFacade.getCount();
+        return RespDTO.onSuc(data);
+    }
+}