Bläddra i källkod

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

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

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

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

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

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

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

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

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

@@ -0,0 +1,94 @@
+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
+

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

@@ -0,0 +1,94 @@
+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
+

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

@@ -0,0 +1,94 @@
+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
+

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

@@ -0,0 +1,94 @@
+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
+

+ 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:

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

@@ -8,7 +8,7 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/sys-icss?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.236:3306/sys-icssman?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: lantone
       # 连接池的配置信息

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

@@ -8,7 +8,7 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/sys-icss?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.236:3306/sys-icssman?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: lantone
       # 连接池的配置信息

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

@@ -8,7 +8,7 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/sys-icss?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.236:3306/sys-icssman?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: lantone
       # 连接池的配置信息

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

@@ -8,7 +8,7 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.241:3306/sys-icss?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.241:3306/sys-icssman?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: lantone
       # 连接池的配置信息

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

+ 5 - 3
icss-service/src/main/java/com/diagbot/client/bean/ResponseData.java

@@ -1,5 +1,7 @@
 package com.diagbot.client.bean;
 
+import com.alibaba.fastjson.JSONObject;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -17,7 +19,7 @@ public class ResponseData {
     private List<FeatureRate> labs = new ArrayList<>(10);
     private List<FeatureRate> pacs = new ArrayList<>(10);
     private List<FeatureRate> history=new ArrayList<>(10);
-    private Map<String,String> treat;
+    private Map<String, JSONObject> treat;
 
     private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.5f);
 
@@ -78,11 +80,11 @@ public class ResponseData {
         this.history = history;
     }
 
-    public Map<String, String> getTreat() {
+    public Map<String, JSONObject> getTreat() {
         return treat;
     }
 
-    public void setTreat(Map<String, String> treat) {
+    public void setTreat(Map<String, JSONObject> treat) {
         this.treat = treat;
     }
 

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

+ 30 - 0
icss-service/src/main/java/com/diagbot/dto/GetLastOtherDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/01/14 45:00
+ */
+@ApiModel(value="获取最近一次其他史信息接口出参")
+@Getter
+@Setter
+public class GetLastOtherDTO {
+	
+	/**
+	 * 内容JSON字符串
+	 */
+	@ApiModelProperty(value="内容JSON字符串")
+	private String dataJson;
+	
+	/**
+	 * 问诊明细中的其他史
+	 */
+	@ApiModelProperty(value="问诊明细中的其他史")
+	private String otherStr;
+	
+}

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

@@ -1,6 +1,3 @@
-/**
- * 
- */
 package com.diagbot.dto;
 
 import java.util.Date;
@@ -131,6 +128,13 @@ public class GetTopPatientInfoDTO {
 	@ApiModelProperty(value="系统时间")
 	private Date systemTime;
 	
+	/**
+     * 出生日期
+     */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value="出生日期")
+    private Date birthday;
+	
 	/**
      * 门诊号
      */

+ 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 - 0
icss-service/src/main/java/com/diagbot/dto/IntroduceDTO.java

@@ -16,4 +16,5 @@ import java.util.List;
 @Setter
 public class IntroduceDTO extends IntroduceInfo {
     private List<IntroduceDetail> introduceDetailList;
+    private String tagName;
 }

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

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

@@ -8,22 +8,24 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
-import com.diagbot.enums.IsDeleteEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 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;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.SexTypeEnum;
 import com.diagbot.service.impl.InquiryInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
@@ -31,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;
@@ -54,7 +57,6 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     @Autowired
     private HospitalDeptFacade hospitalDeptFacade;
 
-
     /**
      * 问诊记录保存
      *
@@ -153,21 +155,34 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
      * @param getLastOtherVO
      * @return
      */
-    public String getLastOther(GetLastOtherVO getLastOtherVO) {
-        HospitalInfo hospitalInfo = hospitalInfoFacade.getHospitalByCode(getLastOtherVO.getHospitalCode());
-        PatientInfo patientInfo = patientInfoFacade.getPatientByCode(getLastOtherVO.getHospitalCode(), getLastOtherVO.getPatientCode());
+    public GetLastOtherDTO getLastOther(GetLastOtherVO getLastOtherVO) {
+    	GetLastOtherDTO getLastOtherDTO = new GetLastOtherDTO();
+    	
+    	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);
 
         if (inquiryInfo != null) {
-        	return inquiryInfo.getDataJson();
-        }else{
-        	return null;
+        	getLastOtherDTO.setDataJson(inquiryInfo.getDataJson());
+        	
+        	QueryWrapper<InquiryDetail> inquiryDetailQe = new QueryWrapper<>();
+            inquiryDetailQe.eq("inquiry_id", inquiryInfo.getId());
+            inquiryDetailQe.eq("type", 3);
+            InquiryDetail inquiryDetail = inquiryDetailFacade.getOne(inquiryDetailQe);
+            if(inquiryDetail!=null){
+            	getLastOtherDTO.setOtherStr(inquiryDetail.getContent());
+            }
         }
+        return getLastOtherDTO;
     }
 
     /**
@@ -216,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<>();

+ 8 - 1
icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -40,9 +40,14 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
      * @return
      */
     public IntroduceDTO getByQuestionId(IntroduceByQuestionVO introduceByQuestionVO) {
-        if (introduceByQuestionVO.getQuestionId() == null) {
+        Long questionId = introduceByQuestionVO.getQuestionId();
+        if (questionId == null) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入标签id");
         }
+        QuestionInfo questionInfo = questionFacade.getById(questionId);
+        if (questionInfo == null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "未找到标签");
+        }
         QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
         introduceMapQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
                 eq("question_id", introduceByQuestionVO.getQuestionId()).
@@ -53,6 +58,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         }
 
         IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
+        introduceDTO.setTagName(questionInfo.getTagName());
         return introduceDTO;
     }
 
@@ -85,6 +91,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         }
 
         IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
+        introduceDTO.setTagName(questionInfo.getTagName());
         return introduceDTO;
     }
 

+ 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 - 24
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,9 +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());
+        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())
@@ -68,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;
     }
 
 }

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

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.AIServiceClient;
 import com.diagbot.client.HighRiskServiceClient;
@@ -59,8 +60,6 @@ public class PushFacade {
     @Autowired
     private DeptVitalFacade deptVitalFacade;
     @Autowired
-    private VitalOrderFacade vitalOrderFacade;
-    @Autowired
     private TreatmentFacade treatmentFacade;
     @Autowired
     private HighRiskServiceClient highRiskServiceClient;
@@ -145,7 +144,7 @@ public class PushFacade {
         List<FeatureRate> pacs = data.getPacs();
         List<FeatureRate> labs = data.getLabs();
         List<FeatureRate> other = data.getHistory();
-        Map<String, String> treat = data.getTreat();
+        Map<String, JSONObject> treat = data.getTreat();
 
         Map<String, Object> symptomMap = list2Map(symptom);
         Map<String, Object> labMap = list2Map(labs);
@@ -194,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) {
@@ -409,6 +410,7 @@ public class PushFacade {
         if (deptInfo == null) {
             //科室信息不存在时推全科模板
             deptName = "全科";
+            deptInfoQueryWrapper = new QueryWrapper<>();
             deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
                     eq("name", deptName);
             deptInfo = deptInfoFacade.getOne(deptInfoQueryWrapper);
@@ -422,6 +424,15 @@ public class PushFacade {
                 eq("dept_id", deptInfo.getId()).
                 orderByAsc("order_no");
         List<DeptVital> deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
+        //科室模板为空时,取全科模板
+        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()).
+                    inSql("dept_id", sql).
+                    orderByAsc("order_no");
+            deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
+        }
         //标签列表
         for (DeptVital deptVital : deptVitalList) {
             QuestionVO questionVO = new QuestionVO();

+ 7 - 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,11 +133,12 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
      *
      * @return
      */
-    public Map<Long,QuestionInfo> getQuestionInfos(){
+    public Map<Long, QuestionInfo> getQuestionInfos(List<Long> questionIdList) {
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .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;
     }
 }

+ 27 - 4
icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -9,8 +9,10 @@ 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;
 
 /**
  * @Description:
@@ -22,6 +24,7 @@ public class RetrievalFacade extends RetrievalServiceImpl {
 
     @Autowired
     QuestionFacade questionFacade;
+
     /**
      * 获取标签信息
      *
@@ -29,16 +32,36 @@ public class RetrievalFacade extends RetrievalServiceImpl {
      * @return
      */
     public List<RetrievalDTO> getTagInfos(@Valid @RequestBody RetrievalVO retrievalVO) {
-        if(retrievalVO.getInputStr() == null || retrievalVO.getInputStr() == ""){
+        if (retrievalVO.getInputStr() == null || retrievalVO.getInputStr() == "") {
             retrievalVO.setInputStr(" ");
         }
         //获取同义词标签信息
         List<RetrievalDTO> data = this.getSymptopInfo(retrievalVO);
+        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();
-        for (RetrievalDTO retrievalDTO:data) {
+        Map<Long, QuestionInfo> map = questionFacade.getQuestionInfos(questionIdList);
+        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());//模板名称

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

@@ -0,0 +1,40 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.vo.GetDiseaseIcdVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/2/14 15:25
+ */
+@Component
+public class TranDiseaseIcdFacade {
+
+    @Autowired
+    TranServiceClient tranServiceClient;
+
+    /**
+     * 根据医院编号和诊断ids获取各自的icd编码
+     *
+     * @param getDiseaseIcdVO
+     * @return
+     */
+    public List<GetDiseaseIcdDTO> getDiseaseIcds(GetDiseaseIcdVO getDiseaseIcdVO) {
+        RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcdsList =  tranServiceClient.getDiseaseIcds(getDiseaseIcdVO);
+        if (getDiseaseIcdsList == null
+                || !CommonErrorCode.OK.getCode().equals(getDiseaseIcdsList.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取icd编码失败");
+        }
+        return getDiseaseIcdsList.data;
+    }
+}

+ 11 - 8
icss-service/src/main/java/com/diagbot/facade/TranFieldInfoFacade.java

@@ -1,11 +1,12 @@
 package com.diagbot.facade;
 
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.TranFieldInfoDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.TranFieldInfoServiceImpl;
-import com.diagbot.util.ListUtil;
 import com.diagbot.vo.TranFieldInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -16,8 +17,10 @@ import java.util.List;
  * @time: 2018/11/21 14:13
  */
 @Component
-public class TranFieldInfoFacade extends TranFieldInfoServiceImpl {
+public class TranFieldInfoFacade {
 
+    @Autowired
+    TranServiceClient tranServiceClient;
 
     /**
      * 根据uuid获取相关信息
@@ -26,11 +29,11 @@ public class TranFieldInfoFacade extends TranFieldInfoServiceImpl {
      * @return
      */
     public List<TranFieldInfoDTO> getInfoByUuid(TranFieldInfoVO info) {
-        List<TranFieldInfoDTO> tranFieldInfoDTOList = this.getInfosByUuid(info);
-        if (ListUtil.isEmpty(tranFieldInfoDTOList)) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "获取信息失败");
+        RespDTO<List<TranFieldInfoDTO>> tranFieldInfoDTOList = tranServiceClient.getInfoByUuid(info);
+        if (tranFieldInfoDTOList == null || !CommonErrorCode.OK.getCode().equals(tranFieldInfoDTOList.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "获取医生信息失败");
         }
-        return tranFieldInfoDTOList;
+        return tranFieldInfoDTOList.data;
     }
 }

+ 15 - 7
icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.TreatServiceClient;
 import com.diagbot.client.bean.Medicition;
@@ -14,7 +15,6 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
-import com.diagbot.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -46,12 +46,15 @@ public class TreatmentFacade {
      * @param
      * @return
      */
-    public Map<String, Object> getTreatment(Map<String, String> treatmentMap, Long diseaseId) {
+    public Map<String, Object> getTreatment(Map<String, JSONObject> treatmentMap, Long diseaseId) {
         Map<String, Object> retMap = new LinkedHashMap<>();
         QuestionInfo disease = questionFacade.getById(diseaseId);
         if (disease == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "诊断不存在");
         }
+        if (treatmentMap.size() == 0) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "未找到治疗方案");
+        }
         if (!treatmentMap.containsKey(disease.getTagName())) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "诊断名称和id不匹配");
         }
@@ -65,14 +68,19 @@ public class TreatmentFacade {
         retMap.put("surgeryTreatment", surgeryTreatmentDetailList.size() > 0 ? surgeryTreatmentDetailList.get(0).getContent() : "");
 
         //获取知识图谱治疗方案
-        String treatment = treatmentMap.get(disease.getTagName());
-        if (StringUtil.isBlank(treatment)) {
+        JSONObject treatmentJson = treatmentMap.get(disease.getTagName());
+        if (treatmentJson == null || treatmentJson.isEmpty()) {
             return retMap;
         }
 
-        List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatment, "treatment", MedicitionClass.class);
+        /*JSONObject treatmentJson = diseaseJson.getJSONObject(disease.getTagName());
+        if (treatmentJson == null || treatmentJson.isEmpty()) {
+            return retMap;
+        }*/
+
+        List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
 
-        List<String> classNameList = drugsList.stream().map(drugs -> drugs.getDrugsName()).collect(Collectors.toList());
+        List<String> classNameList = drugsList.stream().map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
         List<QuestionInfo> drugClassList = getTopQuestionList(classNameList, QuestionTypeEnum.DrugClass.getKey());
         Map<String, QuestionInfo> drugClassMap = EntityUtil.makeEntityMap(drugClassList, "tagName");
         List<Long> drugClassIds = drugClassList.stream().map(drugClass -> drugClass.getId()).collect(Collectors.toList());
@@ -80,7 +88,7 @@ public class TreatmentFacade {
         Map<Long, IntroduceMap> introduceMapMap = EntityUtil.makeEntityMap(introduceMapList, "questionId");
 
         for (MedicitionClass medicitionClass : drugsList) {
-            QuestionInfo drugClass = drugClassMap.get(medicitionClass.getDrugsName());
+            QuestionInfo drugClass = drugClassMap.get(medicitionClass.getBigdrugsName());
             if (drugClass != null) {
                 medicitionClass.setId(drugClass.getId());
                 if (introduceMapMap.get(drugClass.getId()) != null) {

+ 0 - 20
icss-service/src/main/java/com/diagbot/service/impl/LisConfigServiceImpl.java

@@ -1,20 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.diagbot.entity.LisConfig;
-import com.diagbot.mapper.LisConfigMapper;
-import com.diagbot.service.LisConfigService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 套餐字段映射公表 服务实现类
- * </p>
- *
- * @author wangfeng
- * @since 2018-12-25
- */
-@Service
-public class LisConfigServiceImpl extends ServiceImpl<LisConfigMapper, LisConfig> implements LisConfigService {
-
-}

+ 18 - 0
icss-service/src/main/java/com/diagbot/vo/GetDiseaseIcdVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/2/14 14:56
+ */
+@Getter
+@Setter
+public class GetDiseaseIcdVO {
+    //疾病id
+    private String questions;
+    //医院编码
+    private String hospitalCode;
+}

+ 0 - 3
icss-service/src/main/java/com/diagbot/vo/GetTopPatientInfoVO.java

@@ -1,6 +1,3 @@
-/**
- * 
- */
 package com.diagbot.vo;
 
 import javax.validation.constraints.NotBlank;

+ 20 - 0
icss-service/src/main/java/com/diagbot/vo/HospitalDeptInfoVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/2/12 17:24
+ */
+@Getter
+@Setter
+public class HospitalDeptInfoVO {
+    @NotNull(message = "请输入科室编码")
+    private String deptCode;
+    @NotNull(message = "请输入医院编码")
+    private String hospitalCode;
+}

+ 2 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfoVO.java

@@ -29,4 +29,6 @@ public class TemplateInfoVO {
 	
 	@NotBlank(message = "请输入模板类型")
 	private String type;//模板类型
+	
+	private Integer sex;//性别
 }

+ 2 - 0
icss-service/src/main/java/com/diagbot/vo/TemplateInfosVO.java

@@ -23,6 +23,8 @@ public class TemplateInfosVO {
 	private Long hospitalId;//医院id
 	@NotNull(message = "请输入部门id")
 	private Long hospitalDeptId;//部门id
+	@NotNull(message = "请输入性别")
+	private Integer sex;//性别
 	@NotBlank(message = "请输入模板类型")
 	private String modeType;//模板类型
 	@NotNull(message = "请输入预览文本")

+ 1 - 2
icss-service/src/main/java/com/diagbot/web/DeptInfoController.java

@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
 
@@ -29,7 +28,7 @@ import javax.validation.Valid;
 @RequestMapping("/deptInfo")
 @Api(value = "科室信息API", tags = { "科室信息API" })
 @SuppressWarnings("unchecked")
-@ApiIgnore
+/*@ApiIgnore*/
 public class DeptInfoController {
 
     @Autowired

+ 0 - 0
icss-service/src/main/java/com/diagbot/web/DoctorInfoController.java


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