Bläddra i källkod

Merge remote-tracking branch 'origin/dev/knowledge' into debug

MarkHuang 6 år sedan
förälder
incheckning
8014b97441
100 ändrade filer med 5041 tillägg och 125 borttagningar
  1. 25 0
      aipt-service/.gitignore
  2. 184 0
      aipt-service/pom.xml
  3. 34 0
      aipt-service/src/main/java/com/diagbot/AiptServiceApplication.java
  4. 76 0
      aipt-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  5. 20 0
      aipt-service/src/main/java/com/diagbot/client/AIServiceClient.java
  6. 53 0
      aipt-service/src/main/java/com/diagbot/client/AlgorithmClassify.java
  7. 202 0
      aipt-service/src/main/java/com/diagbot/client/Feature.java
  8. 25 0
      aipt-service/src/main/java/com/diagbot/client/UserServiceClient.java
  9. 159 0
      aipt-service/src/main/java/com/diagbot/client/bean/Constants.java
  10. 43 0
      aipt-service/src/main/java/com/diagbot/client/bean/FeatureRate.java
  11. 190 0
      aipt-service/src/main/java/com/diagbot/client/bean/Response.java
  12. 98 0
      aipt-service/src/main/java/com/diagbot/client/bean/ResponseData.java
  13. 273 0
      aipt-service/src/main/java/com/diagbot/client/bean/SearchData.java
  14. 132 0
      aipt-service/src/main/java/com/diagbot/client/bean/Status.java
  15. 23 0
      aipt-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java
  16. 23 0
      aipt-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  17. 19 0
      aipt-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java
  18. 15 0
      aipt-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java
  19. 48 0
      aipt-service/src/main/java/com/diagbot/config/JwtConfigurer.java
  20. 29 0
      aipt-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  21. 42 0
      aipt-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  22. 69 0
      aipt-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java
  23. 79 0
      aipt-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  24. 29 0
      aipt-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java
  25. 79 0
      aipt-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  26. 40 0
      aipt-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java
  27. 22 0
      aipt-service/src/main/java/com/diagbot/dto/LisResult.java
  28. 196 0
      aipt-service/src/main/java/com/diagbot/entity/SysLog.java
  29. 142 0
      aipt-service/src/main/java/com/diagbot/entity/User.java
  30. 81 0
      aipt-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java
  31. 53 0
      aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java
  32. 13 0
      aipt-service/src/main/java/com/diagbot/facade/SysLogFacade.java
  33. 16 0
      aipt-service/src/main/java/com/diagbot/mapper/SysLogMapper.java
  34. 23 0
      aipt-service/src/main/java/com/diagbot/rabbit/MyProcessor.java
  35. 27 0
      aipt-service/src/main/java/com/diagbot/rabbit/MySender.java
  36. 15 0
      aipt-service/src/main/java/com/diagbot/service/SysLogService.java
  37. 19 0
      aipt-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java
  38. 64 0
      aipt-service/src/main/java/com/diagbot/vo/SearchVo.java
  39. 21 0
      aipt-service/src/main/java/com/diagbot/vo/SysLogVo.java
  40. 56 0
      aipt-service/src/main/java/com/diagbot/web/ClinicalController.java
  41. 110 0
      aipt-service/src/main/java/com/diagbot/web/SysLogController.java
  42. 23 0
      aipt-service/src/main/java/com/diagbot/web/TestController.java
  43. 19 0
      aipt-service/src/main/resources/bootstrap.yml
  44. 280 0
      aipt-service/src/main/resources/logback-spring.xml
  45. 22 0
      aipt-service/src/main/resources/mapper/SysLogMapper.xml
  46. 9 0
      aipt-service/src/main/resources/public.cert
  47. 1 1
      knowledgeman-service/src/test/java/com/diagbot/KnowledgeServiceApplicationTests.java
  48. 83 0
      aipt-service/src/test/java/com/diagbot/CodeGeneration.java
  49. 3 2
      common/src/main/java/com/diagbot/enums/SysTypeEnum.java
  50. 97 0
      config-server/src/main/resources/shared/aipt-service-dev.yml
  51. 97 0
      config-server/src/main/resources/shared/aipt-service-local.yml
  52. 97 0
      config-server/src/main/resources/shared/aipt-service-pro.yml
  53. 97 0
      config-server/src/main/resources/shared/aipt-service-test.yml
  54. 14 0
      config-server/src/main/resources/shared/gateway-service-dev.yml
  55. 14 0
      config-server/src/main/resources/shared/gateway-service-local.yml
  56. 14 1
      config-server/src/main/resources/shared/gateway-service-pro.yml
  57. 14 0
      config-server/src/main/resources/shared/gateway-service-test.yml
  58. 9 1
      config-server/src/main/resources/shared/icss-service-dev.yml
  59. 9 1
      config-server/src/main/resources/shared/icss-service-local.yml
  60. 9 1
      config-server/src/main/resources/shared/icss-service-pro.yml
  61. 9 1
      config-server/src/main/resources/shared/icss-service-test.yml
  62. 6 0
      config-server/src/main/resources/shared/knowledgeman-service-dev.yml
  63. 6 0
      config-server/src/main/resources/shared/knowledgeman-service-local.yml
  64. 6 0
      config-server/src/main/resources/shared/knowledgeman-service-pro.yml
  65. 6 0
      config-server/src/main/resources/shared/knowledgeman-service-test.yml
  66. 94 0
      config-server/src/main/resources/shared/tran-service-dev.yml
  67. 94 0
      config-server/src/main/resources/shared/tran-service-local.yml
  68. 94 0
      config-server/src/main/resources/shared/tran-service-pro.yml
  69. 94 0
      config-server/src/main/resources/shared/tran-service-test.yml
  70. 12 0
      docker-compose.yml
  71. 1 1
      icss-service/src/main/java/com/diagbot/client/AIServiceClient.java
  72. 4 5
      icss-service/src/main/java/com/diagbot/client/HighRiskServiceClient.java
  73. 21 0
      icss-service/src/main/java/com/diagbot/client/SymptomFeatureClient.java
  74. 133 0
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java
  75. 3 1
      icss-service/src/main/java/com/diagbot/client/bean/MedicitionClass.java
  76. 2 3
      icss-service/src/main/java/com/diagbot/client/hystrix/HighRiskServiceHystrix.java
  77. 26 0
      icss-service/src/main/java/com/diagbot/client/hystrix/SymptomFeatureHystrix.java
  78. 112 0
      icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  79. 15 0
      icss-service/src/main/java/com/diagbot/dto/GetDiseaseIcdDTO.java
  80. 0 3
      icss-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java
  81. 15 0
      icss-service/src/main/java/com/diagbot/dto/HospitalDeptInfoDTO.java
  82. 1 1
      icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  83. 17 0
      icss-service/src/main/java/com/diagbot/dto/SymptomFeatureDTO.java
  84. 1 0
      icss-service/src/main/java/com/diagbot/dto/TemplateInfoDTO.java
  85. 170 0
      icss-service/src/main/java/com/diagbot/entity/DiseaseIcd.java
  86. 2 2
      icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  87. 15 1
      icss-service/src/main/java/com/diagbot/entity/TemplateInfo.java
  88. 16 8
      icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java
  89. 37 8
      icss-service/src/main/java/com/diagbot/facade/DoctorInfoFacade.java
  90. 65 0
      icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java
  91. 29 2
      icss-service/src/main/java/com/diagbot/facade/HospitalDeptFacade.java
  92. 31 17
      icss-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java
  93. 14 9
      icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  94. 34 21
      icss-service/src/main/java/com/diagbot/facade/LisExcelResFacade.java
  95. 41 25
      icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  96. 4 2
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  97. 6 4
      icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  98. 21 3
      icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java
  99. 6 1
      icss-service/src/main/java/com/diagbot/facade/TemplateInfoFacade.java
  100. 0 0
      icss-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java

+ 25 - 0
aipt-service/.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 184 - 0
aipt-service/pom.xml

@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.diagbot</groupId>
+    <artifactId>aipt-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>aipt-service</name>
+    <description>AI pre-treatment Service for Spring Boot</description>
+
+    <parent>
+        <groupId>com.diagbot</groupId>
+        <artifactId>diagbotcloud</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.diagbot</groupId>
+            <artifactId>common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+
+        <!-- 配置-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+
+        <!-- 开启web-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+
+        <!-- 开启feign-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <!-- dashboard -->
+        <!-- actuator-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!--hystrix-dashboard-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
+        </dependency>
+        <!--hystrix -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+
+        <!-- zipkin-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+
+        <!--swagger-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+        <!--database-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!--security-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-oauth2</artifactId>
+        </dependency>
+
+        <!-- mq -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus begin -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <!-- mybatis-plus end -->
+
+        <!-- 阿里巴巴druid数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- springboot整合mybatis(核心就这一个) -->
+        <!-- 注意顺序,这个一定要放在最下面 -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <!-- 添加docker-maven插件 -->
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <configuration>
+                    <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
+                    <forceTags>true</forceTags>
+                    <!--镜像的FROM,使用压缩的小镜像-->
+                    <baseImage>frolvlad/alpine-oraclejdk8:slim</baseImage>
+                    <entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>
+                    <resources>
+                        <resource>
+                            <targetPath>/</targetPath>
+                            <directory>${project.build.directory}</directory>
+                            <include>${project.build.finalName}.jar</include>
+                        </resource>
+                    </resources>
+                    <serverId>docker-registry</serverId>
+                    <registryUrl>http://192.168.2.236:5000/repository/diagbotcloud/</registryUrl>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 34 - 0
aipt-service/src/main/java/com/diagbot/AiptServiceApplication.java

@@ -0,0 +1,34 @@
+package com.diagbot;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @Description: BI服务启动文件
+ * @author: gaodm
+ * @time: 2018/8/7 9:24
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
+        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class })
+@EnableEurekaClient
+@EnableFeignClients({ "com.diagbot.client" })
+@EnableHystrixDashboard
+@EnableHystrix
+@EnableCircuitBreaker
+@RefreshScope
+public class AiptServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(AiptServiceApplication.class, args);
+    }
+}

+ 76 - 0
aipt-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java

@@ -0,0 +1,76 @@
+package com.diagbot.aop;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.entity.SysLog;
+import com.diagbot.enums.SysTypeEnum;
+import com.diagbot.rabbit.MySender;
+import com.diagbot.util.GsonUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+
+/**
+ * @Description: 日志拦截切面
+ * @author: gaodm
+ * @time: 2018/8/2 13:36
+ */
+@Aspect
+@Component
+public class SysLoggerAspect {
+    @Autowired
+    private MySender mySender;
+
+    @Pointcut("@annotation(com.diagbot.annotation.SysLogger)")
+    public void loggerPointCut() {
+
+    }
+
+    @Before("loggerPointCut()")
+    public void saveSysLog(JoinPoint joinPoint) {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+
+        SysLog sysLog = new SysLog();
+        SysLogger sysLogger = method.getAnnotation(SysLogger.class);
+        if (sysLogger != null) {
+            //注解上的描述
+            sysLog.setOperation(sysLogger.value());
+        }
+        //请求的方法名
+        String className = joinPoint.getTarget().getClass().getName();
+        String methodName = signature.getName();
+        sysLog.setMethod(className + "." + methodName + "()");
+        //请求的参数
+        Object[] args = joinPoint.getArgs();
+        String params = "";
+        for (Object o : args) {
+            params += GsonUtil.toJson(o);
+        }
+        if (!StringUtil.isEmpty(params)) {
+            sysLog.setParams(params);
+        }
+        //设置IP地址
+        sysLog.setIp(HttpUtils.getIpAddress());
+        //用户名
+        String username = UserUtils.getCurrentPrinciple();
+        if (!StringUtil.isEmpty(username)) {
+            sysLog.setUsername(username);
+        }
+        sysLog.setGmtCreate(new Date());
+        sysLog.setSysType(SysTypeEnum.AIPT_SERVICE.getKey());
+        //保存系统日志
+        mySender.outputLogSend(sysLog);
+    }
+
+}
+

+ 20 - 0
aipt-service/src/main/java/com/diagbot/client/AIServiceClient.java

@@ -0,0 +1,20 @@
+package com.diagbot.client;
+
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.vo.SearchVo;
+import com.diagbot.client.hystrix.AIServiceHystrix;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@FeignClient(name = "AI", url = "${ai.server.address}", fallback = AIServiceHystrix.class)
+public interface AIServiceClient {
+    @PostMapping(value = "/push-web/algorithm/neural")
+    Response<ResponseData> bayesPageData(@RequestBody SearchVo searchVo);
+}

+ 53 - 0
aipt-service/src/main/java/com/diagbot/client/AlgorithmClassify.java

@@ -0,0 +1,53 @@
+package com.diagbot.client;
+
+/**
+ * @Auther: fyeman
+ * @Date: 2018/7/19/019 10:37
+ * @Description:
+ */
+public enum AlgorithmClassify {
+    NEURAL("0"), BAYES("1"), EMERGENCY_NEURAL("2"), OUTPATIENT_NEURAL("3"),
+    NEURAL_SYMPTOM("11"),
+    NEURAL_DIAG("21"),
+    NEURAL_VITAL("31"),
+    NEURAL_LIS("41"),
+    NEURAL_PACS("51"),
+    NEURAL_DIAG_SYMPTOM("111"),
+    NEURAL_DIAG_VITAL("131"),
+    NEURAL_DIAG_LIS("141"),
+    NEURAL_DIAG_PACS("151");
+
+    private String value;
+
+    AlgorithmClassify(String value) {
+        this.value = value;
+    }
+
+    public String toString() {
+        return value;
+    }
+
+    public static AlgorithmClassify parse(String value) {
+        switch (value) {
+            case "11":
+                return AlgorithmClassify.NEURAL_SYMPTOM;
+            case "21":
+                return AlgorithmClassify.NEURAL_DIAG;
+            case "31":
+                return AlgorithmClassify.NEURAL_VITAL;
+            case "41":
+                return AlgorithmClassify.NEURAL_LIS;
+            case "51":
+                return AlgorithmClassify.NEURAL_PACS;
+            case "111":
+                return AlgorithmClassify.NEURAL_DIAG_SYMPTOM;
+            case "131":
+                return AlgorithmClassify.NEURAL_DIAG_VITAL;
+            case "141":
+                return AlgorithmClassify.NEURAL_DIAG_LIS;
+            case "151":
+                return AlgorithmClassify.NEURAL_DIAG_PACS;
+        }
+        return AlgorithmClassify.NEURAL_DIAG;
+    }
+}

+ 202 - 0
aipt-service/src/main/java/com/diagbot/client/Feature.java

@@ -0,0 +1,202 @@
+package com.diagbot.client;
+
+import java.io.Serializable;
+
+/**
+ * @Title: Feature.java
+ * @Package: com.zjlantone.nlp.web.doc.dao.model
+ * @Description: 数据库操作接口类
+ * @author: 楼辉荣
+ * @date: 2016年8月8日 下午17:16:23
+ * @version: V1.0
+ */
+
+@SuppressWarnings("serial")
+public class Feature implements Serializable {
+    /****/
+    private Long id;
+    /****/
+    private String rdn = "";
+    /****/
+    private String sex;
+    /****/
+    private int age;
+
+    private String partbody = "";
+
+    /****/
+    private String featureName = "";
+
+    /****/
+    private String featureType = "";
+
+    //是否推送
+    private String isPush = "0";
+
+    /**
+     * 特征顺序号
+     **/
+    private int sn;
+
+    /****/
+    private String negative = "";
+
+    private float duration;
+
+    private String property;
+
+    /****/
+    private Float threshold;
+
+    /****/
+    private String tfIdf;
+
+    /**
+     * 区分住院门诊
+     **/
+    private String resourceType;
+
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setRdn(String rdn) {
+        this.rdn = rdn;
+    }
+
+    public String getRdn() {
+        return this.rdn;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSex() {
+        return this.sex;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public int getAge() {
+        return this.age;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getFeatureName() {
+        return this.featureName;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String getFeatureType() {
+        return this.featureType;
+    }
+
+    public String getIsPush() {
+        return isPush;
+    }
+
+    public void setIsPush(String isPush) {
+        this.isPush = isPush;
+    }
+
+    public int getSn() {
+        return sn;
+    }
+
+    public void setSn(int sn) {
+        this.sn = sn;
+    }
+
+    public void setNegative(String negative) {
+        this.negative = negative;
+    }
+
+    public String getNegative() {
+        return this.negative;
+    }
+
+    public String getPartbody() {
+        return partbody;
+    }
+
+    public void setPartbody(String partbody) {
+        this.partbody = partbody;
+    }
+
+    public float getDuration() {
+        return duration;
+    }
+
+    public void setDuration(float duration) {
+        this.duration = duration;
+    }
+
+    public String getProperty() {
+        return property;
+    }
+
+    public void setProperty(String property) {
+        this.property = property;
+    }
+
+    public void setThreshold(Float threshold) {
+        this.threshold = threshold;
+    }
+
+    public Float getThreshold() {
+        return this.threshold;
+    }
+
+    public void setTfIdf(String tfIdf) {
+        this.tfIdf = tfIdf;
+    }
+
+    public String getTfIdf() {
+        return this.tfIdf;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Feature feature = (Feature) o;
+        if (id != feature.id) {
+            return false;
+        }
+        return rdn.equals(feature.rdn) && partbody.equals(feature.partbody) && featureName.equals(feature.featureName)
+                && featureType.equals(feature.featureType) && negative.equals(feature.negative);
+    }
+
+    @Override
+    public int hashCode() {
+        int result = id.hashCode();
+        result = 31 * result + rdn.hashCode() + partbody.hashCode() + featureName.hashCode() + featureType.hashCode() + negative.hashCode();
+        return result;
+    }
+}

+ 25 - 0
aipt-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -0,0 +1,25 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.UserServiceHystrix;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.User;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+
+
+/**
+ * @Description: 调用用户服务
+ * @author: gaodm
+ * @time: 2018/8/6 9:52
+ */
+@FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
+public interface UserServiceClient {
+
+    @PostMapping(value = "/user/{username}")
+    RespDTO<User> getUser(@RequestHeader(value = "Authorization") String token, @PathVariable("username") String username);
+}
+
+
+

+ 159 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Constants.java

@@ -0,0 +1,159 @@
+/**
+ * @Company: 杭州朗通信息技术有限公司
+ * @Department: 系统软件部
+ * @Description: 朗通智能辅助诊疗系统
+ * @Address: 浙江省杭州市西湖区西斗门路3号 天堂软件园D-7B
+ */
+package com.diagbot.client.bean;
+
+/**
+ * @Title: Constants.java
+ * @Package org.diagbot.public
+ * @Description: 通用常数接口定义
+ * @author 楼辉荣(Fyeman)
+ * @date 2015年4月23日 下午11:25:37
+ * @version V1.0
+ */
+public interface Constants {
+    /**
+     * 操作名称
+     */
+    String OP_NAME = "op";
+    /**
+     * 消息key
+     */
+    String MESSAGE = "message";
+    /**
+     * 错误key
+     */
+    String ERROR = "error";
+    /**
+     * 上个页面地址
+     */
+    String BACK_URL = "BackURL";
+    String IGNORE_BACK_URL = "ignoreBackURL";
+    /**
+     * 当前请求的地址 带参数
+     */
+    String CURRENT_URL = "currentURL";
+    /**
+     * 当前请求的地址 不带参数
+     */
+    String NO_QUERYSTRING_CURRENT_URL = "noQueryStringCurrentURL";
+    /**
+     * 上下文
+     */
+    String CONTEXT_PATH = "ctx";
+    /**
+     * 当前登录的用户
+     */
+    String CURRENT_APPLICATION = "c_app";
+    String CURRENT_USER = "c_user";
+    String CURRENT_USERNAME = "username";
+    String USER_MENUS = "menus";
+
+    /**
+     * 管理控制台应用ID=0
+     */
+    long ADMIN_APPLICATION = 0;
+    /**
+     * 一级菜单grade标识
+     */
+    int FIRST_MENU = 1;
+    /**
+     * 二级菜单grade标识
+     */
+    int SECOND_MENU = 2;
+    /**
+     * 操作按钮等级标识
+     */
+    int MENU_GRADE = 3;
+    /**
+     * 最高级资源grade标识
+     */
+    int TOP_REC = 0;
+    /**
+     * 编码方式
+     */
+    String ENCODING = "UTF-8";
+    /**
+     * 系统用户状态--启用
+     */
+    int USER_STATUS_UNLOCK = 1;
+    /**
+     * 系统用户状态--禁用
+     */
+    int USER_STATUS_LOCK = 0;
+    /**
+     * 通用值0
+     */
+    int COMMON_INT_0 = 0;
+    /**
+     * 通用值1
+     */
+    int COMMON_INT_1 = 1;
+    /**
+     * 通用值-1
+     */
+    int COMMON_INT_NEG_1 = -1;
+    /**
+     * 通用值0
+     */
+    long COMMON_LONG_0 = 0L;
+    /**
+     * 通用值1
+     */
+    long COMMON_LONG_1 = 1L;
+    /**
+     * 通用值-1
+     */
+    long COMMON_LONG_NEG_1 = -1L;
+    /**
+     * 通用值"0"
+     */
+    String COMMON_STRING_0 = "0";
+    /**
+     * 通用值"1"
+     */
+    String COMMON_STRING_1 = "1";
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_NEG_1 = "-1";
+
+    /**
+     * 通用值"-1"
+     */
+    String COMMON_STRING_99 = "99";
+    /**
+     * 登录页面
+     */
+    String LOGIN_URL = "/login";
+    /**
+     * 上传文件夹
+     */
+    String UPLOAD_FOLDER_NAME = "upload";
+    /**
+     * 临时文件夹
+     */
+    String TEMP_FOLDER_NAME = "temp";
+    /**
+     * 地域标示
+     */
+    public static final String DEFAULT_LOCALE = "zh_CN";
+    /**
+     * 缺省字符集
+     */
+    public static final String DEFAULT_ENCODE = "UTF-8";
+    /**
+     * 以下为接口返回公共属性定义常量
+     */
+    public static final String MSG_SUCCESS = "操作成功";    //操作成功
+    public static final String MSG_FALURE = "操作失败";    //操作失败
+
+    public static final long INVALIDATE_VALUE = -1;        //起止时间定义
+    public static final int RET_SUCCESS = 0;            //成功
+    public static final int RET_FAIL = 1;                //失败
+    public static final int RET_ERROR_PARAM = -1;        //参数校验失败
+    public static final int RET_NO_TOKEN = -2;    //用户token丢失
+}

+ 43 - 0
aipt-service/src/main/java/com/diagbot/client/bean/FeatureRate.java

@@ -0,0 +1,43 @@
+package com.diagbot.client.bean;
+
+/**
+ * Created by fyeman on 2018/1/17.
+ */
+public class FeatureRate {
+    private String featureName;
+    private String extraProperty;
+    private String desc;
+    private String rate;
+
+    public String getFeatureName() {
+        return featureName;
+    }
+
+    public void setFeatureName(String featureName) {
+        this.featureName = featureName;
+    }
+
+    public String getRate() {
+        return rate;
+    }
+
+    public void setRate(String rate) {
+        this.rate = rate;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public String getExtraProperty() {
+        return extraProperty;
+    }
+
+    public void setExtraProperty(String extraProperty) {
+        this.extraProperty = extraProperty;
+    }
+}

+ 190 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Response.java

@@ -0,0 +1,190 @@
+package com.diagbot.client.bean;
+
+/**
+ * ClassName: org.diagbot.pub.api.Response
+ * Function: API接口提供标准返回数据包, 数据包格式如下:
+ * {
+ * status:"OK",
+ * startTime:8206448610408,
+ * endTime:8206448610418,
+ * version:"1.0",
+ * msg:"操作成功",
+ * ret:"0",
+ * timeConsum:10,
+ * data:{
+ * ..。
+ * }
+ * }
+ * date: 2015年7月6日 下午1:36:58
+ *
+ * @author 楼辉荣(Fyeman)
+ * @version 1.0
+ * @since JDK 1.7
+ */
+public class Response<T> implements java.io.Serializable {
+    private static final long serialVersionUID = 8206448610408409499L;
+    private Status status = Status.PENDING;  //状态
+    private long startTime = Constants.INVALIDATE_VALUE;                                  //起始时间
+    private long endTime = Constants.INVALIDATE_VALUE;                                    //结束时间
+    private String version = "1.0";
+    private String msg = Constants.MSG_SUCCESS;                                  //消息
+    private T data = null;                                                                //序列化后的结果数据
+    // 返回结果标志,默认成功0,失败 1 参数错误 -1 token丢失-2
+    private int ret = Constants.RET_SUCCESS;
+
+    private String token;
+    //耗时
+    private long timeConsum;
+
+    public int getRet() {
+        return ret;
+    }
+
+    public void setRet(int ret) {
+        this.ret = ret;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public long getTimeConsum() {
+        return timeConsum;
+    }
+
+    public void setTimeConsum(long timeConsum) {
+        this.timeConsum = timeConsum;
+    }
+
+    public Response() {
+        super();
+    }
+
+    public Status getStatus() {
+        return status;
+    }
+
+    /**
+     * 在调用end()方法时,会自动设置状态,因此,如果调用了end()方法,就不要调用这个方法
+     *
+     * @param status
+     */
+    public Response<T> setStatus(Status status) {
+        this.status = status;
+        return this;
+    }
+
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public Response<T> setStartTime(long startTime) {
+        this.startTime = startTime;
+        return this;
+    }
+
+    public long getEndTime() {
+        return endTime;
+    }
+
+    public Response<T> setEndTime(long endTime) {
+        this.endTime = endTime;
+        return this;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    /**
+     * 设置状态和起始时间,表示操作正在进行
+     */
+    public Response<T> start() {
+        this.setStatus(Status.RUNNING);
+        this.setStartTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,没有失败
+     */
+    public Response<T> end() {
+        this.setEndTime(System.currentTimeMillis());
+        this.setTimeConsum(this.endTime - this.startTime);
+        this.setStatus(Status.OK);
+        return this;
+    }
+
+    /**
+     * 设置状态和时间,表示操作结束,并且失败
+     */
+    public Response<T> endAndFailed() {
+        this.setStatus(Status.FAIL);
+        this.setEndTime(System.currentTimeMillis());
+        return this;
+    }
+
+    /**
+     * 非参数错误通用失败信息
+     */
+    public Response<T> failure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_FAIL;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 参数错误信息
+     */
+    public Response<T> paramFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_ERROR_PARAM;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 用户信息丢失
+     */
+    public Response<T> tokenFailure(String msg) {
+        this.msg = msg;
+        this.ret = Constants.RET_NO_TOKEN;
+        this.end();
+        return this;
+    }
+
+    /**
+     * 通用成功
+     */
+    public Response<T> success() {
+        this.end();
+        return this;
+    }
+
+}

+ 98 - 0
aipt-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -0,0 +1,98 @@
+package com.diagbot.client.bean;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/2/2.
+ */
+public class ResponseData {
+    private String participleSymptom = "";
+
+    private List<FeatureRate> symptom = new ArrayList<>(10);
+    private List<FeatureRate> vitals = new ArrayList<>(10);
+    private List<FeatureRate> dis = new ArrayList<>(10);
+    private List<FeatureRate> labs = new ArrayList<>(10);
+    private List<FeatureRate> pacs = new ArrayList<>(10);
+    private List<FeatureRate> history=new ArrayList<>(10);
+    private Map<String, JSONObject> treat;
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.5f);
+
+
+    public String getParticipleSymptom() {
+        return participleSymptom;
+    }
+
+    public void setParticipleSymptom(String participleSymptom) {
+        this.participleSymptom = participleSymptom;
+    }
+
+    public List<FeatureRate> getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(List<FeatureRate> symptom) {
+        this.symptom = symptom;
+    }
+
+    public List<FeatureRate> getVitals() {
+        return vitals;
+    }
+
+    public void setVitals(List<FeatureRate> vitals) {
+        this.vitals = vitals;
+    }
+
+    public List<FeatureRate> getDis() {
+        return dis;
+    }
+
+    public void setDis(List<FeatureRate> dis) {
+        this.dis = dis;
+    }
+
+    public List<FeatureRate> getLabs() {
+        return labs;
+    }
+
+    public void setLabs(List<FeatureRate> labs) {
+        this.labs = labs;
+    }
+
+    public List<FeatureRate> getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(List<FeatureRate> pacs) {
+        this.pacs = pacs;
+    }
+
+    public List<FeatureRate> getHistory() {
+        return history;
+    }
+
+    public void setHistory(List<FeatureRate> history) {
+        this.history = history;
+    }
+
+    public Map<String, JSONObject> getTreat() {
+        return treat;
+    }
+
+    public void setTreat(Map<String, JSONObject> treat) {
+        this.treat = treat;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+}

+ 273 - 0
aipt-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -0,0 +1,273 @@
+package com.diagbot.client.bean;
+
+import com.diagbot.client.AlgorithmClassify;
+import com.diagbot.client.Feature;
+import com.diagbot.dto.LisResult;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by fyeman on 2018/1/31.
+ */
+public class SearchData {
+    private int length = 10;
+    private int age_start = 0;
+    private int age_end = 200;
+    private int age = 0;
+    private String sex;
+    // 搜索结果的贝叶斯阈值
+    private String threshold = "0";
+
+    private String symptom = "";
+    private String vital = "";
+    private String lis = "";
+    private String pacs = "";
+    private String diag = "";
+    private String past = "";
+    private String other = "";
+    private List<LisResult> lisArr;
+
+
+    //特征类别
+    private String featureType;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+
+    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
+
+
+    private List<Feature> symptomFeatureList = new ArrayList<>();
+    private List<Feature> vitalFeatureList = new ArrayList<>();
+    private List<Feature> lisFeatureList = new ArrayList<>();
+    private List<Feature> pacsFeatureList = new ArrayList<>();
+    private List<Feature> diagFeatureList = new ArrayList<>();
+    private List<Feature> symptompropertyFeatureList = new ArrayList<>();
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public int getAge_start() {
+        return age_start;
+    }
+
+    public void setAge_start(int age_start) {
+        this.age_start = age_start;
+    }
+
+    public int getAge_end() {
+        return age_end;
+    }
+
+    public void setAge_end(int age_end) {
+        this.age_end = age_end;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(String symptom) {
+        this.symptom = symptom;
+    }
+
+    public String getVital() {
+        return vital;
+    }
+
+    public void setVital(String vital) {
+        this.vital = vital;
+    }
+
+    public String getLis() {
+        return lis;
+    }
+
+    public void setLis(String lis) {
+        this.lis = lis;
+    }
+
+    public String getPacs() {
+        return pacs;
+    }
+
+    public void setPacs(String pacs) {
+        this.pacs = pacs;
+    }
+
+    public String getDiag() {
+        return diag;
+    }
+
+    public void setDiag(String diag) {
+        this.diag = diag;
+    }
+
+    public String getPast() {
+        return past;
+    }
+
+    public void setPast(String past) {
+        this.past = past;
+    }
+
+    public String getOther() {
+        return other;
+    }
+
+    public void setOther(String other) {
+        this.other = other;
+    }
+
+    public String getFeatureType() {
+        return featureType;
+    }
+
+    public void setFeatureType(String featureType) {
+        this.featureType = featureType;
+    }
+
+    public String[] getFeatureTypes() {
+        return featureTypes;
+    }
+
+    public void setFeatureTypes(String[] featureTypes) {
+        this.featureTypes = featureTypes;
+    }
+
+    public String getResourceType() {
+        return resourceType;
+    }
+
+    public void setResourceType(String resourceType) {
+        this.resourceType = resourceType;
+    }
+
+    public String getSysCode() {
+        return sysCode;
+    }
+
+    public void setSysCode(String sysCode) {
+        this.sysCode = sysCode;
+    }
+
+    public void setThreshold(String threshold) {
+        this.threshold = threshold;
+    }
+
+    public float getThreshold() {
+        return Float.parseFloat(threshold);
+    }
+
+    public List<Feature> getSymptomFeatureList() {
+        return symptomFeatureList;
+    }
+
+    public void setSymptomFeatureList(List<Feature> symptomFeatureList) {
+        this.symptomFeatureList = symptomFeatureList;
+    }
+
+    public List<Feature> getVitalFeatureList() {
+        return vitalFeatureList;
+    }
+
+    public void setVitalFeatureList(List<Feature> vitalFeatureList) {
+        this.vitalFeatureList = vitalFeatureList;
+    }
+
+    public List<Feature> getLisFeatureList() {
+        return lisFeatureList;
+    }
+
+    public void setLisFeatureList(List<Feature> lisFeatureList) {
+        this.lisFeatureList = lisFeatureList;
+    }
+
+    public List<Feature> getPacsFeatureList() {
+        return pacsFeatureList;
+    }
+
+    public void setPacsFeatureList(List<Feature> pacsFeatureList) {
+        this.pacsFeatureList = pacsFeatureList;
+    }
+
+
+    public List<Feature> getSymptompropertyFeatureList() {
+        return symptompropertyFeatureList;
+    }
+
+    public void setSymptompropertyFeatureList(List<Feature> symptompropertyFeatureList) {
+        this.symptompropertyFeatureList = symptompropertyFeatureList;
+    }
+
+    public List<Feature> getDiagFeatureList() {
+        return diagFeatureList;
+    }
+
+    public void setDiagFeatureList(List<Feature> diagFeatureList) {
+        this.diagFeatureList = diagFeatureList;
+    }
+
+    public Map<String, Map<String, String>> getInputs() {
+        return inputs;
+    }
+
+    public void setInputs(Map<String, Map<String, String>> inputs) {
+        this.inputs = inputs;
+    }
+
+    public AlgorithmClassify[] getAlgorithmClassify() {
+        return algorithmClassify;
+    }
+
+    public void setAlgorithmClassify(AlgorithmClassify[] algorithmClassify) {
+        this.algorithmClassify = algorithmClassify;
+    }
+
+    public String getAlgorithmClassifyValue() {
+        return algorithmClassifyValue;
+    }
+
+    public void setAlgorithmClassifyValue(String algorithmClassifyValue) {
+        this.algorithmClassifyValue = algorithmClassifyValue;
+    }
+
+    public List<LisResult> getLisArr() {
+        return lisArr;
+    }
+
+    public void setLisArr(List<LisResult> lisArr) {
+        this.lisArr = lisArr;
+    }
+}

+ 132 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Status.java

@@ -0,0 +1,132 @@
+package com.diagbot.client.bean;
+
+public enum Status {
+    /**
+     * <code>PENDING = 1;</code>
+     *
+     * <pre>
+     * 操作尚未开始
+     * </pre>
+     */
+    PENDING(1),
+    /**
+     * <code>RUNNING = 2;</code>
+     *
+     * <pre>
+     * 操作开始
+     * </pre>
+     */
+    RUNNING(2),
+    /**
+     * <code>OK = 3;</code>
+     *
+     * <pre>
+     * 操作正常结束
+     * </pre>
+     */
+    OK(3),
+    /**
+     * <code>WARN = 4;</code>
+     *
+     * <pre>
+     * 有警告,但是正常结束
+     * </pre>
+     */
+    WARN(4),
+    /**
+     * <code>ERROR = 5;</code>
+     *
+     * <pre>
+     * 有错误,但是完整结束
+     * </pre>
+     */
+    ERROR(5),
+    /**
+     * <code>FAIL = 6;</code>
+     *
+     * <pre>
+     * 操作失败
+     * </pre>
+     */
+    FAIL(6),
+    ;
+
+    /**
+     * <code>PENDING = 1;</code>
+     *
+     * <pre>
+     * 操作尚未开始
+     * </pre>
+     */
+    public static final int PENDING_VALUE = 1;
+    /**
+     * <code>RUNNING = 2;</code>
+     *
+     * <pre>
+     * 操作开始
+     * </pre>
+     */
+    public static final int RUNNING_VALUE = 2;
+    /**
+     * <code>OK = 3;</code>
+     *
+     * <pre>
+     * 操作正常结束
+     * </pre>
+     */
+    public static final int OK_VALUE = 3;
+    /**
+     * <code>WARN = 4;</code>
+     *
+     * <pre>
+     * 有警告,但是正常结束
+     * </pre>
+     */
+    public static final int WARN_VALUE = 4;
+    /**
+     * <code>ERROR = 5;</code>
+     *
+     * <pre>
+     * 有错误,但是完整结束
+     * </pre>
+     */
+    public static final int ERROR_VALUE = 5;
+    /**
+     * <code>FAIL = 6;</code>
+     *
+     * <pre>
+     * 操作失败
+     * </pre>
+     */
+    public static final int FAIL_VALUE = 6;
+
+    public final int getNumber() {
+        return value;
+    }
+
+    public static Status valueOf(int value) {
+        switch (value) {
+            case 1:
+                return PENDING;
+            case 2:
+                return RUNNING;
+            case 3:
+                return OK;
+            case 4:
+                return WARN;
+            case 5:
+                return ERROR;
+            case 6:
+                return FAIL;
+            default:
+                return null;
+        }
+    }
+
+    private final int value;
+
+    private Status(int value) {
+        this.value = value;
+    }
+
+}

+ 23 - 0
aipt-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java

@@ -0,0 +1,23 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.vo.SearchVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/20 13:15
+ */
+@Component
+@Slf4j
+public class AIServiceHystrix implements AIServiceClient {
+    @Override
+    public Response<ResponseData> bayesPageData(SearchVo searchVo) {
+        log.error("【hystrix】调用{}异常", "bayesPageData");
+        return null;
+    }
+}

+ 23 - 0
aipt-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -0,0 +1,23 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.User;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @Description: 调用用户服务
+ * @author: gaodm
+ * @time: 2018/8/6 9:52
+ */
+@Component
+public class UserServiceHystrix implements UserServiceClient {
+
+    @Override
+    public RespDTO<User> getUser(String token, String username) {
+        System.out.println(token);
+        System.out.println(username);
+        return null;
+    }
+}

+ 19 - 0
aipt-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java

@@ -0,0 +1,19 @@
+package com.diagbot.config;
+
+import org.springframework.security.oauth2.provider.OAuth2Authentication;
+import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class CustomAccessTokenConverter extends DefaultAccessTokenConverter {
+
+    @Override
+    public OAuth2Authentication extractAuthentication(Map<String, ?> claims) {
+        OAuth2Authentication authentication = super.extractAuthentication(claims);
+        authentication.setDetails(claims);
+        return authentication;
+    }
+
+}

+ 15 - 0
aipt-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java

@@ -0,0 +1,15 @@
+package com.diagbot.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+
+/**
+ * @Description: 安全配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:38
+ */
+@Configuration
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class GlobalMethodSecurityConfigurer {
+
+}

+ 48 - 0
aipt-service/src/main/java/com/diagbot/config/JwtConfigurer.java

@@ -0,0 +1,48 @@
+package com.diagbot.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
+import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
+import org.springframework.util.FileCopyUtils;
+
+import java.io.IOException;
+
+/**
+ * @Description: JWT配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:38
+ */
+@Configuration
+public class JwtConfigurer {
+    @Autowired
+    private CustomAccessTokenConverter customAccessTokenConverter;
+
+    @Bean
+    @Qualifier("tokenStore")
+    public TokenStore tokenStore() {
+
+        System.out.println("Created JwtTokenStore");
+        return new JwtTokenStore(jwtTokenEnhancer());
+    }
+
+    @Bean
+    protected JwtAccessTokenConverter jwtTokenEnhancer() {
+        JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
+        Resource resource = new ClassPathResource("public.cert");
+        String publicKey;
+        try {
+            publicKey = new String(FileCopyUtils.copyToByteArray(resource.getInputStream()));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        converter.setVerifierKey(publicKey);
+        converter.setAccessTokenConverter(customAccessTokenConverter);
+        return converter;
+    }
+}

+ 29 - 0
aipt-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -0,0 +1,29 @@
+package com.diagbot.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @Description: MybatisPlus配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:39
+ */
+@EnableTransactionManagement
+@Configuration
+@MapperScan("com.diagbot.mapper*")//这个注解,作用相当于下面的@Bean MapperScannerConfigurer,2者配置1份即可
+public class MybatisPlusConfigurer {
+
+    /**
+     * mybatis-plus分页插件<br>
+     * 文档:http://mp.baomidou.com<br>
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+        return paginationInterceptor;
+    }
+
+}

+ 42 - 0
aipt-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -0,0 +1,42 @@
+package com.diagbot.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
+import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
+import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+
+/**
+ * @Description: 权限资源配置类
+ * @author: gaodm
+ * @time: 2018/8/2 14:21
+ */
+@Configuration
+@EnableResourceServer
+public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
+    Logger log = LoggerFactory.getLogger(ResourceServerConfigurer.class);
+
+    @Override
+    public void configure(HttpSecurity http) throws Exception {
+        http
+                .csrf().disable()
+                .authorizeRequests()
+//                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
+//                .antMatchers("/**").authenticated();
+                .antMatchers("/**").permitAll();
+    }
+
+
+    @Override
+    public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
+        log.info("Configuring ResourceServerSecurityConfigurer ");
+        resources.resourceId("user-service").tokenStore(tokenStore);
+    }
+
+    @Autowired
+    TokenStore tokenStore;
+}

+ 69 - 0
aipt-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java

@@ -0,0 +1,69 @@
+package com.diagbot.config;
+
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.ParameterBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.schema.ModelRef;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @Description: Swagger配置类
+ * @author: gaodm
+ * @time: 2018/8/2 14:21
+ */
+@Configuration
+@ConditionalOnProperty(prefix = "swagger", value = { "enable" }, havingValue = "true")
+@EnableSwagger2
+public class SwaggerConfigurer {
+    /**
+     * 全局参数
+     *
+     * @return
+     */
+    private List<Parameter> parameter() {
+        List<Parameter> params = new ArrayList<>();
+        params.add(new ParameterBuilder().name("Authorization")
+                .description("Authorization Bearer token")
+                .modelRef(new ModelRef("string"))
+                .parameterType("header")
+                .required(false).build());
+        return params;
+    }
+
+
+    @Bean
+    public Docket sysApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.diagbot.web"))
+                .paths(PathSelectors.any())
+                .build().globalOperationParameters(parameter());
+        //.securitySchemes(newArrayList(oauth()))
+        // .securityContexts(newArrayList(securityContext()));
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title(" aipt-service api ")
+                .description("aipt-service 微服务")
+                .termsOfServiceUrl("")
+                .contact("diagbot")
+                .version("1.0")
+                .build();
+    }
+
+}

+ 79 - 0
aipt-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.AccessDecisionManager;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.authentication.InsufficientAuthenticationException;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collection;
+
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:46
+ */
+@Service
+public class UrlAccessDecisionManager implements AccessDecisionManager {
+    @Override
+    public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
+//        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+//        String url, method;
+//        if (matchPermitAllUrl(request)) {
+//            return;
+//        }
+//        if ("anonymousUser".equals(authentication.getPrincipal())) {
+//            throw new AccessDeniedException("no right");
+//        } else {
+//            for (GrantedAuthority ga : authentication.getAuthorities()) {
+//                String[] authority = ga.getAuthority().split(";");
+//                url = authority[0];
+//                method = authority[1];
+//                if (matchers(url, request)) {
+//                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
+//                        return;
+//                    }
+//                }
+//            }
+//        }
+//        throw new AccessDeniedException("no right");
+    }
+
+
+    @Override
+    public boolean supports(ConfigAttribute attribute) {
+        return true;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+
+    private Boolean matchPermitAllUrl(HttpServletRequest request){
+        if (matchers("/swagger/**", request)
+                || matchers("/v2/**", request)
+                || matchers("/swagger-ui.html/**", request)
+                || matchers("/swagger-resources/**", request)
+                || matchers("/web`jars/**", request)
+                || matchers("/druid/**", request)
+                || matchers("/actuator/**", request)
+                || matchers("/hystrix/**", request)
+                || matchers("/", request)) {
+            return true;
+        }
+        return false;
+    }
+
+    private boolean matchers(String url, HttpServletRequest request) {
+        AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
+        if (matcher.matches(request)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 29 - 0
aipt-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java

@@ -0,0 +1,29 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.ConfigAttribute;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+public class UrlConfigAttribute implements ConfigAttribute {
+
+    private final HttpServletRequest httpServletRequest;
+
+    public UrlConfigAttribute(HttpServletRequest httpServletRequest) {
+        this.httpServletRequest = httpServletRequest;
+    }
+
+
+    @Override
+    public String getAttribute() {
+        return null;
+    }
+
+    public HttpServletRequest getHttpServletRequest() {
+        return httpServletRequest;
+    }
+}

+ 79 - 0
aipt-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.security;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.SecurityMetadataSource;
+import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
+import org.springframework.security.access.intercept.InterceptorStatusToken;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+@Service
+public class UrlFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter {
+
+
+    @Autowired
+    private FilterInvocationSecurityMetadataSource securityMetadataSource;
+
+    @Autowired
+    public void setUrlAccessDecisionManager(UrlAccessDecisionManager urlAccessDecisionManager) {
+        super.setAccessDecisionManager(urlAccessDecisionManager);
+    }
+
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+
+        FilterInvocation fi = new FilterInvocation(request, response, chain);
+        invoke(fi);
+    }
+
+
+    public void invoke(FilterInvocation fi) throws IOException, ServletException {
+        //fi里面有一个被拦截的url
+        //里面调用UrlMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
+        //再调用UrlAccessDecisionManager的decide方法来校验用户的权限是否足够
+        InterceptorStatusToken token = super.beforeInvocation(fi);
+        try {
+            //执行下一个拦截器
+            fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
+        } finally {
+            super.afterInvocation(token, null);
+        }
+    }
+
+
+    @Override
+    public void destroy() {
+
+    }
+
+    @Override
+    public Class<?> getSecureObjectClass() {
+        return FilterInvocation.class;
+
+    }
+
+    @Override
+    public SecurityMetadataSource obtainSecurityMetadataSource() {
+        return this.securityMetadataSource;
+    }
+}

+ 40 - 0
aipt-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java

@@ -0,0 +1,40 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+@Service
+public class UrlMetadataSourceService implements
+        FilterInvocationSecurityMetadataSource {
+
+    @Override
+    public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
+        final HttpServletRequest request = ((FilterInvocation) object).getRequest();
+        Set<ConfigAttribute> allAttributes = new HashSet<>();
+        ConfigAttribute configAttribute = new UrlConfigAttribute(request);
+        allAttributes.add(configAttribute);
+        return allAttributes;
+    }
+
+    @Override
+    public Collection<ConfigAttribute> getAllConfigAttributes() {
+        return null;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+}

+ 22 - 0
aipt-service/src/main/java/com/diagbot/dto/LisResult.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:化验信息
+ * @Author:zhaops
+ * @time: 2018/12/19 14:03
+ */
+@Getter
+@Setter
+public class LisResult {
+    private String name;//套餐名称
+    private String detailName;//化验项名称
+    private String uniqueName;//公表名称
+    private Double value;//值
+    private Double maxValue;//最大值
+    private Double minValue;//最小值
+    private String units;//单位
+    private String otherValue;//其他结果,包括阴性阳性,文字描述等
+}

+ 196 - 0
aipt-service/src/main/java/com/diagbot/entity/SysLog.java

@@ -0,0 +1,196 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统操作日志表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-09-14
+ */
+public class SysLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 日志ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 方法
+     */
+    private String method;
+
+    /**
+     * 操作名
+     */
+    private String operation;
+
+    /**
+     * 参数
+     */
+    private String params;
+
+    /**
+     * 用户名
+     */
+    private String username;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public Integer getSysType() {
+        return sysType;
+    }
+
+    public void setSysType(Integer sysType) {
+        this.sysType = sysType;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public String getOperation() {
+        return operation;
+    }
+
+    public void setOperation(String operation) {
+        this.operation = operation;
+    }
+
+    public String getParams() {
+        return params;
+    }
+
+    public void setParams(String params) {
+        this.params = params;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    @Override
+    public String toString() {
+        return "SysLog{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", ip=" + ip +
+                ", sysType=" + sysType +
+                ", method=" + method +
+                ", operation=" + operation +
+                ", params=" + params +
+                ", username=" + username +
+                "}";
+    }
+}

+ 142 - 0
aipt-service/src/main/java/com/diagbot/entity/User.java

@@ -0,0 +1,142 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统用户表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-30
+ */
+@TableName("sys_user")
+public class User implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 用户ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 用户名
+     */
+    private String username;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    @Override
+    public String toString() {
+        return "User{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", password=" + password +
+                ", username=" + username +
+                "}";
+    }
+}

+ 81 - 0
aipt-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java

@@ -0,0 +1,81 @@
+package com.diagbot.exception;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.GsonUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.BindException;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * @Description: 错误通用处理
+ * @author: gaodm
+ * @time: 2018/8/2 14:22
+ */
+@ControllerAdvice
+@ResponseBody
+@Slf4j
+public class CommonExceptionHandler {
+
+    @ExceptionHandler(Exception.class)
+    public ResponseEntity<RespDTO> handleException(Exception e) {
+        RespDTO resp = new RespDTO();
+        if (e instanceof BindException) {
+            BindException ex = (BindException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof MethodArgumentNotValidException) {
+            MethodArgumentNotValidException ex = (MethodArgumentNotValidException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof MissingServletRequestParameterException) {
+            MissingServletRequestParameterException ex = (MissingServletRequestParameterException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            stringMap.put(ex.getParameterName(), "不能为null");
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof CommonException) {
+            CommonException taiChiException = (CommonException) e;
+            resp.code = taiChiException.getCode();
+            resp.msg = e.getMessage();
+            log.error("【业务异常】:{}", e.getMessage());
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        resp.code = CommonErrorCode.FAIL.getCode();
+        resp.msg = e.getMessage();
+        log.error("【系统异常】:{}", e.getMessage());
+        e.printStackTrace();
+        return new ResponseEntity(resp, HttpStatus.OK);
+    }
+
+}

+ 53 - 0
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -0,0 +1,53 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.LisResult;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+import com.diagbot.vo.SearchVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  数据处理业务层
+ * </p>
+ *
+ * @author Mark Huang
+ * @since 2019-03-04
+ */
+@Component
+public class ClinicalFacade {
+    /**
+     * 处理临床数据
+     *
+     * @param searchVo
+     * @return SearchVo
+     */
+    public SearchVo processClinicalData(@RequestBody SearchVo searchVo) {
+        SearchVo sData = searchVo;
+
+        sData.setLisArr(processLis(sData.getLisArr()));
+
+        return sData;
+    }
+
+    private List<LisResult> processLis(List<LisResult> lisArr) {
+
+        String Otherval = "";
+
+        for (int i=0; i<lisArr.size(); i++) {
+            LisResult lisres = lisArr.get(i);
+
+            Otherval = (lisres.getOtherValue().trim().length() > 0)? lisres.getOtherValue().trim()+"\n":"";
+
+            if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
+                lisres.setOtherValue(Otherval + "超出标准");
+            }
+            else if (lisres.getMinValue() != null && lisres.getValue() < lisres.getMinValue()) {
+                lisres.setOtherValue(Otherval + "低于标准");
+            }
+        }
+
+        return lisArr;
+    }
+}

+ 13 - 0
aipt-service/src/main/java/com/diagbot/facade/SysLogFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.SysLogServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 用户日志业务层
+ * @author: gaodm
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class SysLogFacade extends SysLogServiceImpl {
+}

+ 16 - 0
aipt-service/src/main/java/com/diagbot/mapper/SysLogMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.SysLog;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface SysLogMapper extends BaseMapper<SysLog> {
+
+}

+ 23 - 0
aipt-service/src/main/java/com/diagbot/rabbit/MyProcessor.java

@@ -0,0 +1,23 @@
+package com.diagbot.rabbit;
+
+import org.springframework.cloud.stream.annotation.Input;
+import org.springframework.cloud.stream.annotation.Output;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.SubscribableChannel;
+
+/**
+ * @Description: 自定义Stream发布和消费对象
+ * @author: gaodm
+ * @time: 2018/8/29 13:39
+ */
+public interface MyProcessor {
+
+    String INPUT_LOG = "inputLog";
+    String OUTPUT_LOG = "outputLog";
+
+    @Input(INPUT_LOG)
+    SubscribableChannel inputLog();
+
+    @Output(OUTPUT_LOG)
+    MessageChannel outputLog();
+}

+ 27 - 0
aipt-service/src/main/java/com/diagbot/rabbit/MySender.java

@@ -0,0 +1,27 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.entity.SysLog;
+import com.diagbot.util.GsonUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 发布者
+ * @author: gaodm
+ * @time: 2018/8/29 13:41
+ */
+@Component
+@EnableBinding({ MyProcessor.class })
+public class MySender {
+    @Autowired
+    @Qualifier("outputLog")
+    MessageChannel outputLog;
+
+    public void outputLogSend(SysLog sysLog) {
+        outputLog.send(MessageBuilder.withPayload(GsonUtil.toJson(sysLog)).build());
+    }
+}

+ 15 - 0
aipt-service/src/main/java/com/diagbot/service/SysLogService.java

@@ -0,0 +1,15 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.SysLog;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface SysLogService extends IService<SysLog> {
+}

+ 19 - 0
aipt-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java

@@ -0,0 +1,19 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.SysLog;
+import com.diagbot.mapper.SysLogMapper;
+import com.diagbot.service.SysLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+@Service
+public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
+}

+ 64 - 0
aipt-service/src/main/java/com/diagbot/vo/SearchVo.java

@@ -0,0 +1,64 @@
+package com.diagbot.vo;
+
+import com.diagbot.dto.LisResult;
+import lombok.Getter;
+import lombok.Setter;
+
+import com.diagbot.client.Feature;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: Weixuan Huang
+ * @time: 2019/3/4 16:35
+ */
+@Getter
+@Setter
+public class SearchVo {
+    private String sex;
+    private int age;
+    private int age_start;
+    private int age_end;
+
+    private String symptom;
+    private String vital;
+    private String lis;
+    private String pacs;
+    private String other;
+    private String featureType;
+    private String diag;
+
+    private int length;
+
+
+    // 搜索结果的贝叶斯阈值
+    private String threshold;
+
+    private List<Feature> symptomFeatureList;
+    private List<Feature> lisFeatureList;
+    private List<Feature> pacsFeatureList;
+    private List<Feature> vitalFeatureList;
+    private List<Feature> symptompropertyFeatureList;
+
+    private List<LisResult> lisArr;
+    private List<Feature> diagFeatureList;
+    private Map<String, Map<String, String>> inputs;
+
+
+    /*
+    private String past;
+    //特征类别对","进行分割后数据
+    private String[] featureTypes;
+    //门诊 住院分类
+    private String resourceType;
+    //模型
+    private AlgorithmClassify algorithmClassify[];
+    //模型
+    private String algorithmClassifyValue;
+    //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
+    private String sysCode;
+    */
+
+}

+ 21 - 0
aipt-service/src/main/java/com/diagbot/vo/SysLogVo.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class SysLogVo {
+    private Date createDate;
+    private String ip;
+    private String method;
+    private String operation;
+    private String params;
+}

+ 56 - 0
aipt-service/src/main/java/com/diagbot/web/ClinicalController.java

@@ -0,0 +1,56 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.ResponseData;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.ClinicalFacade;
+import com.diagbot.vo.SearchVo;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Mark Huang
+ * @since 2019-03-04
+ */
+@RestController
+@RequestMapping("/clinicaldata")
+@Api(value = "临床数据处理API", tags = { "临床数据处理API" })
+
+public class ClinicalController {
+    @Autowired
+    private ClinicalFacade clinicalFacade;
+
+    @Autowired
+    private AIServiceClient aiServiceClient;
+
+    @ApiOperation(value = "临床数据处理", notes = "")
+    @PostMapping("/processData")
+    @SysLogger("processData")
+    public RespDTO<ResponseData> processData(@Valid @RequestBody SearchVo searchVo) {
+
+        SearchVo sData = clinicalFacade.processClinicalData(searchVo);
+
+//        Response<ResponseData> res = aiServiceClient.bayesPageData(sData);
+
+        Response<SearchVo> res = new Response<>();
+        res.setData(sData);
+
+        return RespDTO.onSuc(res.getData());
+    }
+
+}

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

@@ -0,0 +1,110 @@
+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));
+    }
+}
+

+ 23 - 0
aipt-service/src/main/java/com/diagbot/web/TestController.java

@@ -0,0 +1,23 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description:
+ * @author: ztg
+ * @time: 2019/2/27 9:58
+ */
+@RestController
+@RequestMapping("/test")
+public class TestController {
+
+    @PostMapping("/list")
+    @SysLogger("list")
+    public RespDTO<String> list() {
+        return RespDTO.onSuc("OK");
+    }
+}

+ 19 - 0
aipt-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,19 @@
+spring:
+  application:
+    name: aipt-service
+  cloud:
+    config:
+      #uri: http://${myuri}:8769
+      fail-fast: true
+      discovery:
+        enabled: true
+        serviceId: config-server
+  profiles:
+    active: local
+
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://${myuri}:8761/eureka/
+
+myuri: localhost

+ 280 - 0
aipt-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <!-- 项目名称 -->
+    <property name="APPDIR" value="aipt-service"/>
+    <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
+    <property name="LOG_PATH" value="../logs"/>
+
+    <!-- 彩色日志 -->
+    <!-- 彩色日志依赖的渲染类 -->
+    <conversionRule conversionWord="clr"
+                    converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
+    <conversionRule conversionWord="wex"
+                    converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
+    <conversionRule conversionWord="wEx"
+                    converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
+    <!-- 彩色日志格式 -->
+    <property name="CONSOLE_LOG_PATTERN"
+              value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%logger){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+    <!--包名输出缩进对齐-->
+    <property name="CONSOLE_LOG_PATTERN"
+              value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <!--  日志记录器,日期滚动记录
+            ERROR 级别
+     -->
+    <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_error.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/error/${APPDIR}-error-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>30</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-error-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件记录error级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>error</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            WARN  级别
+     -->
+    <appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_warn.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/warn/${APPDIR}-warn-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-warn-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录warn级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>warn</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            INFO  级别
+    -->
+    <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_info.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/info/${APPDIR}-info-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-info-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录info级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>info</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            DEBUG  级别
+    -->
+    <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_debug.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/debug/${APPDIR}-debug-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-debug-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录debug级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>debug</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- ConsoleAppender 控制台输出日志 -->
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <!--encoder 默认配置为PatternLayoutEncoder-->
+        <encoder>
+            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
+            <!--<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level -&#45;&#45; [%thread] %logger Line:%-3L - %msg%n</pattern>-->
+            <charset>utf-8</charset>
+        </encoder>
+        <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>debug</level>
+        </filter>
+    </appender>
+
+
+    <!--&lt;!&ndash;输出到mysql数据库的appender配置     &ndash;&gt;-->
+    <!--<appender name="db" class="ch.qos.logback.classic.db.DBAppender">-->
+    <!--<connectionSource-->
+    <!--class="ch.qos.logback.core.db.DriverManagerConnectionSource">-->
+    <!--<driverClass>com.mysql.jdbc.Driver</driverClass>-->
+    <!--<url>jdbc:mysql://120.77.222.42:3306/logback_member?characterEncoding=utf8</url>-->
+    <!--<user>root</user>-->
+    <!--<password>a123456789</password>-->
+    <!--</connectionSource>-->
+    <!--</appender>-->
+
+    <!-- FrameworkServlet日志-->
+    <logger name="org.springframework" level="WARN"/>
+
+    <!-- mybatis日志打印-->
+    <logger name="org.apache.ibatis" level="DEBUG"/>
+    <logger name="java.sql" level="DEBUG"/>
+
+    <!--  项目 mapper 路径
+            console控制台显示sql语句:STDOUT.filter.level -> debug级别
+    -->
+    <logger name="com.diagbot.mapper" level="DEBUG"/>
+
+    <appender name="LOGSTASHDEV" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.236:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"aipt-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <appender name="LOGSTASHTEST" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.241:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"aipt-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <!-- 本地环境下的日志配置 -->
+    <springProfile name="local">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <!-- 生产环境将请stdout去掉 -->
+            <appender-ref ref="STDOUT"/>
+        </root>
+    </springProfile>
+
+    <!-- 开发环境下的日志配置 -->
+    <springProfile name="dev">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <!-- 生产环境将请stdout去掉 -->
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHDEV"/>
+        </root>
+    </springProfile>
+
+    <!-- 测试环境下的日志配置 -->
+    <springProfile name="test">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <!-- 生产环境将请stdout去掉 -->
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHTEST"/>
+        </root>
+    </springProfile>
+
+    <!-- 生产环境下的日志配置 -->
+    <springProfile name="pro">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="LOGSTASH"/>
+        </root>
+    </springProfile>
+</configuration>

+ 22 - 0
aipt-service/src/main/resources/mapper/SysLogMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.SysLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysLog">
+        <id column="id" property="id"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
+        <result column="ip" property="ip"/>
+        <result column="sys_type" property="sysType"/>
+        <result column="method" property="method"/>
+        <result column="operation" property="operation"/>
+        <result column="params" property="params"/>
+        <result column="username" property="username"/>
+    </resultMap>
+
+</mapper>

+ 9 - 0
aipt-service/src/main/resources/public.cert

@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxXZWH/WgxW9eTT6AmPRo
+GFY3T5V1+F1458dcQFw0EZejjHuGwEeHvxcgl4059Me2B1xXTs3FDXTWQ5z19EtP
+3ITYtnFTo2cxhwxiwqN8ZqFdpq5Uac0mzjlYKcyGp8x6t+Nc2cv3D3Ul2VIbGvbP
+sQOeKvt3WxWwdpQ+q3RXjRUFQGiygSD7yuXHIUpcOsm4ZWDlUkjfwX1q4pjiwFfA
+Mq5xgkzPwolUKnI0NFnom3Th3i4oFXzUg2s6cEj7jL7YU35c2/9kE7WQPbeYhoSi
+XH2OwWgBk/2Ki6+Q0Yq/eAsXSBjp1jqh337vvKBk5ocPG1Imi8uTLIgYQCMwzvg+
+VQIDAQAB
+-----END PUBLIC KEY-----

+ 1 - 1
knowledgeman-service/src/test/java/com/diagbot/KnowledgeServiceApplicationTests.java

@@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
-public class KnowledgeServiceApplicationTests {
+public class BiServiceApplicationTests {
 
     @Test
     public void contextLoads() {

+ 83 - 0
aipt-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -0,0 +1,83 @@
+package com.diagbot;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
+import com.baomidou.mybatisplus.generator.config.GlobalConfig;
+import com.baomidou.mybatisplus.generator.config.PackageConfig;
+import com.baomidou.mybatisplus.generator.config.StrategyConfig;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+/**
+ * @Description: 代码生成器
+ * @author: gaodm
+ * @time: 2018/8/2 10:15
+ */
+public class CodeGeneration {
+
+    /**
+     *
+     * @Title: main
+     * @Description: 生成
+     * @param args
+     */
+    public static void main(String[] args) {
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        gc.setOutputDir("E://code//biservice");
+        gc.setFileOverride(true);
+        gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
+        gc.setEnableCache(false);// XML 二级缓存
+        gc.setBaseResultMap(true);// XML ResultMap
+        gc.setBaseColumnList(false);// XML columList
+        gc.setAuthor("gaodm");// 作者
+
+        // 自定义文件命名,注意 %s 会自动填充表实体属性!
+        gc.setControllerName("%sController");
+        gc.setServiceName("%sService");
+        gc.setServiceImplName("%sServiceImpl");
+        gc.setMapperName("%sMapper");
+        gc.setXmlName("%sMapper");
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setDbType(DbType.MYSQL);
+        dsc.setDriverName("com.mysql.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("root");
+        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/sys-log?useUnicode=true&characterEncoding=utf-8");
+        mpg.setDataSource(dsc);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+//        strategy.setTablePrefix(new String[] { "sys_" });// 此处可以修改为您的表前缀
+        strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
+        strategy.setInclude(new String[] { "sys_log" }); // 需要生成的表
+
+        strategy.setSuperServiceClass(null);
+        strategy.setSuperServiceImplClass(null);
+        strategy.setSuperMapperClass(null);
+
+        mpg.setStrategy(strategy);
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+        pc.setParent("com.diagbot");
+        pc.setController("web");
+        pc.setService("service");
+        pc.setServiceImpl("service.impl");
+        pc.setMapper("mapper");
+        pc.setEntity("entity");
+        pc.setXml("resources.mapper");
+        mpg.setPackageInfo(pc);
+
+        // 执行生成
+        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+
+    }
+}

+ 3 - 2
common/src/main/java/com/diagbot/enums/SysTypeEnum.java

@@ -23,8 +23,9 @@ public enum SysTypeEnum implements KeyedNamed {
     APPKEY(10, "appkey"),
     ICSS_SERVICE(11, "icss-service"),
     ICSSMAN_SERVICE(12, "icssman-service"),
-    KNOWLEDGEMAN_SERVICE(13, "knowledgeman-service");
-
+    KNOWLEDGEMAN_SERVICE(13, "knowledgeman-service"),
+    TRAN_SERVICE(14, "tran-service"),
+    AIPT_SERVICE(15, "aipt-service");
     @Setter
     private int key;
 

+ 97 - 0
config-server/src/main/resources/shared/aipt-service-dev.yml

@@ -0,0 +1,97 @@
+server:
+  port: 8845
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 97 - 0
config-server/src/main/resources/shared/aipt-service-local.yml

@@ -0,0 +1,97 @@
+server:
+  port: 8845
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 97 - 0
config-server/src/main/resources/shared/aipt-service-pro.yml

@@ -0,0 +1,97 @@
+server:
+  port: 8845
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 97 - 0
config-server/src/main/resources/shared/aipt-service-test.yml

@@ -0,0 +1,97 @@
+server:
+  port: 8845
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.241
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+ai:
+  server:
+    address: http://192.168.2.234:5008

+ 14 - 0
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -104,6 +104,20 @@ spring:
         filters:
         - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: tran-service
+        uri: lb://tran-service
+        predicates:
+        - Path=/api/tran/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: aipt-service
+        uri: lb://aipt-service
+        predicates:
+        - Path=/api/aipt/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 server:
   port: 5050

+ 14 - 0
config-server/src/main/resources/shared/gateway-service-local.yml

@@ -104,6 +104,20 @@ spring:
         filters:
         - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: tran-service
+        uri: lb://tran-service
+        predicates:
+        - Path=/api/tran/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: aipt-service
+        uri: lb://aipt-service
+        predicates:
+        - Path=/api/aipt/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 server:
   port: 5050

+ 14 - 1
config-server/src/main/resources/shared/gateway-service-pro.yml

@@ -104,7 +104,20 @@ spring:
         filters:
         - SwaggerHeaderFilter
         - StripPrefix=2
-
+      - id: tran-service
+        uri: lb://tran-service
+        predicates:
+        - Path=/api/tran/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: aipt-service
+        uri: lb://aipt-service
+        predicates:
+        - Path=/api/aipt/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 server:
   port: 5050

+ 14 - 0
config-server/src/main/resources/shared/gateway-service-test.yml

@@ -104,6 +104,20 @@ spring:
         filters:
         - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: tran-service
+        uri: lb://tran-service
+        predicates:
+        - Path=/api/tran/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: aipt-service
+        uri: lb://aipt-service
+        predicates:
+        - Path=/api/aipt/**
+        filters:
+        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 server:
   port: 5050

+ 9 - 1
config-server/src/main/resources/shared/icss-service-dev.yml

@@ -100,7 +100,15 @@ mybatis-plus:
 
 ai:
   server:
-    address: http://192.168.2.234:8080
+    address: http://192.168.2.234:5008
+
+graph:
+  server:
+    address: http://192.168.2.234:5003
+
+symptom:
+  server:
+    address: http://192.168.2.234:5002
 
 treat:
   server:

+ 9 - 1
config-server/src/main/resources/shared/icss-service-local.yml

@@ -100,7 +100,15 @@ mybatis-plus:
 
 ai:
   server:
-    address: http://192.168.2.234:8080
+    address: http://192.168.2.234:5008
+
+graph:
+  server:
+    address: http://192.168.2.234:5003
+
+symptom:
+  server:
+    address: http://192.168.2.234:5002
 
 treat:
   server:

+ 9 - 1
config-server/src/main/resources/shared/icss-service-pro.yml

@@ -100,7 +100,15 @@ mybatis-plus:
 
 ai:
   server:
-    address: http://192.168.2.234:8080
+    address: http://192.168.2.234:5008
+
+graph:
+  server:
+    address: http://192.168.2.234:5003
+
+symptom:
+  server:
+    address: http://192.168.2.234:5002
 
 treat:
   server:

+ 9 - 1
config-server/src/main/resources/shared/icss-service-test.yml

@@ -100,7 +100,15 @@ mybatis-plus:
 
 ai:
   server:
-    address: http://192.168.2.234:8080
+    address: http://192.168.2.234:5008
+
+graph:
+  server:
+    address: http://192.168.2.234:5003
+
+symptom:
+  server:
+    address: http://192.168.2.234:5002
 
 treat:
   server:

+ 6 - 0
config-server/src/main/resources/shared/knowledgeman-service-dev.yml

@@ -47,6 +47,12 @@ spring:
         login-username: root
         login-password: root
 
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 5MB
+      max-request-size: 5MB
+
   cloud:
     stream:
       bindings:

+ 6 - 0
config-server/src/main/resources/shared/knowledgeman-service-local.yml

@@ -47,6 +47,12 @@ spring:
         login-username: root
         login-password: root
 
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 5MB
+      max-request-size: 5MB
+
   cloud:
     stream:
       bindings:

+ 6 - 0
config-server/src/main/resources/shared/knowledgeman-service-pro.yml

@@ -47,6 +47,12 @@ spring:
         login-username: root
         login-password: root
 
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 5MB
+      max-request-size: 5MB
+
   cloud:
     stream:
       bindings:

+ 6 - 0
config-server/src/main/resources/shared/knowledgeman-service-test.yml

@@ -47,6 +47,12 @@ spring:
         login-username: root
         login-password: root
 
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 5MB
+      max-request-size: 5MB
+
   cloud:
     stream:
       bindings:

+ 94 - 0
config-server/src/main/resources/shared/tran-service-dev.yml

@@ -0,0 +1,94 @@
+server:
+  port: 8825
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-tran?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+

+ 94 - 0
config-server/src/main/resources/shared/tran-service-local.yml

@@ -0,0 +1,94 @@
+server:
+  port: 8825
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-tran?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+

+ 94 - 0
config-server/src/main/resources/shared/tran-service-pro.yml

@@ -0,0 +1,94 @@
+server:
+  port: 8825
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-tran?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+

+ 94 - 0
config-server/src/main/resources/shared/tran-service-test.yml

@@ -0,0 +1,94 @@
+server:
+  port: 8825
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/sys-tran?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.241
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+

+ 12 - 0
docker-compose.yml

@@ -51,6 +51,18 @@ services:
       - spring.profiles.active=dev
       - myuri=eureka1
     restart: always
+  aipt-service:
+    image: 192.168.2.236:5000/diagbotcloud/aipt-service:0.0.1-SNAPSHOT
+    depends_on:
+    #      - config1
+    - eureka1
+    volumes:
+    - "/etc/localtime:/etc/localtime:ro"
+    #      - "data/diagbotcloud/logs:/logs"
+    environment:
+    - spring.profiles.active=dev
+    - myuri=eureka1
+    restart: always
   diagbotman-service:
     image: 192.168.2.236:5000/diagbotcloud/diagbotman-service:0.0.1-SNAPSHOT
     depends_on:

+ 1 - 1
icss-service/src/main/java/com/diagbot/client/AIServiceClient.java

@@ -15,6 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody;
  */
 @FeignClient(name = "AI", url = "${ai.server.address}", fallback = AIServiceHystrix.class)
 public interface AIServiceClient {
-    @PostMapping(value = "/web/doc/algorithm/neural")
+    @PostMapping(value = "/push-web/algorithm/neural")
     Response<ResponseData> bayesPageData(@RequestBody SearchData searchData);
 }

+ 4 - 5
icss-service/src/main/java/com/diagbot/client/HighRiskServiceClient.java

@@ -2,20 +2,19 @@ package com.diagbot.client;
 
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.SearchData;
 import com.diagbot.client.hystrix.HighRiskServiceHystrix;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
-import java.util.Map;
-
 /**
  * @Description:
  * @Author:zhaops
  * @time: 2018/12/21 11:38
  */
-@FeignClient(name = "HighRisk", url = "${ai.server.address}", fallback = HighRiskServiceHystrix.class)
+@FeignClient(name = "HighRisk", url = "${graph.server.address}", fallback = HighRiskServiceHystrix.class)
 public interface HighRiskServiceClient {
-    @PostMapping(value = "/web/graphdb/HighRisk")
-    Response<GdbResponse> highRiskPageData(@RequestBody Map<String, String> map);
+    @PostMapping(value = "/graph-web/graph/highRisk")
+    Response<GdbResponse> highRiskPageData(@RequestBody SearchData searchData);
 }

+ 21 - 0
icss-service/src/main/java/com/diagbot/client/SymptomFeatureClient.java

@@ -0,0 +1,21 @@
+package com.diagbot.client;
+
+import com.diagbot.client.bean.Response;
+import com.diagbot.client.hystrix.SymptomFeatureHystrix;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/2/26 10:33
+ */
+@FeignClient(name = "SymptomFeature", url = "${symptom.server.address}", fallback = SymptomFeatureHystrix.class)
+public interface SymptomFeatureClient {
+    @PostMapping(value = "/nlp-web/feature/find_symptom_feature")
+    Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text);
+}

+ 133 - 0
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -0,0 +1,133 @@
+package com.diagbot.client;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.diagbot.client.hystrix.TranServiceHystrix;
+import com.diagbot.dto.DoctorInfoDTO;
+import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.HospitalDeptInfoDTO;
+import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.dto.LisConfigDTO;
+import com.diagbot.dto.PatientInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TranFieldInfoDTO;
+import com.diagbot.entity.DoctorInfo;
+import com.diagbot.entity.HospitalDept;
+import com.diagbot.entity.PatientInfo;
+import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.HospitalDeptInfoVO;
+import com.diagbot.vo.HospitalInfoVO;
+import com.diagbot.vo.LisHospitalCodeVO;
+import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.TranFieldInfoVO;
+
+/**
+ * @Description: 调用信息对接层服务
+ * @author: gaodm
+ * @time: 2019/2/1 17:00
+ */
+@FeignClient(value = "tran-service", fallback = TranServiceHystrix.class)
+public interface TranServiceClient {
+
+    /**
+     * 获取医生信息
+     *
+     * @param doctorInfoVo
+     * @return
+     */
+    @PostMapping("/doctorInfo/getDoctorInfo")
+    RespDTO<List<DoctorInfoDTO>> getDoctorInfo(@RequestBody DoctorInfoVO doctorInfoVo);
+    
+    /**
+     * 根据ids获取医生信息map
+     * @param ids
+     * @return
+     */
+    @PostMapping("/doctorInfo/doctorInfoMapByIds")
+    RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(@RequestBody List<Long> ids);
+
+    /**
+     * 获取科室信息
+     *
+     * @param hospitalDeptInfoVO
+     * @return
+     */
+    @PostMapping("/hospitalDeptInfo/getHospitalDeptInfo")
+    RespDTO<HospitalDeptInfoDTO> getHospitalDeptInfo(@RequestBody HospitalDeptInfoVO hospitalDeptInfoVO);
+    
+    /**
+     * 根据ids获取科室信息map
+     * @param ids
+     * @return
+     */
+    @PostMapping("/hospitalDeptInfo/hospitalDeptInfoMapByIds")
+    RespDTO<Map<Long, HospitalDept>> hospitalDeptInfoMapByIds(@RequestBody List<Long> ids);
+
+    /**
+     * 获取医院信息
+     *
+     * @param hospitalInfoVO
+     * @return
+     */
+    @PostMapping("/hospitalInfo/getHospitalInfo")
+    RespDTO<List<HospitalInfoDTO>> getHospitalInfo(@RequestBody HospitalInfoVO hospitalInfoVO);
+    /**
+     * 匹配公表名
+     * @param lisHospitalCodeVO
+     * @return
+     */
+    @PostMapping("/tranLisConfig/getLisConfigByhospitalId")
+    RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(@RequestBody LisHospitalCodeVO lisHospitalCodeVO);
+
+    /**
+     * 获取患者信息
+     *
+     * @param patientInfoVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getPatientInfo")
+    RespDTO<PatientInfoDTO> getPatientInfo(@RequestBody PatientInfoVO patientInfoVO);
+
+    /**
+     * 获取页面顶部病人医生科室信息
+     *
+     * @param getTopPatientInfoVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfo")
+    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
+    
+    /**
+     * 根据ids获取病人信息
+     * @param ids
+     * @return
+     */
+    @PostMapping("/patientInfo/patientInfoMapByIds")
+    RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(@RequestBody List<Long> ids);
+
+    /**
+     * 根据uuid获取相关信息
+     *
+     * @param tranFieldInfoVO
+     * @return
+     */
+    @PostMapping("/tranFieldInfo/getInfoByUuid")
+    RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(@RequestBody TranFieldInfoVO tranFieldInfoVO);
+
+    /**
+     * 根据医院编号疾病id获取各医院对应的诊断icd
+     *
+     * @param getDiseaseIcdVO
+     * @return
+     */
+    @PostMapping("/diseaseIcd/getDiseaseIcds")
+    RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody GetDiseaseIcdVO getDiseaseIcdVO);
+}

+ 3 - 1
icss-service/src/main/java/com/diagbot/client/bean/MedicitionClass.java

@@ -18,6 +18,8 @@ public class MedicitionClass {
      * 1-有提示信息,0-没有提示信息
      */
     private String showInfo = "0";
-    private String drugsName;//药类名
+    private String drugsForbidden;
+    private String bigdrugsName;//药类名
+    private String subdrugsName;//药类名-小类
     private LinkedList<Medicition> medicitionsList;
 }

+ 2 - 3
icss-service/src/main/java/com/diagbot/client/hystrix/HighRiskServiceHystrix.java

@@ -3,11 +3,10 @@ package com.diagbot.client.hystrix;
 import com.diagbot.client.HighRiskServiceClient;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.Response;
+import com.diagbot.client.bean.SearchData;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
-import java.util.Map;
-
 /**
  * @Description:
  * @Author:zhaops
@@ -17,7 +16,7 @@ import java.util.Map;
 @Slf4j
 public class HighRiskServiceHystrix implements HighRiskServiceClient {
     @Override
-    public Response<GdbResponse> highRiskPageData(Map<String, String> map) {
+    public Response<GdbResponse> highRiskPageData(SearchData searchData) {
         log.error("【hystrix】调用{}异常", "highRiskPageData");
         return null;
     }

+ 26 - 0
icss-service/src/main/java/com/diagbot/client/hystrix/SymptomFeatureHystrix.java

@@ -0,0 +1,26 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.SymptomFeatureClient;
+import com.diagbot.client.bean.Response;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/2/26 10:33
+ */
+@Component
+@Slf4j
+public class SymptomFeatureHystrix implements SymptomFeatureClient {
+
+    @Override
+    public  Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text) {
+        log.error("【hystrix】调用{}异常", "symptomFeaturePageData");
+        return null;
+    }
+}

+ 112 - 0
icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -0,0 +1,112 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.DoctorInfoDTO;
+import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.HospitalDeptInfoDTO;
+import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.dto.LisConfigDTO;
+import com.diagbot.dto.PatientInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TranFieldInfoDTO;
+import com.diagbot.entity.DoctorInfo;
+import com.diagbot.entity.HospitalDept;
+import com.diagbot.entity.PatientInfo;
+import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.HospitalDeptInfoVO;
+import com.diagbot.vo.HospitalInfoVO;
+import com.diagbot.vo.LisHospitalCodeVO;
+
+import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.TranFieldInfoVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 调用信息对接层服务
+ * @author: gaodm
+ * @time: 2019/2/1 17:00
+ */
+@Component
+@Slf4j
+public class TranServiceHystrix implements TranServiceClient {
+    @Override
+    public RespDTO<List<DoctorInfoDTO>> getDoctorInfo(@Valid DoctorInfoVO doctorInfoVo) {
+        log.error("【hystrix】调用{}异常", "getDoctorInfo");
+        return null;
+    }
+
+    @Override
+	public RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(List<Long> ids) {
+    	log.error("【hystrix】调用{}异常", "doctorInfoMapByIds");
+		return null;
+	}
+
+	@Override
+    public RespDTO<List<HospitalInfoDTO>> getHospitalInfo(HospitalInfoVO hospitalInfoVO) {
+        log.error("【hystrix】调用{}异常", "getHospitalInfo");
+        return null;
+    }
+
+    @Override
+    public RespDTO<HospitalDeptInfoDTO> getHospitalDeptInfo(HospitalDeptInfoVO hospitalDeptInfoVO) {
+        log.error("【hystrix】调用{}异常", "getHospitalDeptInfo");
+        return null;
+    }
+    
+    @Override
+	public RespDTO<Map<Long, HospitalDept>> hospitalDeptInfoMapByIds(List<Long> ids) {
+    	 log.error("【hystrix】调用{}异常", "hospitalDeptInfoMapByIds");
+		return null;
+	}
+
+	@Override
+    public RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(LisHospitalCodeVO lisHospitalCodeVO) {
+        log.error("【hystrix】调用{}异常", "getLisConfigByhospitalId");
+        return null;
+    }
+
+    @Override
+    public RespDTO<PatientInfoDTO> getPatientInfo(PatientInfoVO patientInfoVO) {
+        log.error("【hystrix】调用{}异常", "getPatientInfo");
+        return null;
+    }
+
+    @Override
+    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
+        log.error("【hystrix】调用{}异常", "getTopPatientInfo");
+        return null;
+    }
+    
+    @Override
+	public RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(List<Long> ids) {
+    	log.error("【hystrix】调用{}异常", "patientInfoMapByIds");
+		return null;
+	}
+
+	@Override
+    public RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(TranFieldInfoVO tranFieldInfoVO) {
+        log.error("【hystrix】调用{}异常", "getInfoByUuid");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(GetDiseaseIcdVO getDiseaseIcdVO) {
+        log.error("【hystrix】调用{}异常", "getDiseaseIcds");
+        return null;
+    }
+
+
+//    @Override
+//    public Response<ResponseData> bayesPageData(SearchData searchData) {
+//        log.error("【hystrix】调用{}异常", "bayesPageData");
+//        return null;
+//    }
+}

+ 15 - 0
icss-service/src/main/java/com/diagbot/dto/GetDiseaseIcdDTO.java

@@ -0,0 +1,15 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.DiseaseIcd;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/2/14 14:59
+ */
+@Getter
+@Setter
+public class GetDiseaseIcdDTO extends DiseaseIcd {
+}

+ 0 - 3
icss-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java

@@ -1,6 +1,3 @@
-/**
- * 
- */
 package com.diagbot.dto;
 
 import java.util.Date;

+ 15 - 0
icss-service/src/main/java/com/diagbot/dto/HospitalDeptInfoDTO.java

@@ -0,0 +1,15 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.HospitalDept;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/2/12 17:23
+ */
+@Setter
+@Getter
+public class HospitalDeptInfoDTO extends HospitalDept {
+}

+ 1 - 1
icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -29,7 +29,7 @@ public class QuestionDTO {
     private BigDecimal minValue; //最小值
     private BigDecimal maxValue; //最大值
     private Integer position;    //标签显示位置(0:在标签后,1:在标签前)
-    private Integer showAdd;    //是否显示+
+    private String showAdd;    //复制文字
     private Integer formPosition; //填写单显示位置(0:左, 1:上)
     private Integer textGenerate;  //文本生成规则
     private Integer symptomType; //主症状和伴随症状对应的question类型

+ 17 - 0
icss-service/src/main/java/com/diagbot/dto/SymptomFeatureDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/2/26 11:49
+ */
+@Getter
+@Setter
+public class SymptomFeatureDTO {
+    private Long id;
+    private String tagName;
+    private String name;
+}

+ 1 - 0
icss-service/src/main/java/com/diagbot/dto/TemplateInfoDTO.java

@@ -21,6 +21,7 @@ public class TemplateInfoDTO {
 	 private Long doctorId;//医生id
 	 private Long hospitalId;//医院id
 	 private Long hospitalDeptId;//部门id
+	 private Integer sex;//性别
 	 private String type;//模板类型
 	 private String  preview;//预览文字
 	 private String dataJson;//模板数据

+ 170 - 0
icss-service/src/main/java/com/diagbot/entity/DiseaseIcd.java

@@ -0,0 +1,170 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 各医院对应的诊断icd
+ * </p>
+ *
+ * @author wangyu
+ * @since 2019-02-14
+ */
+@TableName("tran_disease_icd")
+public class DiseaseIcd implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * icss疾病名称
+     */
+    private String diseaseName;
+
+    /**
+     * icd编码
+     */
+    private String icd;
+
+    /**
+     * 状态(1:有效)
+     */
+    private String status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getDiseaseName() {
+        return diseaseName;
+    }
+
+    public void setDiseaseName(String diseaseName) {
+        this.diseaseName = diseaseName;
+    }
+    public String getIcd() {
+        return icd;
+    }
+
+    public void setIcd(String icd) {
+        this.icd = icd;
+    }
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "DiseaseIcd{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", hospitalCode=" + hospitalCode +
+        ", diseaseName=" + diseaseName +
+        ", icd=" + icd +
+        ", status=" + status +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 2 - 2
icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -106,9 +106,9 @@ public class QuestionInfo implements Serializable {
     private Integer textGenerate;
 
     /**
-     * 是否显示 +
+     * 复制文字
      */
-    private Integer showAdd;
+    private String showAdd;
 
     /**
      * 是否显示 i

+ 15 - 1
icss-service/src/main/java/com/diagbot/entity/TemplateInfo.java

@@ -71,6 +71,10 @@ public class TemplateInfo implements Serializable {
      */
     private Long hospitalId;
 
+    /**
+     * 性别
+     */
+    private Integer sex;
     /**
      * 分类(1:结构化模板,2:文本输入模板)
      */
@@ -163,7 +167,16 @@ public class TemplateInfo implements Serializable {
     public void setHospitalId(Long hospitalId) {
         this.hospitalId = hospitalId;
     }
-    public String getType() {
+    
+    public Integer getSex() {
+		return sex;
+	}
+
+	public void setSex(Integer sex) {
+		this.sex = sex;
+	}
+
+	public String getType() {
         return type;
     }
 
@@ -205,6 +218,7 @@ public class TemplateInfo implements Serializable {
         ", doctorId=" + doctorId +
         ", hospitalDeptId=" + hospitalDeptId +
         ", hospitalId=" + hospitalId +
+        ", sex" + sex +
         ", type=" + type +
         ", preview=" + preview +
         ", dataJson=" + dataJson +

+ 16 - 8
icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -1,13 +1,18 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.DeptInfoDTO;
+import com.diagbot.dto.HospitalDeptInfoDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptInfo;
-import com.diagbot.entity.HospitalDept;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.DeptInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.DeptInfoVO;
+import com.diagbot.vo.HospitalDeptInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -20,7 +25,7 @@ import org.springframework.stereotype.Component;
 public class DeptInfoFacade extends DeptInfoServiceImpl {
 
     @Autowired
-    HospitalDeptFacade hospitalDeptFacade;
+    TranServiceClient tranServiceClient;
     /**
      * 获取科室信息
      *
@@ -28,14 +33,17 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
      * @return
      */
     public DeptInfoDTO getDeptInfo(DeptInfoVO deptInfoVO) {
-        QueryWrapper<HospitalDept> hospitalDeptQueryWrapper = new QueryWrapper<>();
-        hospitalDeptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_code",deptInfoVO.getHospitalCode())
-                .eq("code",deptInfoVO.getDeptCode());
-        HospitalDept hospitalDept = hospitalDeptFacade.getOne(hospitalDeptQueryWrapper);
+        HospitalDeptInfoVO hospitalDeptInfoVO = new HospitalDeptInfoVO();
+        BeanUtil.copyProperties(deptInfoVO,hospitalDeptInfoVO);
+        RespDTO<HospitalDeptInfoDTO> hospitalDeptInfoDTORespDTO = tranServiceClient.getHospitalDeptInfo(hospitalDeptInfoVO);
+        if (hospitalDeptInfoDTORespDTO == null
+                || !CommonErrorCode.OK.getCode().equals(hospitalDeptInfoDTORespDTO.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取科室信息失败");
+        }
         QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
         deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id",hospitalDept.getDeptId());
+                .eq("id",hospitalDeptInfoDTORespDTO.data.getDeptId());
         DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
         DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
         BeanUtil.copyProperties(deptInfo,deptInfoDTO);

+ 37 - 8
icss-service/src/main/java/com/diagbot/facade/DoctorInfoFacade.java

@@ -1,11 +1,18 @@
 package com.diagbot.facade;
 
-import com.diagbot.dto.DoctorInfoDTO;
-import com.diagbot.service.impl.DoctorInfoServiceImpl;
-import com.diagbot.vo.DoctorInfoVO;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.DoctorInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DoctorInfo;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.vo.DoctorInfoVO;
 
 /**
  * @Description:
@@ -13,8 +20,9 @@ import java.util.List;
  * @time: 2018/11/19 19:49
  */
 @Component
-public class DoctorInfoFacade extends DoctorInfoServiceImpl {
-
+public class DoctorInfoFacade {
+    @Autowired
+    private TranServiceClient tranServiceClient;
     /**
      * 获取医生信息
      *
@@ -22,7 +30,28 @@ public class DoctorInfoFacade extends DoctorInfoServiceImpl {
      * @return
      */
     public List<DoctorInfoDTO> getDoctorInfo(DoctorInfoVO doctorInfoVo) {
-        List<DoctorInfoDTO> doctorInfoDTOList = this.getDoctorInfos(doctorInfoVo.getDoctorCode(), doctorInfoVo.getHosptialCode(), doctorInfoVo.getDeptCode());
-        return doctorInfoDTOList;
+        RespDTO<List<DoctorInfoDTO>> doctorInfoDTOList = tranServiceClient.getDoctorInfo(doctorInfoVo);
+        if (doctorInfoDTOList == null
+                || !CommonErrorCode.OK.getCode().equals(doctorInfoDTOList.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取医生信息失败");
+        }
+        return doctorInfoDTOList.data;
+    }
+    
+    /**
+     * 根据ids获取医生信息map
+     * @param ids 医生ids
+     * @return 医生信息
+     */
+    public Map<Long, DoctorInfo> doctorInfoMapByIds(List<Long> ids) {
+    	 RespDTO<Map<Long, DoctorInfo>> retData = tranServiceClient.doctorInfoMapByIds(ids);
+         if (retData == null
+                 || !CommonErrorCode.OK.getCode().equals(retData.code)) {
+             throw new CommonException(CommonErrorCode.RPC_ERROR,
+                     "获取医生信息失败");
+         }
+         return retData.data;
     }
+    
 }

+ 65 - 0
icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.SymptomFeatureClient;
+import com.diagbot.client.bean.Response;
+import com.diagbot.dto.SymptomFeatureDTO;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.QuestionTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/2/26 13:27
+ */
+@Component
+public class FeatureFacade {
+    @Autowired
+    private SymptomFeatureClient symptomFeatureClient;
+    @Autowired
+    private QuestionFacade questionFacade;
+
+    /**
+     * 症状关键词提取
+     *
+     * @param text
+     * @return
+     */
+    public List<SymptomFeatureDTO> getSymptomFeature(String text) {
+        List<SymptomFeatureDTO> symptomFeatureDTOList = Lists.newLinkedList();
+        Response<List<Map<String, Object>>> res = symptomFeatureClient.symptomFeaturePageData(text);
+        if (null == res || null == res.getData()) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
+        }
+        List<Map<String, Object>> symptomFeatureList = res.getData();
+        List<String> symptomNameList = Lists.newLinkedList();
+        for (Map<String, Object> symptomFeature : symptomFeatureList) {
+            if (symptomFeature != null) {
+                symptomNameList.add(symptomFeature.get("feature_name").toString());
+            }
+        }
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                in("tag_name", symptomNameList).
+                eq("type", QuestionTypeEnum.Symptom.getKey()).
+                eq("item_type", 0);
+        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
+        for (QuestionInfo questionInfo : questionInfoList) {
+            SymptomFeatureDTO symptomFeatureDTO = new SymptomFeatureDTO();
+            symptomFeatureDTO.setId(questionInfo.getId());
+            symptomFeatureDTO.setTagName(questionInfo.getTagName());
+            symptomFeatureDTO.setName(questionInfo.getName());
+            symptomFeatureDTOList.add(symptomFeatureDTO);
+        }
+        return symptomFeatureDTOList;
+    }
+}

+ 29 - 2
icss-service/src/main/java/com/diagbot/facade/HospitalDeptFacade.java

@@ -1,14 +1,41 @@
 package com.diagbot.facade;
 
-import com.diagbot.service.impl.HospitalDeptServiceImpl;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.HospitalDept;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+
 /**
  * @author rgb
  * @Description
  * @time 2018年12月11日上午11:32:13
  */
 @Component
-public class HospitalDeptFacade extends HospitalDeptServiceImpl {
+public class HospitalDeptFacade {
+	
+	@Autowired
+    private TranServiceClient tranServiceClient;
+	
+	/**
+     * 根据ids获取科室信息map
+     * @param ids 科室ids
+     * @return 科室信息
+     */
+    public Map<Long, HospitalDept> hospitalDeptInfoMapByIds(List<Long> ids) {
+    	 RespDTO<Map<Long, HospitalDept>> retData = tranServiceClient.hospitalDeptInfoMapByIds(ids);
+         if (retData == null
+                 || !CommonErrorCode.OK.getCode().equals(retData.code)) {
+             throw new CommonException(CommonErrorCode.RPC_ERROR,
+                     "获取科室信息失败");
+         }
+         return retData.data;
+    }
 
 }

+ 31 - 17
icss-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java

@@ -1,15 +1,16 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.dto.HospitalInfoDTO;
-import com.diagbot.entity.HospitalInfo;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.enums.StatusEnum;
-import com.diagbot.service.impl.HospitalInfoServiceImpl;
-import com.diagbot.vo.HospitalInfoVO;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.vo.HospitalInfoVO;
 
 /**
  * @Description:
@@ -17,7 +18,10 @@ import java.util.List;
  * @time: 2018/11/22 13:43
  */
 @Component
-public class HospitalInfoFacade extends HospitalInfoServiceImpl {
+public class HospitalInfoFacade {
+
+    @Autowired
+    TranServiceClient tranServiceClient;
 
     /**
      * 获取医院信息
@@ -26,8 +30,13 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
      * @return
      */
     public List<HospitalInfoDTO> getHospitalInfo(HospitalInfoVO hospitalInfoVO) {
-        List<HospitalInfoDTO> hospitalInfoDTOList = this.getHospitalInfos(hospitalInfoVO);
-        return hospitalInfoDTOList;
+        RespDTO<List<HospitalInfoDTO>> hospitalInfoDTOList = tranServiceClient.getHospitalInfo(hospitalInfoVO);
+        if (hospitalInfoDTOList == null
+                || !CommonErrorCode.OK.getCode().equals(hospitalInfoDTOList.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取医院信息失败");
+        }
+        return hospitalInfoDTOList.data;
     }
 
     /**
@@ -36,12 +45,17 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
      * @param code 医院编码
      * @return
      */
-    public HospitalInfo getHospitalByCode(String code) {
-        QueryWrapper<HospitalInfo> queryWrapper = new QueryWrapper<HospitalInfo>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        queryWrapper.eq("code", code);
-        queryWrapper.eq("status", StatusEnum.Enable.getKey());
-        return this.getOne(queryWrapper);
+    public HospitalInfoDTO getHospitalByCode(String code) {
+    	HospitalInfoVO hospitalInfoVO = new HospitalInfoVO();
+    	hospitalInfoVO.setCode(code);
+    	RespDTO<List<HospitalInfoDTO>> hospitalInfoDTOList = tranServiceClient.getHospitalInfo(hospitalInfoVO);
+        if (hospitalInfoDTOList == null
+                || !CommonErrorCode.OK.getCode().equals(hospitalInfoDTOList.code)
+                ||hospitalInfoDTOList.data.size()!=1) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取医院信息失败");
+        }
+        return hospitalInfoDTOList.data.get(0);
     }
 
 }

+ 14 - 9
icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -16,11 +16,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.GetInquiryDetailDTO;
 import com.diagbot.dto.GetLastOtherDTO;
 import com.diagbot.dto.HisInquiryDTO;
+import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.ReadInquiryDTO;
 import com.diagbot.dto.SaveInquiryDTO;
 import com.diagbot.entity.DoctorInfo;
 import com.diagbot.entity.HospitalDept;
-import com.diagbot.entity.HospitalInfo;
 import com.diagbot.entity.InquiryDetail;
 import com.diagbot.entity.InquiryInfo;
 import com.diagbot.entity.PatientInfo;
@@ -32,6 +33,7 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.vo.GetInquiryDetailVO;
 import com.diagbot.vo.GetLastOtherVO;
 import com.diagbot.vo.HisInquirysVO;
+import com.diagbot.vo.PatientInfoVO;
 import com.diagbot.vo.ReadInquiryVO;
 import com.diagbot.vo.SaveInquiryDetailVO;
 import com.diagbot.vo.SaveInquiryVO;
@@ -55,7 +57,6 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     @Autowired
     private HospitalDeptFacade hospitalDeptFacade;
 
-
     /**
      * 问诊记录保存
      *
@@ -157,12 +158,16 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     public GetLastOtherDTO getLastOther(GetLastOtherVO getLastOtherVO) {
     	GetLastOtherDTO getLastOtherDTO = new GetLastOtherDTO();
     	
-        HospitalInfo hospitalInfo = hospitalInfoFacade.getHospitalByCode(getLastOtherVO.getHospitalCode());
-        PatientInfo patientInfo = patientInfoFacade.getPatientByCode(getLastOtherVO.getHospitalCode(), getLastOtherVO.getPatientCode());
+    	HospitalInfoDTO hospitalInfoDTO = hospitalInfoFacade.getHospitalByCode(getLastOtherVO.getHospitalCode());
+    	
+    	PatientInfoVO patientInfoVO = new PatientInfoVO();
+    	patientInfoVO.setHospitalCode(getLastOtherVO.getHospitalCode());
+    	patientInfoVO.setPatientCode(getLastOtherVO.getPatientCode());
+    	PatientInfoDTO patientInfoDTO = patientInfoFacade.getPatientInfo(patientInfoVO);
 
         Map<String, Object> map = new HashMap<>();
-        map.put("hospitalId", hospitalInfo.getId());
-        map.put("patientId", patientInfo.getId());
+        map.put("hospitalId", hospitalInfoDTO.getId());
+        map.put("patientId", patientInfoDTO.getId());
         map.put("sign", getLastOtherVO.getSign());
         InquiryInfo inquiryInfo = baseMapper.getPatientLast(map);
 
@@ -226,9 +231,9 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         List<Long> patientIdList = inquiryInfoList.stream().map(i -> i.getPatientId()).collect(Collectors.toList());
         List<Long> inquiryIdList = inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList());
 
-        Map<Long, HospitalDept> hospitalDeptMap = hospitalDeptFacade.listByIds(hospitalDeptIdList).stream().filter(i -> i.getIsDeleted().equals("N") && i.getStatus() == 1).collect(Collectors.toMap(HospitalDept::getId, i -> i));
-        Map<Long, DoctorInfo> doctorInfoMap = doctorInfoFacade.listByIds(doctorIdList).stream().filter(i -> i.getIsDeleted().equals("N")).collect(Collectors.toMap(DoctorInfo::getId, i -> i));
-        Map<Long, PatientInfo> patientInfoMap = patientInfoFacade.listByIds(patientIdList).stream().filter(i -> i.getIsDeleted().equals("N")).collect(Collectors.toMap(PatientInfo::getId, i -> i));
+        Map<Long, HospitalDept> hospitalDeptMap = hospitalDeptFacade.hospitalDeptInfoMapByIds(hospitalDeptIdList);
+        Map<Long, DoctorInfo> doctorInfoMap = doctorInfoFacade.doctorInfoMapByIds(doctorIdList);
+        Map<Long, PatientInfo> patientInfoMap = patientInfoFacade.patientInfoMapByIds(patientIdList);
         Map<Long, List<InquiryDetail>> inquiryDetailMap = inquiryDetailFacade.getDetailsByInquryIds(inquiryIdList);
 
         List<HisInquiryDTO> hisInquiryDTOList = new ArrayList<>();

+ 34 - 21
icss-service/src/main/java/com/diagbot/facade/LisExcelResFacade.java

@@ -1,13 +1,15 @@
 package com.diagbot.facade;
 
-import com.diagbot.dto.LisConfigDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.util.StringUtil;
-import com.diagbot.vo.LisExcelResVO;
-import com.diagbot.vo.LisExcelWrapperVO;
-import com.diagbot.vo.LitAssayVO;
+import java.io.InputStream;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.commons.lang.time.DateFormatUtils;
 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -20,14 +22,16 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
-import java.io.InputStream;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.LisConfigDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.LisExcelResVO;
+import com.diagbot.vo.LisExcelWrapperVO;
+import com.diagbot.vo.LisHospitalCodeVO;
+import com.diagbot.vo.LitAssayVO;
 
 /**
  * @author wangfeng
@@ -37,10 +41,12 @@ import java.util.stream.Collectors;
 @Component
 public class LisExcelResFacade {
 
+	/*@Autowired
+	LisConfigFacade lisConfigFacade;*/
 	@Autowired
-	LisConfigFacade lisConfigFacade;
+	TranServiceClient tranServiceClient;
 
-	public RespDTO<LitAssayVO> lisExcelAnalysis(MultipartFile file, String hospitalCode, HttpServletRequest request) {
+	public RespDTO<LitAssayVO> lisExcelAnalysis(MultipartFile file, LisHospitalCodeVO lisHospitalCodeVO, HttpServletRequest request) {
 
 		List<String> messages = new ArrayList<>();
 		List<LisExcelWrapperVO> lisExcelWrapperList = new ArrayList<>();
@@ -105,7 +111,7 @@ public class LisExcelResFacade {
 
 									lisExcelWrapper.setMealName(mealName);
 									lisExcelWrapper.setItemName(itemName);
-									// lisExcelWrapper.setUniqueName(uniqueName);
+									//  lisExcelWrapper.setUniqueName(uniqueName);
 									lisExcelWrapper.setUnit(unit);
 									lisExcelWrapper.setValue(value);
 									lisExcelWrapper.setMax(max);
@@ -137,7 +143,13 @@ public class LisExcelResFacade {
 				messages.add("无文件上传!");
 			}
 			//匹配公表名
-			List<LisConfigDTO> litData = lisConfigFacade.getLisConfigByhospitalId(hospitalCode);
+			RespDTO<List<LisConfigDTO>> litDatas = tranServiceClient.getLisConfigByhospitalId(lisHospitalCodeVO);
+			 if (litDatas == null || !"0".equals(litDatas.code)) {
+	                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+	                        "获取匹配公表名信息失败");
+	            }
+	        List<LisConfigDTO> litData = litDatas.data;
+	        //导入的数据跟公表数据进行配对
 			if(litData.size()>0){
 				List<LisExcelWrapperVO> lisExcelWrapperListNew = new ArrayList<>();
 				for (LisExcelWrapperVO lisExcelWrapperNew : lisExcelWrapperList) {
@@ -154,7 +166,7 @@ public class LisExcelResFacade {
 				lisExcelWrapperList = lisExcelWrapperListNew;
 			}
 			
-
+			
 			Map<String, List<LisExcelWrapperVO>> lixExMap = lisExcelWrapperList.stream()
 					.collect(Collectors.groupingBy(LisExcelWrapperVO::getMealName));
 			List<LisExcelResVO> LisExcelReslist = new ArrayList<LisExcelResVO>();
@@ -162,6 +174,7 @@ public class LisExcelResFacade {
 				LisExcelResVO lisExcelResVO = new LisExcelResVO();
 				lisExcelResVO.setMenus(str);
 				lisExcelResVO.setLisExcelItem(lixExMap.get(str));
+				
 				LisExcelReslist.add(lisExcelResVO);
 			}
 

+ 41 - 25
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,19 +1,25 @@
 package com.diagbot.facade;
 
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DoctorPageMode;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.PatientInfoServiceImpl;
-import com.diagbot.util.DateUtil;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * @Description: 患者业务逻辑
@@ -21,12 +27,14 @@ import org.springframework.web.bind.annotation.RequestBody;
  * @time: 2018/11/19 13:19
  */
 @Component
-public class PatientInfoFacade extends PatientInfoServiceImpl {
+public class PatientInfoFacade {
 
     @Autowired
     private DoctorPageModeFacade doctorPageModeFacade;
     @Autowired
     private DeptInfoFacade deptInfoFacade;
+    @Autowired
+    TranServiceClient tranServiceClient;
 
     /**
      * 获取患者信息
@@ -34,9 +42,14 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      * @param patientInfoVO
      * @return
      */
-    public PatientInfoDTO getPatientInfo(@RequestBody PatientInfoVO patientInfoVO) {
-        PatientInfoDTO patientInfoDTO = this.getPatientInfos(patientInfoVO.getPatientCode(), patientInfoVO.getHospitalCode());
-        return patientInfoDTO;
+    public PatientInfoDTO getPatientInfo(PatientInfoVO patientInfoVO) {
+        RespDTO<PatientInfoDTO> patientInfoDTO = tranServiceClient.getPatientInfo(patientInfoVO);
+        if (patientInfoDTO == null
+                || !CommonErrorCode.OK.getCode().equals(patientInfoDTO.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取患者信息失败");
+        }
+        return patientInfoDTO.data;
     }
 
     /**
@@ -46,10 +59,13 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      * @return
      */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
-        GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
-        getTopPatientInfoDTO.setSystemTime(DateUtil.now());
-        getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
-        getTopPatientInfoDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDTO.getBirthday(), DateUtil.now()));
+        RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
+        if (respDTO == null || !"0".equals(respDTO.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "页面顶部病人医生科室信息");
+        }
+
+        GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
         QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
         deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -69,20 +85,20 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
         }
         return getTopPatientInfoDTO;
     }
-
+    
     /**
-     * 通过医院编码、病人编码获取病人信息
-     *
-     * @param hospitalCode 医院编码
-     * @param patientCode  病人编码
-     * @return
+     * 根据ids获取病人信息
+     * @param ids 病人ids
+     * @return 病人信息
      */
-    public PatientInfo getPatientByCode(String hospitalCode, String patientCode) {
-        QueryWrapper<PatientInfo> queryWrapper = new QueryWrapper<PatientInfo>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        queryWrapper.eq("hospital_code", hospitalCode);
-        queryWrapper.eq("code", patientCode);
-        return this.getOne(queryWrapper);
+    public Map<Long, PatientInfo> patientInfoMapByIds(List<Long> ids) {
+    	 RespDTO<Map<Long, PatientInfo>> retData = tranServiceClient.patientInfoMapByIds(ids);
+         if (retData == null
+                 || !CommonErrorCode.OK.getCode().equals(retData.code)) {
+             throw new CommonException(CommonErrorCode.RPC_ERROR,
+                     "获取患者信息失败");
+         }
+         return retData.data;
     }
 
 }

+ 4 - 2
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -193,7 +193,9 @@ public class PushFacade {
             List<String> diseaseNameList = dis.stream().map(disease -> disease.getFeatureName()).collect(Collectors.toList());
             Map<String, String> highRiskMap = new HashMap<>();
             highRiskMap.put("disease", String.join(",", diseaseNameList));
-            Response<GdbResponse> graphRes = highRiskServiceClient.highRiskPageData(highRiskMap);
+            SearchData searchData = new SearchData();
+            searchData.setDiag(String.join(",", diseaseNameList));
+            Response<GdbResponse> graphRes = highRiskServiceClient.highRiskPageData(searchData);
             if (graphRes != null) {
                 Map<String, String> graphResult = graphRes.getData().getResult();
                 if (graphResult.size() > 0) {
@@ -423,7 +425,7 @@ public class PushFacade {
                 orderByAsc("order_no");
         List<DeptVital> deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
         //科室模板为空时,取全科模板
-        if(deptVitalList.size()==0) {
+        if (deptVitalList.size() == 0) {
             deptVitalQueryWrapper = new QueryWrapper<>();
             String sql = "select id from icss_dept_info where name='全科' and is_deleted='N'";
             deptVitalQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).

+ 6 - 4
icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -121,7 +121,9 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
             questionVO.setAge(questionIdsVO.getAge());
             questionVO.setSexType(questionIdsVO.getSexType());
             QuestionDTO item = this.getById(questionVO);
-            data.put(item.getId(), item);
+            if (item != null && item.getId() != null) {
+                data.put(item.getId(), item);
+            }
         }
         return data;
     }
@@ -131,12 +133,12 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
      *
      * @return
      */
-    public Map<Long,QuestionInfo> getQuestionInfos(List<Long> questionIdList){
+    public Map<Long, QuestionInfo> getQuestionInfos(List<Long> questionIdList) {
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-            .in("id",questionIdList);
+                .in("id", questionIdList);
         List<QuestionInfo> questionInfoList = this.list(questionInfoQueryWrapper);
-        Map<Long,QuestionInfo> map = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId,questionInfo -> questionInfo));
+        Map<Long, QuestionInfo> map = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
         return map;
     }
 }

+ 21 - 3
icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -9,6 +9,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -36,14 +37,31 @@ public class RetrievalFacade extends RetrievalServiceImpl {
         }
         //获取同义词标签信息
         List<RetrievalDTO> data = this.getSymptopInfo(retrievalVO);
-        List<Long> questionIdList = data.stream()
+        List<Long> selfIds = new ArrayList<>();
+        for (RetrievalDTO bean : data) {//筛选本身的id
+            if ((1 == bean.getShowType())
+                    && !selfIds.contains(bean.getQuestionId())) {
+                selfIds.add(bean.getQuestionId());
+            }
+        }
+        List<RetrievalDTO> resultSubitemData = new ArrayList<>();
+        for (RetrievalDTO bean : data) {//当出现本体和同义词时,不显示同义词
+            if (1 == bean.getShowType()) {
+                resultSubitemData.add(bean);
+            } else {
+                if (!selfIds.contains(bean.getQuestionId())) {
+                    resultSubitemData.add(bean);
+                }
+            }
+        }
+        List<Long> questionIdList = resultSubitemData.stream()
                 .map(r -> r.getQuestionId())
                 .collect(Collectors.toList());
         //将标签名放入实体
         Map<Long, QuestionInfo> map = questionFacade.getQuestionInfos(questionIdList);
-        for (RetrievalDTO retrievalDTO : data) {
+        for (RetrievalDTO retrievalDTO : resultSubitemData) {
             retrievalDTO.setName(map.get(retrievalDTO.getQuestionId()).getTagName());
         }
-        return data;
+        return resultSubitemData;
     }
 }

+ 6 - 1
icss-service/src/main/java/com/diagbot/facade/TemplateInfoFacade.java

@@ -44,7 +44,11 @@ public class TemplateInfoFacade extends TemplateInfoServiceImpl {
         mapAll.put("hospital_id", templateInfoVO.getHospitalId());
         mapAll.put("is_deleted", IsDeleteEnum.N.getKey());
         mapAll.put("type", templateInfoVO.getType());
-        templateInfoQuery.allEq(mapAll).orderByDesc("gmt_create");
+        if(templateInfoVO.getSex()!=null){
+        	templateInfoQuery.allEq(mapAll).in("sex", 3,templateInfoVO.getSex()).orderByDesc("gmt_create");
+        }else {
+        	templateInfoQuery.allEq(mapAll).orderByDesc("gmt_create");
+		} 
         List<TemplateInfoDTO> data = new ArrayList<TemplateInfoDTO>();
         List<TemplateInfo> datas = list(templateInfoQuery);
 		//过滤
@@ -124,6 +128,7 @@ public class TemplateInfoFacade extends TemplateInfoServiceImpl {
         templateInfo.setGmtCreate(DateUtil.now());//创建时间
         templateInfo.setHospitalDeptId(templateInfosVO.getHospitalDeptId());//部门id
         templateInfo.setHospitalId(templateInfosVO.getHospitalId());//医院id
+        templateInfo.setSex(templateInfosVO.getSex());
         templateInfo.setPreview(GsonUtil.toJson(templateInfosVO.getPreview()));//文本的展示
         templateInfo.setDataJson(templateInfosVO.getDataJson());//页面json
         templateInfo.setName(templateInfosVO.getModeName());//模板名称

+ 0 - 0
icss-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java


Vissa filer visades inte eftersom för många filer har ändrats