Browse Source

Merge branch 'master' into 122run

# Conflicts:
#	pom.xml
gaodm 4 years ago
parent
commit
65208f2f01
100 changed files with 12011 additions and 0 deletions
  1. 25 0
      cdssman-service/.gitignore
  2. 249 0
      cdssman-service/pom.xml
  3. 38 0
      cdssman-service/src/main/java/com/diagbot/CdssmanServiceApplication.java
  4. 41 0
      cdssman-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  5. 60 0
      cdssman-service/src/main/java/com/diagbot/client/CdssCoreClient.java
  6. 30 0
      cdssman-service/src/main/java/com/diagbot/client/UserServiceClient.java
  7. 73 0
      cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java
  8. 35 0
      cdssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  9. 34 0
      cdssman-service/src/main/java/com/diagbot/config/CacheConfigurer.java
  10. 19 0
      cdssman-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java
  11. 15 0
      cdssman-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java
  12. 48 0
      cdssman-service/src/main/java/com/diagbot/config/JwtConfigurer.java
  13. 33 0
      cdssman-service/src/main/java/com/diagbot/config/MultipartConfigurer.java
  14. 39 0
      cdssman-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  15. 42 0
      cdssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  16. 70 0
      cdssman-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java
  17. 223 0
      cdssman-service/src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java
  18. 79 0
      cdssman-service/src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java
  19. 160 0
      cdssman-service/src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java
  20. 28 0
      cdssman-service/src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java
  21. 81 0
      cdssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  22. 29 0
      cdssman-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java
  23. 79 0
      cdssman-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  24. 40 0
      cdssman-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java
  25. 43 0
      cdssman-service/src/main/java/com/diagbot/dto/ConceptDetailDTO.java
  26. 61 0
      cdssman-service/src/main/java/com/diagbot/dto/ConceptInfoDTO.java
  27. 24 0
      cdssman-service/src/main/java/com/diagbot/dto/ConceptMappingDTO.java
  28. 48 0
      cdssman-service/src/main/java/com/diagbot/dto/DictionaryInfoDTO.java
  29. 60 0
      cdssman-service/src/main/java/com/diagbot/dto/DisclaimerInfoDTO.java
  30. 23 0
      cdssman-service/src/main/java/com/diagbot/dto/DiseaseInfoDTO.java
  31. 32 0
      cdssman-service/src/main/java/com/diagbot/dto/DrugInfoDTO.java
  32. 28 0
      cdssman-service/src/main/java/com/diagbot/dto/FileDTO.java
  33. 17 0
      cdssman-service/src/main/java/com/diagbot/dto/FileDeleteDTO.java
  34. 25 0
      cdssman-service/src/main/java/com/diagbot/dto/FileUploadDTO.java
  35. 26 0
      cdssman-service/src/main/java/com/diagbot/dto/HosRelationNumDTO.java
  36. 16 0
      cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoDTO.java
  37. 46 0
      cdssman-service/src/main/java/com/diagbot/dto/LisDetailDTO.java
  38. 22 0
      cdssman-service/src/main/java/com/diagbot/dto/OperationInfoDTO.java
  39. 41 0
      cdssman-service/src/main/java/com/diagbot/dto/PermissionAllDTO.java
  40. 41 0
      cdssman-service/src/main/java/com/diagbot/dto/PermissionsAllDTO.java
  41. 62 0
      cdssman-service/src/main/java/com/diagbot/dto/PlanDetailDTO.java
  42. 35 0
      cdssman-service/src/main/java/com/diagbot/dto/PlanInfoDefaultDTO.java
  43. 43 0
      cdssman-service/src/main/java/com/diagbot/dto/PlanInfoPagesDTO.java
  44. 48 0
      cdssman-service/src/main/java/com/diagbot/dto/RetrievalDTO.java
  45. 45 0
      cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  46. 43 0
      cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDetailDTO.java
  47. 54 0
      cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java
  48. 36 0
      cdssman-service/src/main/java/com/diagbot/dto/TokenHospitaDTO.java
  49. 46 0
      cdssman-service/src/main/java/com/diagbot/dto/UserRoleInfoFindDTO.java
  50. 60 0
      cdssman-service/src/main/java/com/diagbot/dto/VersionDetailDTO.java
  51. 60 0
      cdssman-service/src/main/java/com/diagbot/dto/VersionDetailSpecDTO.java
  52. 52 0
      cdssman-service/src/main/java/com/diagbot/dto/VersionWrapperDTO.java
  53. 186 0
      cdssman-service/src/main/java/com/diagbot/entity/ConceptDetail.java
  54. 183 0
      cdssman-service/src/main/java/com/diagbot/entity/ConceptInfo.java
  55. 213 0
      cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java
  56. 88 0
      cdssman-service/src/main/java/com/diagbot/entity/DictionaryInfo.java
  57. 194 0
      cdssman-service/src/main/java/com/diagbot/entity/DisclaimerInfo.java
  58. 197 0
      cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java
  59. 215 0
      cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java
  60. 228 0
      cdssman-service/src/main/java/com/diagbot/entity/HospitalInfo.java
  61. 215 0
      cdssman-service/src/main/java/com/diagbot/entity/LisConfig.java
  62. 197 0
      cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java
  63. 197 0
      cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java
  64. 210 0
      cdssman-service/src/main/java/com/diagbot/entity/Permission.java
  65. 180 0
      cdssman-service/src/main/java/com/diagbot/entity/Plan.java
  66. 243 0
      cdssman-service/src/main/java/com/diagbot/entity/PlanDetail.java
  67. 21 0
      cdssman-service/src/main/java/com/diagbot/entity/Token.java
  68. 197 0
      cdssman-service/src/main/java/com/diagbot/entity/TokenHospital.java
  69. 180 0
      cdssman-service/src/main/java/com/diagbot/entity/TokenPermission.java
  70. 197 0
      cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java
  71. 198 0
      cdssman-service/src/main/java/com/diagbot/entity/User.java
  72. 155 0
      cdssman-service/src/main/java/com/diagbot/entity/UserHospital.java
  73. 156 0
      cdssman-service/src/main/java/com/diagbot/entity/UserRole.java
  74. 194 0
      cdssman-service/src/main/java/com/diagbot/entity/VersionDetail.java
  75. 163 0
      cdssman-service/src/main/java/com/diagbot/entity/VersionInfo.java
  76. 69 0
      cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  77. 45 0
      cdssman-service/src/main/java/com/diagbot/enums/DisclaimerCodeEnum.java
  78. 72 0
      cdssman-service/src/main/java/com/diagbot/enums/StaticTypeEnum.java
  79. 50 0
      cdssman-service/src/main/java/com/diagbot/enums/StatusEnum.java
  80. 81 0
      cdssman-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java
  81. 39 0
      cdssman-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  82. 13 0
      cdssman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java
  83. 451 0
      cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java
  84. 422 0
      cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java
  85. 65 0
      cdssman-service/src/main/java/com/diagbot/facade/DictionaryFacade.java
  86. 199 0
      cdssman-service/src/main/java/com/diagbot/facade/DisclaimerInfoFacade.java
  87. 409 0
      cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java
  88. 637 0
      cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java
  89. 30 0
      cdssman-service/src/main/java/com/diagbot/facade/EnumsDataFacade.java
  90. 333 0
      cdssman-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java
  91. 486 0
      cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java
  92. 418 0
      cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java
  93. 416 0
      cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java
  94. 30 0
      cdssman-service/src/main/java/com/diagbot/facade/PermissionFacade.java
  95. 180 0
      cdssman-service/src/main/java/com/diagbot/facade/PlanDetailFacade.java
  96. 339 0
      cdssman-service/src/main/java/com/diagbot/facade/PlanFacade.java
  97. 34 0
      cdssman-service/src/main/java/com/diagbot/facade/RetrievalFacade.java
  98. 167 0
      cdssman-service/src/main/java/com/diagbot/facade/TokenHospitalFacade.java
  99. 112 0
      cdssman-service/src/main/java/com/diagbot/facade/TokenPermissionFacade.java
  100. 0 0
      cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java

+ 25 - 0
cdssman-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/

+ 249 - 0
cdssman-service/pom.xml

@@ -0,0 +1,249 @@
+<?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>cdssman-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>cdssman-service</name>
+    <description>CDSS后台管理 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>org.neo4j</groupId>
+            <artifactId>neo4j-jdbc-driver</artifactId>
+            <version>3.4.0</version>
+        </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>
+
+        <!-- easypoi -->
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>${easypoi.version}</version>
+        </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>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.ben-manes.caffeine</groupId>
+            <artifactId>caffeine</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus begin -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <!-- mybatis-plus end -->
+
+        <!--&lt;!&ndash; 阿里巴巴druid数据库连接池 &ndash;&gt;-->
+        <!--<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>
+            <version>${mybatis-spring-boot.version}</version>
+        </dependency>
+
+        <!--多数据源-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
+        <!--mysql-database-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!-- 文件上传相关架包 -->
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+        </dependency>
+
+        <!-- easypoi -->
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</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-oraclejre8: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>${registryUrl}</registryUrl>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 38 - 0
cdssman-service/src/main/java/com/diagbot/CdssmanServiceApplication.java

@@ -0,0 +1,38 @@
+package com.diagbot;
+
+import org.mybatis.spring.annotation.MapperScan;
+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.boot.context.properties.ConfigurationPropertiesScan;
+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: 互动反馈启动文件
+ * @author: gaodm
+ * @time: 2018/8/7 9:26
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
+        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class })
+@EnableEurekaClient
+@EnableFeignClients({ "com.diagbot.client" })
+@EnableHystrixDashboard
+@EnableHystrix
+@EnableCircuitBreaker
+@RefreshScope
+@ConfigurationPropertiesScan
+@MapperScan("com.diagbot.mapper")
+public class CdssmanServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(CdssmanServiceApplication.class, args);
+    }
+}

+ 41 - 0
cdssman-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java

@@ -0,0 +1,41 @@
+//package com.diagbot.aop;
+//
+//import com.diagbot.biz.log.entity.SysLog;
+//import com.diagbot.enums.SysTypeEnum;
+//import com.diagbot.rabbit.MySender;
+//import com.diagbot.util.AopUtil;
+//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.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @Description: 日志拦截切面
+// * @author: gaodm
+// * @time: 2018/8/2 13:36
+// */
+//@Aspect
+//@Component
+//@ConditionalOnProperty(prefix = "syslog", value = { "enable" }, havingValue = "true")
+//public class SysLoggerAspect {
+//    @Autowired
+//    private MySender mySender;
+//
+//    @Pointcut("@annotation(com.diagbot.annotation.SysLogger)")
+//    public void loggerPointCut() {
+//
+//    }
+//
+//    @Before("loggerPointCut()")
+//    public void saveSysLog(JoinPoint joinPoint) {
+//        //入参设置
+//        SysLog sysLog = AopUtil.sysLoggerAspect(joinPoint, SysTypeEnum.LTKG_SERVICE.getKey());
+//        //保存系统日志
+//        mySender.outputLogSend(sysLog);
+//    }
+//
+//}
+//

+ 60 - 0
cdssman-service/src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -0,0 +1,60 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.CdssCoreHystrix;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HasStaticKnowledgeVO;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.StaticKnowledgeIndexVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/25 10:59
+ */
+@FeignClient(name = "cdss-core", url = "${cdss-core.url}", fallback = CdssCoreHystrix.class)
+public interface CdssCoreClient {
+    /**
+     * 静态知识检索
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    @PostMapping("/retrieval/staticKnowledgeIndex")
+    RespDTO<List<StaticKnowledgeIndexDTO>> staticKnowledgeIndex(@RequestBody @Valid StaticKnowledgeIndexVO staticKnowledgeIndexVO);
+
+    /**
+     * 更新是否有静态知识状态
+     *
+     * @param hasStaticKnowledgeVO
+     * @return
+     */
+    @PostMapping("/staticKnowledge/updateHasInfoStatus")
+    RespDTO<Boolean> updateHasInfoStatus(@Valid @RequestBody HasStaticKnowledgeVO hasStaticKnowledgeVO);
+
+    /**
+     * 术语批量校验
+     *
+     * @param conceptVO
+     * @return
+     */
+    @PostMapping("/retrieval/getConceptNames")
+    RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO);
+
+    /**
+     * 化验大项、化验小项、辅检、诊断、药品、手术等检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @PostMapping("/retrieval/index")
+    RespDTO<RetrievalDTO> index(@RequestBody @Valid RetrievalVO retrievalVO);
+}

+ 30 - 0
cdssman-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -0,0 +1,30 @@
+package com.diagbot.client;
+
+import com.diagbot.client.hystrix.UserServiceHystrix;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Token;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @Description: 调用用户服务
+ * @author: gaodm
+ * @time: 2018/8/6 9:52
+ */
+@FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
+public interface UserServiceClient {
+
+    @PostMapping(value = "/user/getUserInfoByIds")
+    RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids);
+
+    @PostMapping("/user/verifyToken")
+    RespDTO<Boolean> verifyToken(@RequestBody Token token);
+}
+
+
+

+ 73 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -0,0 +1,73 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HasStaticKnowledgeVO;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.StaticKnowledgeIndexVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/25 10:59
+ */
+@Component
+@Slf4j
+public class CdssCoreHystrix implements CdssCoreClient {
+    /**
+     * 静态知识检索
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    @Override
+    public RespDTO<List<StaticKnowledgeIndexDTO>> staticKnowledgeIndex(@RequestBody @Valid StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        log.error("【hystrix】调用{}异常", "staticKnowledgeIndex");
+        return null;
+    }
+
+    /**
+     * 更新是否有静态知识状态
+     *
+     * @param hasStaticKnowledgeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> updateHasInfoStatus(@Valid @RequestBody HasStaticKnowledgeVO hasStaticKnowledgeVO) {
+        log.error("【hystrix】调用{}异常", "updateHasInfoStatus");
+        return null;
+    }
+
+    /**
+     * 术语批量校验
+     *
+     * @param conceptVO
+     * @return
+     */
+    @Override
+    public RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO) {
+        log.error("【hystrix】调用{}异常", "getConceptNames");
+        return null;
+    }
+
+    /**
+     * 化验大项、化验小项、辅检、诊断、药品、手术等检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public RespDTO<RetrievalDTO> index(@RequestBody @Valid RetrievalVO retrievalVO) {
+        log.error("【hystrix】调用{}异常", "index");
+        return null;
+    }
+}

+ 35 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -0,0 +1,35 @@
+package com.diagbot.client.hystrix;
+
+import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Token;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @Description: 调用用户服务
+ * @author: gaodm
+ * @time: 2018/8/6 9:52
+ */
+@Component
+@Slf4j
+public class UserServiceHystrix implements UserServiceClient {
+
+    @Override
+    public RespDTO<Map<String, String>> getUserInfoByIds(@RequestBody List<String> ids) {
+        log.error("【hystrix】调用{}异常", "getUserInfoByIds");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> verifyToken(Token token) {
+        log.error("【hystrix】调用{}异常", "verifyToken");
+        return null;
+    }
+
+}

+ 34 - 0
cdssman-service/src/main/java/com/diagbot/config/CacheConfigurer.java

@@ -0,0 +1,34 @@
+package com.diagbot.config;
+
+import com.github.benmanes.caffeine.cache.CacheLoader;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@EnableCaching
+public class CacheConfigurer {
+    /**
+     * 必须要指定这个Bean,refreshAfterWrite=xs这个配置属性才生效
+     *
+     * @return
+     */
+    @Bean
+    public CacheLoader<Object, Object> cacheLoader() {
+        CacheLoader<Object, Object> cacheLoader = new CacheLoader<Object, Object>() {
+
+            @Override
+            public Object load(Object key) throws Exception {
+                return null;
+            }
+
+            // 重写这个方法将oldValue值返回回去,进而刷新缓存
+            @Override
+            public Object reload(Object key, Object oldValue) throws Exception {
+                return oldValue;
+            }
+        };
+
+        return cacheLoader;
+    }
+}

+ 19 - 0
cdssman-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
cdssman-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
cdssman-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;
+    }
+}

+ 33 - 0
cdssman-service/src/main/java/com/diagbot/config/MultipartConfigurer.java

@@ -0,0 +1,33 @@
+package com.diagbot.config;
+
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.unit.DataSize;
+
+import javax.servlet.MultipartConfigElement;
+
+/**
+ * @Description: 配置上传文件大小的配置
+ * @author: gaodm
+ * @time: 2019/5/9 11:18
+ */
+@Configuration
+public class MultipartConfigurer {
+    /**
+     * 配置上传文件大小的配置
+     *
+     * @return
+     */
+    @Bean
+    public MultipartConfigElement multipartConfigElement() {
+        MultipartConfigFactory factory = new MultipartConfigFactory();
+        //  上传文件临时文件夹
+        factory.setLocation(System.getProperty("/data/tmp"));
+        //  单个数据大小
+        factory.setMaxFileSize(DataSize.ofMegabytes(600));
+        /// 总上传数据大小
+        factory.setMaxRequestSize(DataSize.ofMegabytes(600));
+        return factory.createMultipartConfig();
+    }
+}

+ 39 - 0
cdssman-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -0,0 +1,39 @@
+package com.diagbot.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.diagbot.config.mybatisLike.MybatisLikeSqlInterceptor;
+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();
+        // 设置请求的页面大于最大页后操作,true调回到首页,false继续请求,默认false
+        //paginationInterceptor.setOverflow(false);
+        // 设置最大单页限制数量,默认500条,-1不受限制
+        paginationInterceptor.setLimit(500L);
+        return paginationInterceptor;
+    }
+
+    @Bean
+    public MybatisLikeSqlInterceptor mybatisSqlInterceptor() {
+        return new MybatisLikeSqlInterceptor();
+    }
+
+}

+ 42 - 0
cdssman-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;
+}

+ 70 - 0
cdssman-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java

@@ -0,0 +1,70 @@
+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.Contact;
+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(" cdssman-service api ")
+                .description("CDSS后台维护 微服务")
+                .termsOfServiceUrl("")
+                .contact(new Contact("diagbot","",""))
+                .version("1.0")
+                .build();
+    }
+
+}

+ 223 - 0
cdssman-service/src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java

@@ -0,0 +1,223 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+
+/**
+ * @Description: 包含like的SQL语句转义模板
+ * @author: gaodm
+ * @time: 2020/11/2 16:05
+ */
+@Slf4j
+public abstract class AbstractLikeSqlConverter<T> {
+
+    /**
+     * SQL语句like使用关键字%
+     */
+    private final static String LIKE_SQL_KEY = "%";
+
+    /**
+     * SQL语句需要转义的关键字
+     */
+    private final static String[] ESCAPE_CHAR = new String[] { LIKE_SQL_KEY, "_", "\\" };
+
+    /**
+     * mybatis-plus中like的SQL语句样式
+     */
+    private final static String MYBATIS_PLUS_LIKE_SQL = " like ?";
+
+    /**
+     * mybatis-plus中参数前缀
+     */
+    private final static String MYBATIS_PLUS_WRAPPER_PREFIX = "ew.paramNameValuePairs.";
+
+    /**
+     * mybatis-plus中参数键
+     */
+    final static String MYBATIS_PLUS_WRAPPER_KEY = "ew";
+
+    /**
+     * mybatis-plus中参数分隔符
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR = ".";
+
+    /**
+     * mybatis-plus中参数分隔符替换器
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX = "\\.";
+
+    /**
+     * 已经替换过的标记
+     */
+    final static String REPLACED_LIKE_KEYWORD_MARK = "replaced.keyword";
+
+    /**
+     * 转义特殊字符
+     *
+     * @param sql       SQL语句
+     * @param fields    字段列表
+     * @param parameter 参数对象
+     */
+    public void convert(String sql, Set<String> fields, T parameter) {
+        for (String field : fields) {
+            if (this.hasMybatisPlusLikeSql(sql)) {
+                if (this.hasWrapper(field)) {
+                    // 第一种情况:在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+                    this.transferWrapper(field, parameter);
+                } else {
+                    // 第二种情况:未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+                    this.transferSelf(field, parameter);
+                }
+            } else {
+                // 第三种情况:在Mapper类的注解SQL中进行了模糊查询的拼接
+                this.transferSplice(field, parameter);
+            }
+        }
+    }
+
+    /**
+     * 转义条件构造的特殊字符
+     * 在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferWrapper(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSelf(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 在Mapper类的注解SQL中进行了模糊查询的拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSplice(String field, T parameter);
+
+    /**
+     * 转义通配符
+     *
+     * @param before 待转义字符串
+     * @return 转义后字符串
+     */
+    String escapeChar(String before) {
+        if (StringUtils.isNotBlank(before)) {
+            before = before.replaceAll("\\\\", "\\\\\\\\");
+            before = before.replaceAll("_", "\\\\_");
+            before = before.replaceAll("%", "\\\\%");
+        }
+        return before;
+    }
+
+    /**
+     * 是否包含需要转义的字符
+     *
+     * @param obj 待判断的对象
+     * @return true/false
+     */
+    boolean hasEscapeChar(Object obj) {
+        if (!(obj instanceof String)) {
+            return false;
+        }
+        return this.hasEscapeChar((String) obj);
+    }
+
+    /**
+     * 处理对象like问题
+     *
+     * @param field     对象字段
+     * @param parameter 对象
+     */
+    void resolveObj(String field, Object parameter) {
+        if (parameter == null || StringUtils.isBlank(field)) {
+            return;
+        }
+        try {
+            PropertyDescriptor descriptor = new PropertyDescriptor(field, parameter.getClass());
+            Method readMethod = descriptor.getReadMethod();
+            Object param = readMethod.invoke(parameter);
+            if (this.hasEscapeChar(param)) {
+                Method setMethod = descriptor.getWriteMethod();
+                setMethod.invoke(parameter, this.escapeChar(param.toString()));
+            } else if (this.cascade(field)) {
+                int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR) + 1;
+                this.resolveObj(field.substring(index), param);
+            }
+        } catch (IntrospectionException | IllegalAccessException | InvocationTargetException e) {
+            log.error("反射 {} 的 {} get/set方法出现异常", parameter, field, e);
+        }
+    }
+
+    /**
+     * 判断是否是级联属性
+     *
+     * @param field 字段名
+     * @return true/false
+     */
+    boolean cascade(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_SEPARATOR) && !this.hasWrapper(field);
+    }
+
+    /**
+     * 是否包含mybatis-plus的包含like的SQL语句格式
+     *
+     * @param sql 完整SQL语句
+     * @return true/false
+     */
+    private boolean hasMybatisPlusLikeSql(String sql) {
+        if (StringUtils.isBlank(sql)) {
+            return false;
+        }
+        return sql.toLowerCase().contains(MYBATIS_PLUS_LIKE_SQL);
+    }
+
+    /**
+     * 判断是否使用mybatis-plus条件构造器
+     *
+     * @param field 字段
+     * @return true/false
+     */
+    private boolean hasWrapper(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_PREFIX);
+    }
+
+    /**
+     * 判断字符串是否含有需要转义的字符
+     *
+     * @param str 待判断的字符串
+     * @return true/false
+     */
+    private boolean hasEscapeChar(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        for (String s : ESCAPE_CHAR) {
+            if (str.contains(s)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 79 - 0
cdssman-service/src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.mybatisLike;
+
+import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @Description: 参数对象为Map的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:07
+ */
+public class MapLikeSqlConverter extends AbstractLikeSqlConverter<Map> {
+
+    @Override
+    public void transferWrapper(String field, Map parameter) {
+        AbstractWrapper wrapper = (AbstractWrapper) parameter.get(MYBATIS_PLUS_WRAPPER_KEY);
+        parameter = wrapper.getParamNameValuePairs();
+        String[] keys = field.split(MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX);
+        // ew.paramNameValuePairs.param1,截取字符串之后,获取第三个,即为参数名
+        String paramName = keys[2];
+        String mapKey = String.format("%s.%s", REPLACED_LIKE_KEYWORD_MARK, paramName);
+        if (parameter.containsKey(mapKey) && Objects.equals(parameter.get(mapKey), true)) {
+            return;
+        }
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+        } else {
+            Object param = parameter.get(paramName);
+            if (this.hasEscapeChar(param)) {
+                String paramStr = param.toString();
+                parameter.put(keys[2], String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+            }
+        }
+        parameter.put(mapKey, true);
+    }
+
+    @Override
+    public void transferSelf(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            String paramStr = param.toString();
+            parameter.put(field, String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+        }
+    }
+
+    @Override
+    public void transferSplice(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            parameter.put(field, this.escapeChar(param.toString()));
+        }
+    }
+
+    /**
+     * 处理级联属性
+     *
+     * @param field     级联字段名
+     * @param parameter 参数Map对象
+     */
+    private void resolveCascadeObj(String field, Map parameter) {
+        int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR);
+        Object param = parameter.get(field.substring(0, index));
+        if (param == null) {
+            return;
+        }
+        this.resolveObj(field.substring(index + 1), param);
+    }
+
+}
+

+ 160 - 0
cdssman-service/src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java

@@ -0,0 +1,160 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Plugin;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * @Description: mybatis/mybatis-plus模糊查询语句特殊字符转义拦截器
+ * @author: gaodm
+ * @time: 2020/11/2 16:04
+ */
+@Intercepts({ @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }) })
+@Slf4j
+public class MybatisLikeSqlInterceptor implements Interceptor {
+
+    /**
+     * SQL语句like
+     */
+    private final static String SQL_LIKE = " like ";
+
+    /**
+     * SQL语句占位符
+     */
+    private final static String SQL_PLACEHOLDER = "?";
+
+    /**
+     * SQL语句占位符分隔
+     */
+    private final static String SQL_PLACEHOLDER_REGEX = "\\?";
+
+    /**
+     * 所有的转义器
+     */
+    private static Map<Class, AbstractLikeSqlConverter> converterMap = new HashMap<>(4);
+
+    static {
+        converterMap.put(Map.class, new MapLikeSqlConverter());
+        converterMap.put(Object.class, new ObjectLikeSqlConverter());
+    }
+
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        Object[] args = invocation.getArgs();
+        MappedStatement statement = (MappedStatement) args[0];
+        Object parameterObject = args[1];
+        BoundSql boundSql = statement.getBoundSql(parameterObject);
+        String sql = boundSql.getSql();
+        this.transferLikeSql(sql, parameterObject, boundSql);
+        return invocation.proceed();
+    }
+
+    @Override
+    public Object plugin(Object target) {
+        return Plugin.wrap(target, this);
+    }
+
+    @Override
+    public void setProperties(Properties arg0) {
+
+    }
+
+    /**
+     * 修改包含like的SQL语句
+     *
+     * @param sql             SQL语句
+     * @param parameterObject 参数对象
+     * @param boundSql        绑定SQL对象
+     */
+    private void transferLikeSql(String sql, Object parameterObject, BoundSql boundSql) {
+        if (!isEscape(sql)) {
+            return;
+        }
+        sql = sql.replaceAll(" {2}", " ");
+        // 获取关键字的个数(去重)
+        Set<String> fields = this.getKeyFields(sql, boundSql);
+        if (fields == null) {
+            return;
+        }
+        // 此处可以增强,不止是支持Map对象,Map对象仅用于传入的条件为Map或者使用@Param传入的对象被Mybatis转为的Map
+        AbstractLikeSqlConverter converter;
+        // 对关键字进行特殊字符“清洗”,如果有特殊字符的,在特殊字符前添加转义字符(\)
+        if (parameterObject instanceof Map) {
+            converter = converterMap.get(Map.class);
+        } else {
+            converter = converterMap.get(Object.class);
+        }
+        converter.convert(sql, fields, parameterObject);
+    }
+
+    /**
+     * 是否需要转义
+     *
+     * @param sql SQL语句
+     * @return true/false
+     */
+    private boolean isEscape(String sql) {
+        return this.hasLike(sql) && this.hasPlaceholder(sql);
+    }
+
+    /**
+     * 判断SQL语句中是否含有like关键字
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasLike(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_LIKE);
+    }
+
+    /**
+     * 判断SQL语句中是否包含SQL占位符
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasPlaceholder(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_PLACEHOLDER);
+    }
+
+    /**
+     * 获取需要替换的所有字段集合
+     *
+     * @param sql      完整SQL语句
+     * @param boundSql 绑定的SQL对象
+     * @return 字段集合列表
+     */
+    private Set<String> getKeyFields(String sql, BoundSql boundSql) {
+        String[] params = sql.split(SQL_PLACEHOLDER_REGEX);
+        Set<String> fields = new HashSet<>();
+        for (int i = 0; i < params.length; i++) {
+            if (this.hasLike(params[i])) {
+                String field = boundSql.getParameterMappings().get(i).getProperty();
+                fields.add(field);
+            }
+        }
+        return fields;
+    }
+
+}

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java

@@ -0,0 +1,28 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @Description: 通用参数的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:06
+ */
+@Slf4j
+public class ObjectLikeSqlConverter extends AbstractLikeSqlConverter<Object> {
+
+    @Override
+    public void transferWrapper(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSelf(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSplice(String field, Object parameter) {
+        this.resolveObj(field, parameter);
+    }
+
+}

+ 81 - 0
cdssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -0,0 +1,81 @@
+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.core.GrantedAuthority;
+import org.springframework.security.web.FilterInvocation;
+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("/webjars/**", 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
cdssman-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
cdssman-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
cdssman-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;
+    }
+}

+ 43 - 0
cdssman-service/src/main/java/com/diagbot/dto/ConceptDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/21 10:28
+ */
+@Getter
+@Setter
+public class ConceptDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 61 - 0
cdssman-service/src/main/java/com/diagbot/dto/ConceptInfoDTO.java

@@ -0,0 +1,61 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/21 10:33
+ */
+@Getter
+@Setter
+public class ConceptInfoDTO {
+    /**
+     * 术语id
+     */
+    private Long id;
+    /**
+     * 术语名称
+     */
+    private String name;
+    /**
+     * 关联标题
+     */
+    private String title;
+    /**
+     * 术语类型(词性)
+     */
+    private String type;
+    /**
+     * 术语类型(词性)
+     */
+    private String typeName;
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+    /**
+     * 修改时间
+     */
+    private Date gmtModified;
+    /**
+     * 修改人
+     */
+    private String modifier;
+    /**
+     * 启用状态
+     */
+    private Integer status;
+    /**
+     * 明细
+     */
+    List<ConceptDetailDTO> details;
+}

+ 24 - 0
cdssman-service/src/main/java/com/diagbot/dto/ConceptMappingDTO.java

@@ -0,0 +1,24 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/10/13 9:52
+ */
+@Getter
+@Setter
+public class ConceptMappingDTO {
+    private String name;
+    private Long hospitalId;
+    private Integer connect;
+    private Integer lisNum = 0;
+    private Integer deptNum = 0;
+    private Integer drugNum = 0;
+    private Integer pacsNum = 0;
+    private Integer diseaseNum = 0;
+    private Integer operationNum = 0;
+    private Integer transfusionNum = 0;
+}

+ 48 - 0
cdssman-service/src/main/java/com/diagbot/dto/DictionaryInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * icss字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Getter
+@Setter
+public class DictionaryInfoDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 60 - 0
cdssman-service/src/main/java/com/diagbot/dto/DisclaimerInfoDTO.java

@@ -0,0 +1,60 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-05 10:57
+ */
+@Getter
+@Setter
+public class DisclaimerInfoDTO {
+
+    private Long id;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String modifier;
+
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 排序号
+     */
+    private String orderNo;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    private String status;
+
+    /**
+     * 免责申明位置
+     */
+    private String disclaimerCode;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}
+

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/dto/DiseaseInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/9/15 10:07
+ */
+@Getter
+@Setter
+public class DiseaseInfoDTO {
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * ICD10编码
+     */
+    private String icd10Code;
+}

+ 32 - 0
cdssman-service/src/main/java/com/diagbot/dto/DrugInfoDTO.java

@@ -0,0 +1,32 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:15
+ */
+@Getter
+@Setter
+public class DrugInfoDTO {
+    /**
+     * 药品名称
+     */
+    private String name;
+    /**
+     * 用法
+     */
+    private List<String> usage;
+    /**
+     * 用量、剂量
+     */
+    private List<String> dosage;
+    /**
+     * 频次
+     */
+    private List<String> frequency;
+}

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/dto/FileDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/12/18 17:08
+ */
+@Getter
+@Setter
+public class FileDTO {
+    private String state;
+    private String original;
+    private String title;
+    private String url;
+    private String md5;
+    private String info;
+
+    public FileDTO(String state, String info) {
+        this.state = state;
+        this.info = info;
+    }
+    public FileDTO(){
+
+    }
+}

+ 17 - 0
cdssman-service/src/main/java/com/diagbot/dto/FileDeleteDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/11/4 11:09
+ */
+@Getter
+@Setter
+public class FileDeleteDTO {
+    private Object data;
+    private String message;
+    private String status;
+}

+ 25 - 0
cdssman-service/src/main/java/com/diagbot/dto/FileUploadDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/11/4 10:55
+ */
+@Getter
+@Setter
+public class FileUploadDTO {
+    private String url;
+    private String md5;
+    private String path;
+    private String domain;
+    private String scene;
+    private int size;
+    private int mtime;
+    private String scenes;
+    private String retmsg;
+    private int retcode;
+    private String src;
+}

+ 26 - 0
cdssman-service/src/main/java/com/diagbot/dto/HosRelationNumDTO.java

@@ -0,0 +1,26 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/5 14:53
+ */
+@Getter
+@Setter
+public class HosRelationNumDTO {
+    /**
+     * 医院id
+     */
+    private Long id;
+    /**
+     * 医院名称
+     */
+    private String name;
+    /**
+     * 映射关系条数
+     */
+    private Integer num;
+}

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 18:38
+ */
+@Setter
+@Getter
+public class HospitalInfoDTO {
+    private Long id;
+    private String name;
+}

+ 46 - 0
cdssman-service/src/main/java/com/diagbot/dto/LisDetailDTO.java

@@ -0,0 +1,46 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 15:53
+ */
+@Getter
+@Setter
+public class LisDetailDTO {
+    /**
+     * 大项(套餐)
+     */
+    private String name;
+    /**
+     * 小项(公表名)
+     */
+    private String uniqueName;
+    /**
+     * 数值
+     */
+    private Double value;
+    /**
+     * 单位
+     */
+    private String units;
+    /**
+     * 下限
+     */
+    private Double minValue;
+    /**
+     * 上限
+     */
+    private Double maxValue;
+    /**
+     * 非数值结果
+     */
+    private String otherValue;
+    /**
+     * 非数值类型参考值
+     */
+    private String referenceValue;
+}

+ 22 - 0
cdssman-service/src/main/java/com/diagbot/dto/OperationInfoDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:21
+ */
+@Getter
+@Setter
+public class OperationInfoDTO {
+    /**
+     * 手术或操作名称
+     */
+    private String name;
+    /**
+     * 类型:手术、操作
+     */
+    private String type;
+}

+ 41 - 0
cdssman-service/src/main/java/com/diagbot/dto/PermissionAllDTO.java

@@ -0,0 +1,41 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-10 10:20
+ */
+@Setter
+@Getter
+public class PermissionAllDTO {
+    private Long id;
+
+    private Long tokenId;
+
+    /**
+     * 系统资源id
+     */
+    private Long permissionId;
+
+    private Long hospitalId;
+
+    private String hospitalName;
+
+    /**
+     * 特殊处理参数
+     */
+    private String paramKey;
+
+    /**
+     * 特殊处理参数值
+     */
+    private String paramValue;
+
+    private String permissionName;
+
+    private String permissionUrl;
+
+}

+ 41 - 0
cdssman-service/src/main/java/com/diagbot/dto/PermissionsAllDTO.java

@@ -0,0 +1,41 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-10 10:54
+ */
+@Setter
+@Getter
+public class PermissionsAllDTO {
+    private Long id;
+
+
+    /**
+     * 资源名称
+     */
+    private String name;
+
+    /**
+     * 资源编码
+     */
+    private String code;
+
+    /**
+     * 资源Url
+     */
+    @TableField("permissionUrl")
+    private String permissionUrl;
+    /**
+     * 资源描述
+     */
+    private String descritpion;
+
+    private Integer type;
+}

+ 62 - 0
cdssman-service/src/main/java/com/diagbot/dto/PlanDetailDTO.java

@@ -0,0 +1,62 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-07 10:30
+ */
+@Setter
+@Getter
+public class PlanDetailDTO {
+
+    private Long id;
+    /**
+     * 医院编码
+     */
+    private Long hospitalId;
+
+    /**
+     * 方案编号
+     */
+    private Long planId;
+    private Long parentId;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 是否显示(1是,0否)
+     */
+    private Integer status;
+
+    /**
+     * 显示个数
+     */
+    private Integer number;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    private List<PlanDetailDTO> planDetails;
+}

+ 35 - 0
cdssman-service/src/main/java/com/diagbot/dto/PlanInfoDefaultDTO.java

@@ -0,0 +1,35 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-14 14:29
+ */
+@Setter
+@Getter
+public class PlanInfoDefaultDTO {
+
+    private Long id;
+    /**
+     * 医院编码
+     */
+    private Long hospitalId;
+    /**
+     * 方案编号
+     */
+    private String planName;
+
+    private String planCode;
+    /**
+     * 备注
+     */
+    private String remark;
+
+    private List<PlanDetailDTO> planDetailDefault;
+}
+

+ 43 - 0
cdssman-service/src/main/java/com/diagbot/dto/PlanInfoPagesDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-07 10:29
+ */
+@Setter
+@Getter
+public class PlanInfoPagesDTO {
+    private Long id;
+    /**
+     * 医院编码
+     */
+    private Long hospitalId;
+
+    private String hospitalName;
+    /**
+     * 方案编号
+     */
+    private String planName;
+
+    private String planCode;
+
+    private Integer planStatus;
+
+    private Date gmtCreate;
+
+    private String planDetail;
+    /**
+     * 备注
+     */
+    private String remark;
+
+    private List<PlanDetailDTO> sysSetInfo;
+}

+ 48 - 0
cdssman-service/src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 15:45
+ */
+@Getter
+@Setter
+public class RetrievalDTO {
+    /**
+     * 化验大项
+     */
+    private List<String> lisNames;
+    /**
+     * 化验小项
+     */
+    private List<LisDetailDTO> lisDetailNames;
+    /**
+     * 辅检
+     */
+    private List<String> pacsNames;
+    /**
+     * 诊断
+     */
+    private List<DiseaseInfoDTO> diseaseNames;
+    /**
+     * 药品
+     */
+    private List<DrugInfoDTO> drugNames;
+    /**
+     * 手术或操作
+     */
+    private List<OperationInfoDTO> operationNames;
+    /**
+     * 科室
+     */
+    private List<String> deptNames;
+    /**
+     * 输血
+     */
+    private List<String> transfusionNames;
+}

+ 45 - 0
cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java

@@ -0,0 +1,45 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/20 15:51
+ */
+@Getter
+@Setter
+public class StaticKnowledgeDTO {
+    /**
+     * 标准术语id
+     */
+    private Long id;
+    /**
+     * 标准术语
+     */
+    private String name;
+
+    /**
+     * 词性
+     */
+    private String type;
+
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 静态知识明细
+     */
+    private Map<String, List<StaticKnowledgeDetailDTO>> details;
+}

+ 43 - 0
cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/20 15:52
+ */
+@Getter
+@Setter
+public class StaticKnowledgeDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 54 - 0
cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java

@@ -0,0 +1,54 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/18 15:59
+ */
+@Getter
+@Setter
+public class StaticKnowledgeIndexDTO {
+    /**
+     * 术语id
+     */
+    private Long id;
+    /**
+     * 术语名称
+     */
+    private String name;
+    /**
+     * 词性
+     */
+    private Integer type;
+    /**
+     * 词性
+     */
+    private String typeName;
+    /**
+     * 同义词
+     */
+    private String retrievalName;
+    /**
+     * 是否有静态知识
+     */
+    private Integer hasInfo = 0;
+    /**
+     * 是否有基本静态知识
+     */
+    private Integer hasStaticKnowledge = 0;
+    /**
+     * 是否有临床路径
+     */
+    private Integer hasClinicalPathway = 0;
+    /**
+     * 是否有注意事项
+     */
+    private Integer hasNotice = 0;
+    /**
+     * 是否有治疗方案静态知识
+     */
+    private Integer hasTreatInfo = 0;
+}

+ 36 - 0
cdssman-service/src/main/java/com/diagbot/dto/TokenHospitaDTO.java

@@ -0,0 +1,36 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 14:57
+ */
+@Setter
+@Getter
+public class TokenHospitaDTO {
+
+    private Long id;
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院ID
+     */
+    private String hospitalName;
+
+    private String appidToken;
+
+    private Date startTime;
+
+    private Date endTime;
+
+    private Integer validDays;
+
+}

+ 46 - 0
cdssman-service/src/main/java/com/diagbot/dto/UserRoleInfoFindDTO.java

@@ -0,0 +1,46 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-11 18:43
+ */
+@Setter
+@Getter
+public class UserRoleInfoFindDTO {
+
+    private Long id;
+    /**
+     * 用户名
+     */
+    private Long userId;
+
+    /**
+     * 用户名
+     */
+    private String username;
+
+    private Date gmModified;
+    private String modifier;
+    /**
+     * 联系人
+     */
+    private String linkman;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status ;
+
+    private Long hospitalId;
+
+    private String hospitalName;
+
+}

+ 60 - 0
cdssman-service/src/main/java/com/diagbot/dto/VersionDetailDTO.java

@@ -0,0 +1,60 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 9:50
+ */
+@Getter
+@Setter
+public class VersionDetailDTO {
+
+    private Long id;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    //private String creator;
+
+    private String modifierid;
+    /**
+     * 版本主表id
+     */
+    private Long versionId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 排序号
+     */
+    private String orderNo;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    private String status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}
+

+ 60 - 0
cdssman-service/src/main/java/com/diagbot/dto/VersionDetailSpecDTO.java

@@ -0,0 +1,60 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 9:51
+ */
+@Getter
+@Setter
+public class VersionDetailSpecDTO {
+
+    private Long id;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    // private String creator;
+
+
+    /**
+     * 版本主表id
+     */
+    private Long versionId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 排序号
+     */
+    private String orderNo;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    //  private String status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}
+

+ 52 - 0
cdssman-service/src/main/java/com/diagbot/dto/VersionWrapperDTO.java

@@ -0,0 +1,52 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 9:38
+ */
+@Getter
+@Setter
+public class VersionWrapperDTO {
+
+    private Long id;
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    //private String creator;
+
+    private String modifierid;
+
+
+    /**
+     * 名称
+     */
+    private String name;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date refreshTime;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    private String status;
+
+    private List<VersionDetailDTO> detail;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}
+

+ 186 - 0
cdssman-service/src/main/java/com/diagbot/entity/ConceptDetail.java

@@ -0,0 +1,186 @@
+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 zhaops
+ * @since 2020-08-18
+ */
+@TableName("graph_concept_detail")
+public class ConceptDetail 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;
+
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+
+    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 Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+    public String getContentType() {
+        return contentType;
+    }
+
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+
+    @Override
+    public String toString() {
+        return "ConceptDetail{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", conceptId=" + conceptId +
+            ", title=" + title +
+            ", content=" + content +
+            ", text=" + text +
+            ", orderNo=" + orderNo +
+            ", contentType=" + contentType +
+        "}";
+    }
+}

+ 183 - 0
cdssman-service/src/main/java/com/diagbot/entity/ConceptInfo.java

@@ -0,0 +1,183 @@
+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 zhaops
+ * @since 2020-08-18
+ */
+@TableName("graph_concept_info")
+public class ConceptInfo 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 name;
+
+    /**
+     * 词性
+     */
+    private String type;
+
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+
+    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 getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getClinicalPathwayName() {
+        return clinicalPathwayName;
+    }
+
+    public void setClinicalPathwayName(String clinicalPathwayName) {
+        this.clinicalPathwayName = clinicalPathwayName;
+    }
+
+    public String getNoticeName() {
+        return noticeName;
+    }
+
+    public void setNoticeName(String noticeName) {
+        this.noticeName = noticeName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return "ConceptInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", name=" + name +
+                ", type=" + type +
+                ", clinicalPathwayName=" + clinicalPathwayName +
+                ", noticeName=" + noticeName +
+                ", status=" + status +
+                "}";
+    }
+}

+ 213 - 0
cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java

@@ -0,0 +1,213 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 科室映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-12
+ */
+@TableName("tran_dept_config")
+public class DeptConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院科室名称
+     */
+    @Excel(name = "医院科室名称", width = 40, orderNum = "2", isImportField = "true")
+    @NotBlank(message = "请输入医院科室名称")
+    private String hisName;
+
+    /**
+     * 医院科室编码
+     */
+    @Excel(name = "医院科室编码", width = 40, orderNum = "1", isImportField = "true")
+    private String hisCode;
+
+    /**
+     * 标准科室名称
+     */
+    @Excel(name = "标准科室名称", width = 40, orderNum = "4", isImportField = "true")
+    @NotBlank(message = "请输入标准科室名称")
+    private String uniqueName;
+
+    /**
+     * 对应项编码
+     */
+    //@Excel(name = "对应项编码", width = 40, orderNum = "3")
+    private String uniqueCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getHisCode() {
+        return hisCode;
+    }
+
+    public void setHisCode(String hisCode) {
+        this.hisCode = hisCode;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "DeptConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", hisCode=" + hisCode +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        DeptConfig deptConfig = (DeptConfig) o;
+        return Objects.equals(id, deptConfig.id)
+                && Objects.equals(isDeleted, deptConfig.isDeleted)
+                && Objects.equals(hospitalId, deptConfig.hospitalId)
+                && Objects.equals(hisName, deptConfig.hisName)
+                && Objects.equals(hisCode, deptConfig.hisCode)
+                && Objects.equals(uniqueName, deptConfig.uniqueName)
+                && Objects.equals(uniqueCode, deptConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, hisCode, uniqueName, uniqueCode);
+    }
+}

+ 88 - 0
cdssman-service/src/main/java/com/diagbot/entity/DictionaryInfo.java

@@ -0,0 +1,88 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * CDSS字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@TableName("sys_dictionary_info")
+@Getter
+@Setter
+public class DictionaryInfo 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 Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+    /**
+     * 返回类型(0: 都返回,1:后台维护返回 2:icss界面返回)
+     */
+    private Integer returnType;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 194 - 0
cdssman-service/src/main/java/com/diagbot/entity/DisclaimerInfo.java

@@ -0,0 +1,194 @@
+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 wangfeng
+ * @since 2020-08-05
+ */
+@TableName("sys_disclaimer_info")
+public class DisclaimerInfo 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 title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 排序号
+     */
+    private String orderNo;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    private String status;
+
+    /**
+     * 免责申明编号
+     */
+    private String disclaimerCode;
+
+    /**
+     * 备注
+     */
+    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 getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getDisclaimerCode() {
+        return disclaimerCode;
+    }
+
+    public void setDisclaimerCode(String disclaimerCode) {
+        this.disclaimerCode = disclaimerCode;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "DisclaimerInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", title=" + title +
+                ", description=" + description +
+                ", orderNo=" + orderNo +
+                ", status=" + status +
+                ", disclaimerCode=" + disclaimerCode +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 197 - 0
cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java

@@ -0,0 +1,197 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 诊断映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@TableName("tran_disease_config")
+public class DiseaseConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "医院诊断名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院诊断名称")
+    private String hisName;
+
+    /**
+     * 标准诊断名称
+     */
+    @Excel(name = "标准诊断名称", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准诊断名称")
+    private String uniqueName;
+
+    /**
+     * ICD-10编码
+     */
+    @Excel(name = "ICD-10编码", width = 40, orderNum = "2", isImportField = "true")
+    private String icdCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getIcdCode() {
+        return icdCode;
+    }
+
+    public void setIcdCode(String icdCode) {
+        this.icdCode = icdCode;
+    }
+
+    @Override
+    public String toString() {
+        return "DiseaseConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", icdCode=" + icdCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        DiseaseConfig diseaseConfig = (DiseaseConfig) o;
+        return Objects.equals(id, diseaseConfig.id)
+                && Objects.equals(isDeleted, diseaseConfig.isDeleted)
+                && Objects.equals(hospitalId, diseaseConfig.hospitalId)
+                && Objects.equals(hisName, diseaseConfig.hisName)
+                && Objects.equals(uniqueName, diseaseConfig.uniqueName)
+                && Objects.equals(icdCode, diseaseConfig.icdCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, icdCode);
+    }
+}

+ 215 - 0
cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java

@@ -0,0 +1,215 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 药品映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@TableName("tran_drug_config")
+public class DrugConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院药品名称
+     */
+    @Excel(name = "医院药品名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院药品名称")
+    //@Size(max = 80, min = 1,message = "医院药品名称长度需要在1-80字符长度之间")
+    private String hisName;
+
+    /**
+     * 标准药品名称
+     */
+    @Excel(name = "标准药品名称", width = 40, orderNum = "2", isImportField = "true")
+    @NotBlank(message = "请输入标准药品名称")
+    //@Size(max = 80, min = 1,message = "标准药品名称长度需要在1-80字符长度之间")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    //@Excel(name = "对应项编码", width = 40, orderNum = "3")
+    private String uniqueCode;
+
+    /**
+     * 剂型
+     */
+    @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
+    private String form;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    public String getForm() {
+        return form;
+    }
+
+    public void setForm(String form) {
+        this.form = form;
+    }
+
+    @Override
+    public String toString() {
+        return "DrugConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                ", form=" + form +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        DrugConfig drugConfig = (DrugConfig) o;
+        return Objects.equals(id, drugConfig.id)
+                && Objects.equals(isDeleted, drugConfig.isDeleted)
+                && Objects.equals(hospitalId, drugConfig.hospitalId)
+                && Objects.equals(hisName, drugConfig.hisName)
+                && Objects.equals(form, drugConfig.form)
+                && Objects.equals(uniqueName, drugConfig.uniqueName)
+                && Objects.equals(uniqueCode, drugConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, uniqueCode);
+    }
+}

+ 228 - 0
cdssman-service/src/main/java/com/diagbot/entity/HospitalInfo.java

@@ -0,0 +1,228 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院信息表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-06
+ */
+@TableName("tran_hospital_info")
+public class HospitalInfo 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;
+
+    /**
+     * 医院编码
+     */
+    /*@NotBlank(message = "医院编码不能为空")
+    private String code;*/
+
+    /**
+     * 医院名称
+     */
+    @NotBlank(message = "医院名称不能为空")
+    private String name;
+
+    /**
+     * 医院地址
+     */
+    private String address;
+
+    /**
+     * 医院名称拼音
+     */
+    private String spell;
+
+    /**
+     * 状态:0.禁用1.启用
+     */
+    private Integer status;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 是否对接(0-不对接,1-对接)
+     */
+    private Integer connect;
+
+    /**
+     * 备注
+     */
+    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 getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }*/
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getSpell() {
+        return spell;
+    }
+
+    public void setSpell(String spell) {
+        this.spell = spell;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getConnect() {
+        return connect;
+    }
+
+    public void setConnect(Integer connect) {
+        this.connect = connect;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "HospitalInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                /*", code=" + code +*/
+                ", name=" + name +
+                ", address=" + address +
+                ", spell=" + spell +
+                ", status=" + status +
+                ", orderNo=" + orderNo +
+                ", connect=" + connect +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 215 - 0
cdssman-service/src/main/java/com/diagbot/entity/LisConfig.java

@@ -0,0 +1,215 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 化验公表映射
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@Data
+@TableName("tran_lis_config")
+public class LisConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 检验套餐
+     */
+    @Excel(name = "检验套餐", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入检验套餐")
+    private String hisName;
+
+    /**
+     * 检验细项
+     */
+    @Excel(name = "检验细项", width = 40, orderNum = "2", isImportField = "true")
+    private String hisDetailName;
+
+    /**
+     * 标准检验项目
+     */
+    @Excel(name = "标准检验项目", width = 40, orderNum = "4", isImportField = "true")
+    @NotBlank(message = "请输入标准检验项目")
+    private String uniqueName;
+
+    /**
+     * 对应项目编码
+     */
+    //@Excel(name = "对应项目编码", width = 40, orderNum = "3")
+    private String uniqueCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getHisDetailName() {
+        return hisDetailName;
+    }
+
+    public void setHisDetailName(String hisDetailName) {
+        this.hisDetailName = hisDetailName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "LisConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", hisDetailName=" + hisDetailName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        LisConfig lisConfig = (LisConfig) o;
+        return Objects.equals(id, lisConfig.id)
+                && Objects.equals(isDeleted, lisConfig.isDeleted)
+                && Objects.equals(hospitalId, lisConfig.hospitalId)
+                && Objects.equals(hisName, lisConfig.hisName)
+                && Objects.equals(hisDetailName, lisConfig.hisDetailName)
+                && Objects.equals(uniqueName, lisConfig.uniqueName)
+                && Objects.equals(uniqueCode, lisConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, hisDetailName, uniqueName, uniqueCode);
+    }
+}

+ 197 - 0
cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java

@@ -0,0 +1,197 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 手术映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@TableName("tran_operation_config")
+public class OperationConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院手术/操作名称
+     */
+    @Excel(name = "医院手术/操作名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院手术/操作名称")
+    private String hisName;
+
+    /**
+     * 标准手术/操作名称
+     */
+    @Excel(name = "标准手术/操作名称", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准手术/操作名称")
+    private String uniqueName;
+
+    /**
+     * 对应项编码
+     */
+    //@Excel(name = "对应项编码", width = 40, orderNum = "2")
+    private String uniqueCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "OperationConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        OperationConfig operationConfig = (OperationConfig) o;
+        return Objects.equals(id, operationConfig.id)
+                && Objects.equals(isDeleted, operationConfig.isDeleted)
+                && Objects.equals(hospitalId, operationConfig.hospitalId)
+                && Objects.equals(hisName, operationConfig.hisName)
+                && Objects.equals(uniqueName, operationConfig.uniqueName)
+                && Objects.equals(uniqueCode, operationConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+}

+ 197 - 0
cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java

@@ -0,0 +1,197 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 检查公表映射
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-07-28
+ */
+@TableName("tran_pacs_config")
+public class PacsConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院检查项目
+     */
+    @Excel(name = "医院检查项目", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院检查项目")
+    private String hisName;
+
+    /**
+     * 标准检查项目
+     */
+    @Excel(name = "标准检查项目", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准检查项目")
+    private String uniqueName;
+
+    /**
+     * 对应项编码
+     */
+    //@Excel(name = "对应项编码", width = 40, orderNum = "2")
+    private String uniqueCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "PacsConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        PacsConfig pacsConfig = (PacsConfig) o;
+        return Objects.equals(id, pacsConfig.id)
+                && Objects.equals(isDeleted, pacsConfig.isDeleted)
+                && Objects.equals(hospitalId, pacsConfig.hospitalId)
+                && Objects.equals(hisName, pacsConfig.hisName)
+                && Objects.equals(uniqueName, pacsConfig.uniqueName)
+                && Objects.equals(uniqueCode, pacsConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+}

+ 210 - 0
cdssman-service/src/main/java/com/diagbot/entity/Permission.java

@@ -0,0 +1,210 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统资源表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-10
+ */
+@TableName("sys_permission")
+public class Permission 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 name;
+
+    /**
+     * 资源编码
+     */
+    private String code;
+
+    /**
+     * 资源Url
+     */
+    @TableField("permissionUrl")
+    private String permissionUrl;
+
+    /**
+     * 资源允许的请求方式
+     */
+    private String method;
+
+    /**
+     * 资源描述
+     */
+    private String descritpion;
+
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    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 getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getPermissionUrl() {
+        return permissionUrl;
+    }
+
+    public void setPermissionUrl(String permissionUrl) {
+        this.permissionUrl = permissionUrl;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public String getDescritpion() {
+        return descritpion;
+    }
+
+    public void setDescritpion(String descritpion) {
+        this.descritpion = descritpion;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "Permission{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", name=" + name +
+                ", code=" + code +
+                ", permissionUrl=" + permissionUrl +
+                ", method=" + method +
+                ", descritpion=" + descritpion +
+                ", type=" + type +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 180 - 0
cdssman-service/src/main/java/com/diagbot/entity/Plan.java

@@ -0,0 +1,180 @@
+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 wangfeng
+ * @since 2020-08-07
+ */
+@TableName("tran_plan")
+public class Plan 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 Long hospitalId;
+
+    /**
+     * 方案名称
+     */
+    private String planName;
+
+    /**
+     * 方案编号
+     */
+    private String planCode;
+
+    /**
+     * 方案启动1:启动,0:不启用
+     */
+    private Integer planStatus;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getPlanName() {
+        return planName;
+    }
+
+    public void setPlanName(String planName) {
+        this.planName = planName;
+    }
+
+    public String getPlanCode() {
+        return planCode;
+    }
+
+    public void setPlanCode(String planCode) {
+        this.planCode = planCode;
+    }
+
+    public Integer getPlanStatus() {
+        return planStatus;
+    }
+
+    public void setPlanStatus(Integer planStatus) {
+        this.planStatus = planStatus;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "Plan{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", planName=" + planName +
+                ", planCode=" + planCode +
+                ", planStatus=" + planStatus +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 243 - 0
cdssman-service/src/main/java/com/diagbot/entity/PlanDetail.java

@@ -0,0 +1,243 @@
+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 wangfeng
+ * @since 2020-08-07
+ */
+@TableName("tran_plan_detail")
+public class PlanDetail 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 Long hospitalId;
+
+    /**
+     * 方案编号
+     */
+    private Long planId;
+
+    private Long parentId;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 是否显示(1是,0否)
+     */
+    private Integer status;
+
+    /**
+     * 显示个数
+     */
+    private Integer number;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    private String remark;
+
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public Long getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(Long planId) {
+        this.planId = planId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "PlanDetail{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", planId=" + planId +
+                ", name=" + name +
+                ", status=" + status +
+                ", number=" + number +
+                ", orderNo=" + orderNo +
+                ", code=" + code +
+                ", value=" + value +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 21 - 0
cdssman-service/src/main/java/com/diagbot/entity/Token.java

@@ -0,0 +1,21 @@
+package com.diagbot.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-05 11:08
+ */
+@Getter
+@Setter
+public class Token implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String token;
+
+}

+ 197 - 0
cdssman-service/src/main/java/com/diagbot/entity/TokenHospital.java

@@ -0,0 +1,197 @@
+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 wangfeng
+ * @since 2020-08-06
+ */
+@TableName("sys_token_hospital")
+public class TokenHospital 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;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * token
+     */
+    private String appidToken;
+
+    /**
+     * 开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 有限天数
+     */
+    private Integer validDays;
+
+    /**
+     * 备注
+     */
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getAppidToken() {
+        return appidToken;
+    }
+
+    public void setAppidToken(String appidToken) {
+        this.appidToken = appidToken;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getValidDays() {
+        return validDays;
+    }
+
+    public void setValidDays(Integer validDays) {
+        this.validDays = validDays;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "TokenHospital{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", appidToken=" + appidToken +
+                ", startTime=" + startTime +
+                ", endTime=" + endTime +
+                ", validDays=" + validDays +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 180 - 0
cdssman-service/src/main/java/com/diagbot/entity/TokenPermission.java

@@ -0,0 +1,180 @@
+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 wangfeng
+ * @since 2020-08-10
+ */
+@TableName("sys_token_permission")
+public class TokenPermission 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;
+
+    /**
+     * tokenId
+     */
+    private Long tokenId;
+
+    /**
+     * url资源id
+     */
+    private Long permissionId;
+
+    /**
+     * 特殊处理参数
+     */
+    private String paramKey;
+
+    /**
+     * 特殊处理参数值
+     */
+    private String paramValue;
+
+    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 Long getTokenId() {
+        return tokenId;
+    }
+
+    public void setTokenId(Long tokenId) {
+        this.tokenId = tokenId;
+    }
+
+    public Long getPermissionId() {
+        return permissionId;
+    }
+
+    public void setPermissionId(Long permissionId) {
+        this.permissionId = permissionId;
+    }
+
+    public String getParamKey() {
+        return paramKey;
+    }
+
+    public void setParamKey(String paramKey) {
+        this.paramKey = paramKey;
+    }
+
+    public String getParamValue() {
+        return paramValue;
+    }
+
+    public void setParamValue(String paramValue) {
+        this.paramValue = paramValue;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "TokenPermission{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", tokenId=" + tokenId +
+                ", permissionId=" + permissionId +
+                ", paramKey=" + paramKey +
+                ", paramValue=" + paramValue +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 197 - 0
cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java

@@ -0,0 +1,197 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 输血映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-31
+ */
+@TableName("tran_transfusion_config")
+public class TransfusionConfig 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;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院用血类型
+     */
+    @Excel(name = "医院输血类型", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院输血类型")
+    private String hisName;
+
+    /**
+     * 标准用血术语
+     */
+    @Excel(name = "标准输血类型", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准输血类型")
+    private String uniqueName;
+
+    /**
+     * 对应项编码
+     */
+    //@Excel(name = "对应项编码", width = 40, orderNum = "2")
+    private String uniqueCode;
+
+    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 Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "TransfusionConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        TransfusionConfig transfusionConfig = (TransfusionConfig) o;
+        return Objects.equals(id, transfusionConfig.id)
+                && Objects.equals(isDeleted, transfusionConfig.isDeleted)
+                && Objects.equals(hospitalId, transfusionConfig.hospitalId)
+                && Objects.equals(hisName, transfusionConfig.hisName)
+                && Objects.equals(uniqueName, transfusionConfig.uniqueName)
+                && Objects.equals(uniqueCode, transfusionConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+}

+ 198 - 0
cdssman-service/src/main/java/com/diagbot/entity/User.java

@@ -0,0 +1,198 @@
+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.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统用户表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@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 username;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 联系人
+     */
+    private String linkman;
+
+    /**
+     * 是否启用(0:停用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 1内部用户,0外部用户(默认0)
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    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 getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getLinkman() {
+        return linkman;
+    }
+
+    public void setLinkman(String linkman) {
+        this.linkman = linkman;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "User{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", username=" + username +
+                ", password=" + password +
+                ", linkman=" + linkman +
+                ", status=" + status +
+                ", type=" + type +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 155 - 0
cdssman-service/src/main/java/com/diagbot/entity/UserHospital.java

@@ -0,0 +1,155 @@
+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 wangfeng
+ * @since 2020-08-11
+ */
+@TableName("sys_user_hospital")
+public class UserHospital 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 Long userId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 备注
+     */
+    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 Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "UserHospital{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", userId=" + userId +
+                ", hospitalId=" + hospitalId +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 156 - 0
cdssman-service/src/main/java/com/diagbot/entity/UserRole.java

@@ -0,0 +1,156 @@
+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.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统用户角色关联表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-11
+ */
+@TableName("sys_user_role")
+public class UserRole 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;
+
+    /**
+     * 系统用户表.用户ID
+     */
+    private Long userId;
+
+    /**
+     * 系统角色表.角色ID
+     */
+    private Long roleId;
+
+    /**
+     * 备注
+     */
+    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 Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "UserRole{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", userId=" + userId +
+                ", roleId=" + roleId +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 194 - 0
cdssman-service/src/main/java/com/diagbot/entity/VersionDetail.java

@@ -0,0 +1,194 @@
+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 wangfeng
+ * @since 2020-08-06
+ */
+@TableName("sys_version_detail")
+public class VersionDetail 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;
+
+    /**
+     * 版本主表id
+     */
+    private Long versionId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 排序号
+     */
+    private String orderNo;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    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 Long getVersionId() {
+        return versionId;
+    }
+
+    public void setVersionId(Long versionId) {
+        this.versionId = versionId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    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 "VersionDetail{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", versionId=" + versionId +
+                ", title=" + title +
+                ", description=" + description +
+                ", orderNo=" + orderNo +
+                ", status=" + status +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 163 - 0
cdssman-service/src/main/java/com/diagbot/entity/VersionInfo.java

@@ -0,0 +1,163 @@
+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 wangfeng
+ * @since 2020-08-06
+ */
+@TableName("sys_version_info")
+public class VersionInfo 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 name;
+
+    private Date refreshTime;
+
+    /**
+     * 1:启动,0:不启用
+     */
+    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 getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Date getRefreshTime() {
+        return refreshTime;
+    }
+
+    public void setRefreshTime(Date refreshTime) {
+        this.refreshTime = refreshTime;
+    }
+
+    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 "VersionInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", name=" + name +
+                ", refreshTime=" + refreshTime +
+                ", status=" + status +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 69 - 0
cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -0,0 +1,69 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/9/10 15:51
+ */
+public enum ConceptTypeEnum implements KeyedNamed {
+    LisPack(1, "检验套餐"),
+    Lis(2, "检验细项"),
+    Pacs(3, "检查"),
+    Disease(4, "诊断"),
+    Drug(5, "药品"),
+    Opeartion(6, "手术和操作"),
+    Dept(7, "科室"),
+    Transfusion(8, "输血");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    ConceptTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ConceptTypeEnum getEnum(int key) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static ConceptTypeEnum getEnum(String name) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        ConceptTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        ConceptTypeEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 45 - 0
cdssman-service/src/main/java/com/diagbot/enums/DisclaimerCodeEnum.java

@@ -0,0 +1,45 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+public enum DisclaimerCodeEnum implements KeyedNamed {
+
+    DiagnoseDisclaimer(1, "免责信息"),
+    PushLiability(2, "推送免责信息");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    DisclaimerCodeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static DisclaimerCodeEnum getEnum(int key) {
+        for (DisclaimerCodeEnum item : DisclaimerCodeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        DisclaimerCodeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 72 - 0
cdssman-service/src/main/java/com/diagbot/enums/StaticTypeEnum.java

@@ -0,0 +1,72 @@
+/*
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+*/
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/18 16:30
+ *//*
+
+public enum StaticTypeEnum implements KeyedNamed {
+    All(0, "全部"),
+    Disease(1, "诊断"),
+    Drug(2, "药品"),
+    LisPack(3, "检验套餐"),
+    Lis(4, "检验细项"),
+    Pacs(5, "检查"),
+    PacsSubName(6, "检查子项"),
+    Opeartion(7, "手术和操作");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    StaticTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static StaticTypeEnum getEnum(int key) {
+        for (StaticTypeEnum item : StaticTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static StaticTypeEnum getEnum(String name) {
+        for (StaticTypeEnum item : StaticTypeEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        StaticTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        StaticTypeEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}*/

+ 50 - 0
cdssman-service/src/main/java/com/diagbot/enums/StatusEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum StatusEnum implements KeyedNamed {
+    Disable(0, "禁用"),
+    Enable(1, "启用");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    StatusEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static StatusEnum getEnum(int key) {
+        for (StatusEnum item : StatusEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        StatusEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

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

+ 39 - 0
cdssman-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java

@@ -0,0 +1,39 @@
+package com.diagbot.exception;
+
+/**
+ * @Description: 本服务错误码
+ * 系统码(3位) + 等级码(1位) + 4位顺序号
+ * 系统码 通用码 000;用户中心 100; 管理中心 200;
+ * @author: gaodm
+ * @time: 2018/9/10 11:11
+ */
+public enum ServiceErrorCode implements ErrorCode {
+    LOG_IS_NOT_EXIST("90020001", "该日志不存在");
+
+    private String code;
+    private String msg;
+
+
+    ServiceErrorCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public static ServiceErrorCode codeOf(String code) {
+        for (ServiceErrorCode state : values()) {
+            if (state.getCode() == code) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.ConceptDetailServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/19 14:19
+ */
+@Component
+public class ConceptDetailFacade extends ConceptDetailServiceImpl {
+}

+ 451 - 0
cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -0,0 +1,451 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.ConceptDetailDTO;
+import com.diagbot.dto.ConceptInfoDTO;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.entity.ConceptDetail;
+import com.diagbot.entity.ConceptInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.ConceptDetailService;
+import com.diagbot.service.impl.ConceptInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.ConceptDetailVO;
+import com.diagbot.vo.ConceptInfoPageVO;
+import com.diagbot.vo.ConceptInfoVO;
+import com.diagbot.vo.HasStaticKnowledgeVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.StaticKnowledgeIndexVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/19 14:17
+ */
+@Component
+public class ConceptInfoFacade extends ConceptInfoServiceImpl {
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
+    @Autowired
+    private ConceptDetailFacade conceptDetailFacade;
+    @Autowired
+    @Qualifier("conceptDetailServiceImpl")
+    private ConceptDetailService conceptDetailService;
+
+    /**
+     * 返回不带静态知识的检索结果
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    public List<StaticKnowledgeIndexDTO> staticKnowledgeIndexWithoutInfo(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        staticKnowledgeIndexVO.setHasInfo(0);
+        List<StaticKnowledgeIndexDTO> staticKnowledgeIndexDTOList = staticKnowledgeIndex(staticKnowledgeIndexVO);
+        //过滤没有静态知识的检索结果
+        staticKnowledgeIndexDTOList = staticKnowledgeIndexDTOList
+                .stream()
+                .filter(i -> i.getHasInfo().equals(0))
+                .collect(Collectors.toList());
+        return staticKnowledgeIndexDTOList;
+    }
+
+    /**
+     * 医学知识(静态信息)检索
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    public List<StaticKnowledgeIndexDTO> staticKnowledgeIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
+        //静态知识检索顺序
+        List<DictionaryInfoDTO> dicStaticIndexList = dictionaryFacade.getListByGroupType(7);
+        //页面术语类型和图谱映射
+        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+
+        List<StaticKnowledgeIndexDTO> staticKnowledgeIndexDTOList = Lists.newLinkedList();
+        RespDTO<List<StaticKnowledgeIndexDTO>> respDTO = cdssCoreClient.staticKnowledgeIndex(staticKnowledgeIndexVO);
+        RespDTOUtil.respNGDealCover(respDTO, "检索失败");
+        staticKnowledgeIndexDTOList = respDTO.data;
+        if (ListUtil.isNotEmpty(staticKnowledgeIndexDTOList)) {
+            //typeName转换
+            staticKnowledgeIndexDTOList.forEach(item -> {
+                item.setTypeName(convertTypeName(item.getTypeName(), 2, dicTypeMappingList));
+            });
+            if (staticKnowledgeIndexVO.getHasInfo().equals(1)) {
+                //是否有静态知识
+                List<String> conNameList = staticKnowledgeIndexDTOList
+                        .stream()
+                        .map(i -> i.getName())
+                        .collect(Collectors.toList());
+                QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
+                conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("name", conNameList)
+                        .eq("status", StatusEnum.Enable.getKey());
+                List<ConceptInfo> conceptInfoList = this.list(conceptInfoQueryWrapper);
+                if (ListUtil.isNotEmpty(conceptInfoList)) {
+                    //typeName转换
+                    conceptInfoList.forEach(item -> {
+                        item.setType(convertTypeName(item.getType(), 2, dicTypeMappingList));
+                    });
+                    Map<String, ConceptInfo> infoMap
+                            = EntityUtil.makeEntityMapByKeys(conceptInfoList, "_", "name", "type");
+                    for (StaticKnowledgeIndexDTO item : staticKnowledgeIndexDTOList) {
+                        if (infoMap.containsKey(item.getName() + "_" + item.getTypeName())) {
+                            item.setId(infoMap.get(item.getName() + "_" + item.getTypeName()).getId());
+                        }
+                    }
+                    List<Long> conceptIdList = conceptInfoList.stream()
+                            .map(i -> i.getId())
+                            .collect(Collectors.toList());
+                    if (ListUtil.isNotEmpty(conceptIdList)) {
+                        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+                        conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+                        conceptDetailQueryWrapper.in("concept_id", conceptIdList);
+                        List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(conceptDetailQueryWrapper);
+                        Map<Long, List<ConceptDetail>> detailMap
+                                = EntityUtil.makeEntityListMap(conceptDetailList, "conceptId");
+                        for (StaticKnowledgeIndexDTO item : staticKnowledgeIndexDTOList) {
+                            if (item.getId() == null
+                                    || !detailMap.containsKey(item.getId())) {
+                                item.setHasInfo(0);
+                                item.setHasStaticKnowledge(0);
+                                item.setHasClinicalPathway(0);
+                                item.setHasNotice((0));
+                                item.setHasTreatInfo(0);
+                                continue;
+                            }
+                            for (ConceptDetail detail : detailMap.get(item.getId())) {
+                                item.setHasInfo(1);
+                                List<String> contentTypeList = Arrays.asList(detail.getContentType().split(","));
+                                if (contentTypeList.contains("1")) {
+                                    item.setHasStaticKnowledge(1);
+                                }
+                                if (contentTypeList.contains("2")) {
+                                    item.setHasNotice(1);
+                                }
+                                if (contentTypeList.contains("3")) {
+                                    item.setHasClinicalPathway(1);
+                                }
+                                if (contentTypeList.contains("4")) {
+                                    item.setHasTreatInfo(1);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            //排序
+            Map<String, List<StaticKnowledgeIndexDTO>> map
+                    = EntityUtil.makeEntityListMap(staticKnowledgeIndexDTOList, "typeName");
+            Map<Integer, String> staticTypeDicMap =
+                    EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+            for (DictionaryInfoDTO dic : dicStaticIndexList) {
+                if (dic.getName().equals("检验")) {
+                    //3-检验套餐、4-检验细项
+                    if (map.containsKey(staticTypeDicMap.get("3"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("3")));
+                    }
+                    if (map.containsKey(staticTypeDicMap.get("4"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("4")));
+                    }
+                } else if (dic.getName().equals("检查")) {
+                    //5-检查、6-检查子项
+                    if (map.containsKey(staticTypeDicMap.get("5"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("5")));
+                    }
+                    if (map.containsKey(staticTypeDicMap.get("6"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("6")));
+                    }
+                } else if (map.containsKey(dic.getName())) {
+                    retList.addAll(map.get(dic.getName()));
+                }
+            }
+        }
+        return retList;
+    }
+
+    /**
+     * 页面术语类型和图谱标签名称相互转换
+     *
+     * @param typeName
+     * @param flag     1-页面术语类型转图谱标签名称,2- 图谱标签名称转页面术语类型
+     * @param dicList
+     * @return
+     */
+    public String convertTypeName(String typeName, Integer flag, List<DictionaryInfoDTO> dicList) {
+        if (ListUtil.isNotEmpty(dicList)) {
+            Map<String, String> nameValMap = new HashMap<>();
+            if (flag.equals(1)) {
+                nameValMap = EntityUtil.makeMapWithKeyValue(dicList, "name", "val");
+            } else if (flag.equals(2)) {
+                nameValMap = EntityUtil.makeMapWithKeyValue(dicList, "val", "name");
+            }
+            if (nameValMap.containsKey(typeName)) {
+                return nameValMap.get(typeName);
+            }
+        }
+        return typeName;
+    }
+
+    /**
+     * 列表
+     *
+     * @param conceptInfoPageVO
+     * @return
+     */
+    public IPage<ConceptInfoDTO> getPage(ConceptInfoPageVO conceptInfoPageVO) {
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
+        if (StringUtil.isNotBlank(conceptInfoPageVO.getType())) {
+            String typeName
+                    = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoPageVO.getType()), 1, dicList);
+            conceptInfoPageVO.setTypeName(typeName);
+        }
+        IPage<ConceptInfoDTO> page = super.getPage(conceptInfoPageVO);
+        List<ConceptInfoDTO> records = page.getRecords();
+        if (ListUtil.isNotEmpty(records)) {
+            records.forEach(record -> {
+                String typeName = convertTypeName(record.getType(), 2, dicList);
+                record.setTypeName(typeName);
+                record.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
+            });
+        }
+        page.setRecords(records);
+        return page;
+    }
+
+    /**
+     * 保存记录(新增or修改)
+     *
+     * @param conceptInfoVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(ConceptInfoVO conceptInfoVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
+        //术语类型转换
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoVO.getType()), 1, dicList);
+        conceptInfoVO.setTypeName(typeName);
+        ConceptInfo conceptInfo = new ConceptInfo();
+
+        if (conceptInfoVO.getId() != null) {
+            conceptInfo = this.getById(conceptInfoVO.getId());
+            if (conceptInfo != null
+                    && !conceptInfo.getName().equals(conceptInfoVO.getName())) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准术语名称不允许修改");
+            }
+        } else {
+            QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
+            conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("name", conceptInfoVO.getName())
+                    .eq("type", typeName);
+            conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
+            //术语不存在,保存术语信息
+            if (conceptInfo == null) {
+                conceptInfo = new ConceptInfo();
+                conceptInfo.setCreator(userId);
+                conceptInfo.setGmtCreate(now);
+            }
+        }
+        conceptInfo.setName(conceptInfoVO.getName());
+        conceptInfo.setClinicalPathwayName(conceptInfoVO.getClinicalPathwayName());
+        conceptInfo.setNoticeName(conceptInfoVO.getNoticeName());
+        conceptInfo.setType(typeName);
+        conceptInfo.setModifier(userId);
+        conceptInfo.setGmtModified(now);
+
+        //是否包含静态信息
+        List<ConceptDetail> oldDetails = null;
+        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+        if (conceptInfo.getId() != null) {
+            conceptDetailQueryWrapper.eq("concept_id", conceptInfo.getId());
+            conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            oldDetails = conceptDetailFacade.list(conceptDetailQueryWrapper);
+        }
+        if (conceptInfoVO.getId() == null
+                && ListUtil.isNotEmpty(oldDetails)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "静态信息已添加,不允许重复添加");
+        }
+        if (ListUtil.isEmpty(oldDetails)
+                && ListUtil.isNotEmpty(conceptInfoVO.getDetails())) {
+            //TODO 更新图谱是否有静态信息
+            HasStaticKnowledgeVO hasStaticKnowledgeVO = new HasStaticKnowledgeVO();
+            hasStaticKnowledgeVO.setName(conceptInfoVO.getName());
+            hasStaticKnowledgeVO.setType(typeName);
+            hasStaticKnowledgeVO.setHasInfo(1);
+            RespDTO<Boolean> respDTO = cdssCoreClient.updateHasInfoStatus(hasStaticKnowledgeVO);
+            //更新失败
+            if (RespDTOUtil.respIsNG(respDTO)) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "图谱更新静态知识状态失败");
+            }
+        }
+
+        //删除已有静态信息
+        if (conceptInfo.getId() != null) {
+            conceptDetailFacade.remove(conceptDetailQueryWrapper);
+        }
+
+        //更新术语信息
+        this.saveOrUpdate(conceptInfo);
+
+        //插入新的静态信息
+        List<ConceptDetail> conceptDetailList = Lists.newLinkedList();
+        if (ListUtil.isNotEmpty(conceptInfoVO.getDetails())) {
+            for (ConceptDetailVO detailVO : conceptInfoVO.getDetails()) {
+                ConceptDetail conceptDetail = new ConceptDetail();
+                BeanUtil.copyProperties(detailVO, conceptDetail);
+                conceptDetail.setConceptId(conceptInfo.getId());
+                conceptDetail.setCreator(userId);
+                conceptDetail.setGmtCreate(now);
+                conceptDetail.setModifier(userId);
+                conceptDetail.setGmtModified(now);
+                conceptDetailList.add(conceptDetail);
+            }
+            conceptDetailService.saveBatch(conceptDetailList);
+        }
+        return true;
+    }
+
+    /**
+     * 启用禁用
+     *
+     * @param changeStatusVO
+     * @return
+     */
+    public Boolean changeStatus(ChangeStatusVO changeStatusVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        //更新主表
+        UpdateWrapper<ConceptInfo> conceptInfoUpdateWrapper = new UpdateWrapper<>();
+        conceptInfoUpdateWrapper.eq("id", changeStatusVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("gmt_modified", now)
+                .set("modifier", userId)
+                .set("status", changeStatusVO.getStatus());
+        this.update(conceptInfoUpdateWrapper);
+        //更新明细表
+        UpdateWrapper<ConceptDetail> conceptDetailUpdateWrapper = new UpdateWrapper<>();
+        conceptDetailUpdateWrapper.eq("concept_id", changeStatusVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("gmt_modified", now)
+                .set("modifier", userId);
+        conceptDetailService.update(conceptDetailUpdateWrapper);
+        return true;
+    }
+
+    /**
+     * 是否已存在
+     *
+     * @param conceptInfoVO
+     * @return
+     */
+    public Boolean isExist(ConceptInfoVO conceptInfoVO) {
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
+        //术语类型转换
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        conceptInfoVO.setTypeName(typeName);
+        QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
+        conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("name", conceptInfoVO.getName())
+                .eq("type", typeName);
+        ConceptInfo conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
+        if (conceptInfo == null) {
+            return false;
+        }
+        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+        conceptDetailQueryWrapper.eq("concept_id", conceptInfo.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<ConceptDetail> conceptDetailList = conceptDetailService.list(conceptDetailQueryWrapper);
+        if (ListUtil.isEmpty(conceptDetailList)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 根据术语id获取静态信息
+     *
+     * @param idVO
+     * @return
+     */
+    public ConceptInfoDTO getRecordById(IdVO idVO) {
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
+        ConceptInfoDTO conceptInfoDTO = new ConceptInfoDTO();
+        ConceptInfo conceptInfo = this.getById(idVO.getId());
+        if (conceptInfo == null) {
+            return null;
+        }
+        BeanUtil.copyProperties(conceptInfo, conceptInfoDTO);
+        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+        conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("concept_id", idVO.getId())
+                .orderByAsc("order_no");
+        List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(conceptDetailQueryWrapper);
+        if (ListUtil.isNotEmpty(conceptDetailList)) {
+            List<ConceptDetailDTO> details = BeanUtil.listCopyTo(conceptDetailList, ConceptDetailDTO.class);
+            conceptInfoDTO.setDetails(details);
+            //启用状态、修改人、修改时间为明细的内容
+            String typeName = convertTypeName(conceptInfoDTO.getType(), 2, dicList);
+            conceptInfoDTO.setTypeName(typeName);
+            conceptInfoDTO.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
+            conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
+            conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
+        }
+        return conceptInfoDTO;
+    }
+}

+ 422 - 0
cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -0,0 +1,422 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DeptConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.DeptConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.DeptConfigListVO;
+import com.diagbot.vo.DeptConfigPageVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 14:25
+ */
+@Component
+public class DeptConfigFacade {
+    @Autowired
+    private DeptConfigService deptConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param deptConfig
+     * @return
+     */
+    public Boolean isExistRecord(DeptConfig deptConfig) {
+        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", deptConfig.getHospitalId())
+                .eq("his_name", deptConfig.getHisName())
+                .eq("unique_name", deptConfig.getUniqueName());
+        DeptConfig oldRecord = deptConfigService.getOne(queryWrapper, false);
+        if (deptConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (deptConfig.getId() != null
+                && oldRecord != null
+                && !deptConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param deptConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(DeptConfig deptConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        deptConfig.setModifier(userId);
+        deptConfig.setGmtModified(now);
+        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", deptConfig.getHospitalId())
+                .eq("his_name", deptConfig.getHisName())
+                .eq("unique_name", deptConfig.getUniqueName());
+        DeptConfig oldRecord = deptConfigService.getOne(queryWrapper, false);
+        if (deptConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (deptConfig.getId() != null
+                && oldRecord != null
+                && !deptConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (deptConfig.getId() == null) {
+            deptConfig.setCreator(userId);
+            deptConfig.setGmtCreate(now);
+        }
+        if (deptConfig.getIsDeleted() == null) {
+            deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        deptConfigService.saveOrUpdate(deptConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param deptConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(DeptConfigListVO deptConfigListVO) {
+        if (ListUtil.isEmpty(deptConfigListVO.getDeptConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(deptConfigListVO.getDeptConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param deptConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<DeptConfig> deptConfigList) {
+        if (ListUtil.isEmpty(deptConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        deptConfigList = deptConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(deptConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = deptConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(hospitalId, null, null);
+        deptConfigList.forEach(deptConfig -> {
+            deptConfig.setModifier(userId);
+            deptConfig.setGmtModified(now);
+            if (deptConfig.getId() == null) {
+                if (configMap.containsKey(deptConfig.getHisName())) {
+                    deleteIds.add(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
+                }
+                deptConfig.setCreator(userId);
+                deptConfig.setGmtCreate(now);
+            }
+            if (deptConfig.getIsDeleted() == null) {
+                deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        deptConfigService.saveOrUpdateBatch(deptConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<DeptConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        deptConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<DeptConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        deptConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param deptConfigPageVO
+     * @return
+     */
+    public IPage<DeptConfig> getPage(DeptConfigPageVO deptConfigPageVO) {
+        return deptConfigService.getPage(deptConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<DeptConfig> deptConfigList = ExcelUtils.importExcel(file, 0, 1, DeptConfig.class);
+        if (ListUtil.isNotEmpty(deptConfigList)) {
+            deptConfigList.forEach(deptConfig -> {
+                deptConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(deptConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param deptConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<DeptConfig> deptConfigList, HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        deptConfigList = deptConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getHisCode())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(deptConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < deptConfigList.size(); i++) {
+            if (StringUtil.isBlank(deptConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(deptConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(deptConfigList.get(i).getHisName())) {
+                deptConfigList.get(i).setHisName(deptConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(deptConfigList.get(i).getHisCode())) {
+                deptConfigList.get(i).setHisCode(deptConfigList.get(i).getHisCode().trim());
+            }
+            if (StringUtil.isNotBlank(deptConfigList.get(i).getUniqueName())) {
+                deptConfigList.get(i).setUniqueName(deptConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(deptConfigList.get(i).getUniqueCode())) {
+                deptConfigList.get(i).setUniqueCode(deptConfigList.get(i).getUniqueCode().trim());
+            } else {
+                deptConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        deptConfigList.forEach(deptConfig -> {
+            deptConfig.setHospitalId(hospitalId);
+            deptConfig.setModifier(userId);
+            deptConfig.setGmtModified(now);
+            if (deptConfig.getId() == null) {
+                if (configMap.containsKey(deptConfig.getHisName())) {
+                    deleteIds.add(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
+                }
+                deptConfig.setCreator(userId);
+                deptConfig.setGmtCreate(now);
+            }
+            if (deptConfig.getIsDeleted() == null) {
+                deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        List<String> uniqueNames = deptConfigList.stream()
+                .map(i -> i.getUniqueName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Dept.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < deptConfigList.size(); i++) {
+            if (!names.contains(deptConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        deptConfigList = deptConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        deptConfigService.saveOrUpdateBatch(deptConfigList);
+        return true;
+    }
+
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DeptConfig> records = deptConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DeptConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DeptConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<DeptConfig> records = deptConfigService.list(queryWrapper);
+        String fileName = "科室映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return deptConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "科室映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
+    }
+}

+ 65 - 0
cdssman-service/src/main/java/com/diagbot/facade/DictionaryFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.DictionaryInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class DictionaryFacade extends DictionaryInfoServiceImpl {
+    /**
+     * 返回指定字典信息
+     *
+     * @param groupType
+     * @return
+     */
+    public List<DictionaryInfoDTO> getListByGroupType(Integer groupType) {
+        List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
+                .eq("group_type", groupType)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return listRes;
+    }
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfoDTO>> getList() {
+        List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 2L }))
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return EntityUtil.makeEntityListMap(listRes, "groupType");
+    }
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfoDTO>> getListBack() {
+        List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 1L }))
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        List<DictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, DictionaryInfoDTO.class);
+        return EntityUtil.makeEntityListMap(listRes, "groupType");
+    }
+}

+ 199 - 0
cdssman-service/src/main/java/com/diagbot/facade/DisclaimerInfoFacade.java

@@ -0,0 +1,199 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.UserServiceClient;
+import com.diagbot.dto.DisclaimerInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DisclaimerInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.DisclaimerInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.DisclaimerInfoIdVO;
+import com.diagbot.vo.DisclaimerInfoTitleVO;
+import com.diagbot.vo.DisclaimerInfoVO;
+import com.diagbot.vo.DisclaimerInformationAllVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-05 10:54
+ */
+@Component
+public class DisclaimerInfoFacade extends DisclaimerInfoServiceImpl {
+    @Autowired
+    UserServiceClient userServiceClient;
+
+    public IPage<DisclaimerInfoDTO> getDisclaimerInformation(DisclaimerInfoTitleVO disclaimerInfoTitleVO) {
+        IPage<DisclaimerInfoDTO> querDisclaimerInformation = getDisclaimerInformationAll(disclaimerInfoTitleVO);
+        List<DisclaimerInfoDTO> data = querDisclaimerInformation.getRecords();
+
+        List<String> modifierid = new ArrayList<>();
+        modifierid = data.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
+
+        Map<String, String> userNames = new HashMap<>();
+        if (ListUtil.isNotEmpty(modifierid)) {
+            RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
+            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                        "获取所有用户信息失败");
+            }
+            userNames = userNamesDTO.data;
+        }
+        List<DisclaimerInfoDTO> dataNew = new ArrayList<DisclaimerInfoDTO>();
+        for (DisclaimerInfoDTO disclaimerInformationDTO : data) {
+            DisclaimerInfoDTO dis = new DisclaimerInfoDTO();
+            BeanUtil.copyProperties(disclaimerInformationDTO, dis);
+            dis.setModifier(userNames.get(disclaimerInformationDTO.getModifier()));
+            dataNew.add(dis);
+        }
+        return querDisclaimerInformation.setRecords(dataNew);
+    }
+
+    public boolean addDisclaimerInformation(DisclaimerInfoVO disclaimerInfoVO) {
+        //每一处免责声明(免责声明按钮、推送免责声明、诊断免责声明)同时最多可启用1条内容,显示(按操作时间)最新的条记录;新添加免责声明,则自动展示新添加的内容;自动开启,最近一条数据自动停用;
+        UpdateWrapper<DisclaimerInfo> DisclaimerInformationStatus = new UpdateWrapper<>();
+        DisclaimerInformationStatus.eq("disclaimer_code", disclaimerInfoVO.getDisclaimerCode()).eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Disable.getKey());
+
+        update(new DisclaimerInfo(), DisclaimerInformationStatus);
+
+        DisclaimerInfo disclaimerInformation = new DisclaimerInfo();
+        disclaimerInformation.setCreator(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setDescription(disclaimerInfoVO.getDescription());
+        disclaimerInformation.setDisclaimerCode(disclaimerInfoVO.getDisclaimerCode());
+        disclaimerInformation.setGmtCreate(DateUtil.now());
+        disclaimerInformation.setGmtModified(DateUtil.now());
+        disclaimerInformation.setOrderNo(disclaimerInfoVO.getOrderNo());
+        disclaimerInformation.setRemark(disclaimerInfoVO.getRemark());
+        disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
+        disclaimerInformation.setTitle(disclaimerInfoVO.getTitle());
+        //disclaimerInformation.setVersionId();
+
+        boolean res = save(disclaimerInformation);
+
+        return res;
+    }
+
+    public boolean updateDisclaimerInformation(DisclaimerInformationAllVO disclaimerInformationAllVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationAllVO.getId());
+        // 2.修改版本详情信息
+        DisclaimerInfo disclaimerInformation = new DisclaimerInfo();
+
+        disclaimerInformation.setGmtModified(DateUtil.now());// 修改时间
+        disclaimerInformation.setModifier(UserUtils.getCurrentPrincipleID());
+        disclaimerInformation.setDescription(disclaimerInformationAllVO.getDescription());
+        disclaimerInformation.setDisclaimerCode(disclaimerInformationAllVO.getDisclaimerCode());
+        disclaimerInformation.setGmtCreate(DateUtil.now());
+        disclaimerInformation.setId(disclaimerInformationAllVO.getId());
+        //disclaimerInformation.setOrderNo(disclaimerInformationAllVO.getOrderNo());
+        //disclaimerInformation.setRemark(disclaimerInformationAllVO.getRemark());
+        //disclaimerInformation.setStatus(String.valueOf(StatusEnum.Enable.getKey()));
+        disclaimerInformation.setTitle(disclaimerInformationAllVO.getTitle());
+
+        boolean res = updateById(disclaimerInformation);
+
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+
+        return res;
+    }
+
+    /**
+     * 删除
+     *
+     * @return
+     */
+    public Boolean cancelDisclaimerInformation(DisclaimerInfoIdVO disclaimerInformationIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInformationIdVO.getId());
+        UpdateWrapper<DisclaimerInfo> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew
+                .eq("id", disclaimerInformationIdVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("is_deleted", IsDeleteEnum.Y.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        return update(new DisclaimerInfo(), disclaimerInformationNew);
+    }
+
+    /**
+     * 启用
+     *
+     * @return
+     */
+    public boolean startDisclaimerInformations(DisclaimerInfoIdVO disclaimerInfoIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInfoIdVO.getId());
+        //每一处免责声明(免责声明按钮、推送免责声明、诊断免责声明)同时最多可启用1条内容,显示(按操作时间)最新的条记录;新添加免责声明,则自动展示新添加的内容;自动开启,最近一条数据自动停用;
+        //  QueryWrapper<DisclaimerInformation> data = new QueryWrapper<DisclaimerInformation>();
+        // data.in("id", disclaimerInformationIdVO.getId()).eq("is_deleted", IsDeleteEnum.N.getKey());
+        DisclaimerInfo disclaimerInformation = getById(disclaimerInfoIdVO.getId());
+
+        UpdateWrapper<DisclaimerInfo> DisclaimerInformationStatus = new UpdateWrapper<>();
+        DisclaimerInformationStatus.eq("disclaimer_code", disclaimerInformation.getDisclaimerCode()).eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Disable.getKey());
+
+        update(new DisclaimerInfo(), DisclaimerInformationStatus);
+
+        UpdateWrapper<DisclaimerInfo> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew
+                .eq("id", disclaimerInfoIdVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Disable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Enable.getKey());
+        return update(new DisclaimerInfo(), disclaimerInformationNew);
+    }
+
+    /**
+     * 停用
+     *
+     * @return
+     */
+    public boolean endDisclaimerInformations(DisclaimerInfoIdVO disclaimerInfoIdVO) {
+        // 1.先判断数据是否存在有效
+        checkExist(disclaimerInfoIdVO.getId());
+        UpdateWrapper<DisclaimerInfo> disclaimerInformationNew = new UpdateWrapper<>();
+        disclaimerInformationNew
+                .eq("id", disclaimerInfoIdVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Enable.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now()).set("status", StatusEnum.Disable.getKey());
+        return update(new DisclaimerInfo(), disclaimerInformationNew);
+    }
+
+
+    /**
+     * 判断数据是否存在有效
+     *
+     * @param id
+     */
+    private void checkExist(Long id) {
+        QueryWrapper<DisclaimerInfo> disclaimerInformationFand = new QueryWrapper<>();
+        disclaimerInformationFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        int sum = count(disclaimerInformationFand);
+        if (sum == 0) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+    }
+}
+

+ 409 - 0
cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -0,0 +1,409 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.DiseaseConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.DiseaseConfigListVO;
+import com.diagbot.vo.DiseaseConfigPageVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/29 15:05
+ */
+@Component
+public class DiseaseConfigFacade {
+    @Autowired
+    private DiseaseConfigService diseaseConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param diseaseConfig
+     * @return
+     */
+    public Boolean isExistRecord(DiseaseConfig diseaseConfig) {
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", diseaseConfig.getHospitalId())
+                .eq("his_name", diseaseConfig.getHisName())
+                .eq("unique_name", diseaseConfig.getUniqueName());
+        DiseaseConfig oldRecord = diseaseConfigService.getOne(queryWrapper, false);
+        if (diseaseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (diseaseConfig.getId() != null
+                && oldRecord != null
+                && !diseaseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param diseaseConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(DiseaseConfig diseaseConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        diseaseConfig.setModifier(userId);
+        diseaseConfig.setGmtModified(now);
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", diseaseConfig.getHospitalId())
+                .eq("his_name", diseaseConfig.getHisName())
+                .eq("unique_name", diseaseConfig.getUniqueName());
+        DiseaseConfig oldRecord = diseaseConfigService.getOne(queryWrapper, false);
+        if (diseaseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (diseaseConfig.getId() != null
+                && oldRecord != null
+                && !diseaseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (diseaseConfig.getId() == null) {
+            diseaseConfig.setCreator(userId);
+            diseaseConfig.setGmtCreate(now);
+        }
+        if (diseaseConfig.getIsDeleted() == null) {
+            diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        diseaseConfigService.saveOrUpdate(diseaseConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param diseaseConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(DiseaseConfigListVO diseaseConfigListVO) {
+        if (ListUtil.isEmpty(diseaseConfigListVO.getDiseaseConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(diseaseConfigListVO.getDiseaseConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param diseaseConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<DiseaseConfig> diseaseConfigList) {
+        if (ListUtil.isEmpty(diseaseConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        diseaseConfigList = diseaseConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(diseaseConfigList)) {
+            return false;
+        }
+        Long hospitalId = diseaseConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(hospitalId, null, null);
+        diseaseConfigList.forEach(diseaseConfig -> {
+            diseaseConfig.setModifier(userId);
+            diseaseConfig.setGmtModified(now);
+            if (diseaseConfig.getId() == null) {
+                if (configMap.containsKey(diseaseConfig.getHisName())) {
+                    deleteIds.add(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
+                }
+                diseaseConfig.setCreator(userId);
+                diseaseConfig.setGmtCreate(now);
+            }
+            if (diseaseConfig.getIsDeleted() == null) {
+                diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        diseaseConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        diseaseConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param diseaseConfigPageVO
+     * @return
+     */
+    public IPage<DiseaseConfig> getPage(DiseaseConfigPageVO diseaseConfigPageVO) {
+        return diseaseConfigService.getPage(diseaseConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<DiseaseConfig> diseaseConfigList = ExcelUtils.importExcel(file, 0, 1, DiseaseConfig.class);
+        if (ListUtil.isNotEmpty(diseaseConfigList)) {
+            diseaseConfigList.forEach(diseaseConfig -> {
+                diseaseConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(diseaseConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param diseaseConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<DiseaseConfig> diseaseConfigList, HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        diseaseConfigList = diseaseConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getIcdCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(diseaseConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < diseaseConfigList.size(); i++) {
+            if (StringUtil.isBlank(diseaseConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(diseaseConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getHisName())) {
+                diseaseConfigList.get(i).setHisName(diseaseConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getUniqueName())) {
+                diseaseConfigList.get(i).setUniqueName(diseaseConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getIcdCode())) {
+                diseaseConfigList.get(i).setIcdCode(diseaseConfigList.get(i).getIcdCode().trim());
+            } else {
+                diseaseConfigList.get(i).setIcdCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        diseaseConfigList.forEach(diseaseConfig -> {
+            diseaseConfig.setHospitalId(Long.valueOf(hospitalId));
+            diseaseConfig.setModifier(userId);
+            diseaseConfig.setGmtModified(now);
+            if (diseaseConfig.getId() == null) {
+                if (configMap.containsKey(diseaseConfig.getHisName())) {
+                    deleteIds.add(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
+                }
+                diseaseConfig.setCreator(userId);
+                diseaseConfig.setGmtCreate(now);
+            }
+            if (diseaseConfig.getIsDeleted() == null) {
+                diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        List<String> uniqueNames = diseaseConfigList.stream()
+                .map(i -> i.getUniqueName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Disease.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < diseaseConfigList.size(); i++) {
+            if (!names.contains(diseaseConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        diseaseConfigList = diseaseConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DiseaseConfig> records = diseaseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DiseaseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DiseaseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<DiseaseConfig> records = diseaseConfigService.list(queryWrapper);
+        String fileName = "疾病映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return diseaseConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "疾病映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+    }
+}

+ 637 - 0
cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -0,0 +1,637 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DrugConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.DrugConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.DrugConfigListVO;
+import com.diagbot.vo.DrugConfigPageVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/29 15:04
+ */
+@Component
+public class DrugConfigFacade {
+    @Autowired
+    private DrugConfigService drugConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param drugConfig
+     * @return
+     */
+    public Boolean isExistRecord(DrugConfig drugConfig) {
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", drugConfig.getHospitalId())
+                .eq("his_name", drugConfig.getHisName())
+                .eq("unique_name", drugConfig.getUniqueName());
+        if (StringUtil.isBlank(drugConfig.getForm())) {
+            queryWrapper.and(i -> i.isNull("form")
+                    .or()
+                    .eq("form", ""));
+        } else {
+            queryWrapper.eq("form", drugConfig.getForm());
+        }
+        DrugConfig oldRecord = drugConfigService.getOne(queryWrapper, false);
+        if (drugConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (drugConfig.getId() != null
+                && oldRecord != null
+                && !drugConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param drugConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(DrugConfig drugConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        drugConfig.setModifier(userId);
+        drugConfig.setGmtModified(now);
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", drugConfig.getHospitalId())
+                .eq("his_name", drugConfig.getHisName())
+                .eq("unique_name", drugConfig.getUniqueName());
+        if (StringUtil.isBlank(drugConfig.getForm())) {
+            queryWrapper.and(i -> i.isNull("form")
+                    .or()
+                    .eq("form", ""));
+        } else {
+            queryWrapper.eq("form", drugConfig.getForm());
+        }
+        DrugConfig oldRecord = drugConfigService.getOne(queryWrapper, false);
+        if (drugConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (drugConfig.getId() != null
+                && oldRecord != null
+                && !drugConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (drugConfig.getId() == null) {
+            drugConfig.setCreator(userId);
+            drugConfig.setGmtCreate(now);
+        }
+        if (drugConfig.getIsDeleted() == null) {
+            drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        drugConfigService.saveOrUpdate(drugConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param drugConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(DrugConfigListVO drugConfigListVO) {
+        if (ListUtil.isEmpty(drugConfigListVO.getDrugConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(drugConfigListVO.getDrugConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param drugConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<DrugConfig> drugConfigList) {
+        if (ListUtil.isEmpty(drugConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        drugConfigList = drugConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        if (ListUtil.isEmpty(drugConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = drugConfigList.get(0).getHospitalId();
+
+        List<String> hisNames = drugConfigList
+                .stream()
+                .map(i -> i.getHisName())
+                .collect(Collectors.toList());
+        List<String> uniqueNames = drugConfigList
+                .stream()
+                .map(i -> i.getUniqueName())
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Map<String, Long>>> configMap
+                = getConfigMap(hospitalId, hisNames, uniqueNames);
+        drugConfigList.forEach(drugConfig -> {
+            drugConfig.setHospitalId(Long.valueOf(hospitalId));
+            drugConfig.setModifier(userId);
+            drugConfig.setGmtModified(now);
+            String form = StringUtil.isBlank(drugConfig.getForm()) ? "" : drugConfig.getForm();
+            if (drugConfig.getId() == null) {
+                if (configMap.get(drugConfig.getHisName()) != null
+                        && configMap.get(drugConfig.getHisName()).get(form) != null
+                        && configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()) != null) {
+                    deleteIds.add(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
+                }
+                drugConfig.setCreator(userId);
+                drugConfig.setGmtCreate(now);
+            }
+            if (drugConfig.getIsDeleted() == null) {
+                drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        drugConfigService.saveOrUpdateBatch(drugConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<DrugConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        drugConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<DrugConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        drugConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param drugConfigPageVO
+     * @return
+     */
+    public IPage<DrugConfig> getPage(DrugConfigPageVO drugConfigPageVO) {
+        return drugConfigService.getPage(drugConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<DrugConfig> drugConfigList = ExcelUtils.importExcel(file, 1, 1, DrugConfig.class);
+        if (ListUtil.isNotEmpty(drugConfigList)) {
+            drugConfigList.forEach(drugConfig -> {
+                drugConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(drugConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param drugConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<DrugConfig> drugConfigList,HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        drugConfigList = drugConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getForm())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(drugConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        //药品剂型
+        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
+        List<String> formList = dicTypeMappingList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getName())
+                .distinct()
+                .collect(Collectors.toList());
+        List<String> formErrNumList = Lists.newLinkedList();
+        for (int i = 0; i < drugConfigList.size(); i++) {
+            if (StringUtil.isBlank(drugConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(drugConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 3));
+            }
+            if (StringUtil.isNotBlank(drugConfigList.get(i).getHisName())) {
+                drugConfigList.get(i).setHisName(drugConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(drugConfigList.get(i).getUniqueName())) {
+                drugConfigList.get(i).setUniqueName(drugConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(drugConfigList.get(i).getForm())) {
+                if (!formList.contains(drugConfigList.get(i).getForm())) {
+                    formErrNumList.add(String.valueOf(i + 3));
+                } else {
+                    drugConfigList.get(i).setForm(drugConfigList.get(i).getForm().trim());
+                }
+            }
+            if (StringUtil.isNotBlank(drugConfigList.get(i).getUniqueCode())) {
+                drugConfigList.get(i).setUniqueCode(drugConfigList.get(i).getUniqueCode().trim());
+            } else {
+                drugConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+        if (ListUtil.isNotEmpty(formErrNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)药品剂型与数据库药品剂型不匹配:"
+                    + formErrNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        List<String> hisNames = drugConfigList
+                .stream()
+                .map(i -> i.getHisName())
+                .collect(Collectors.toList());
+        List<String> uniqueNames = drugConfigList
+                .stream()
+                .map(i -> i.getUniqueName())
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Map<String, Long>>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), hisNames, uniqueNames);
+        drugConfigList.forEach(drugConfig -> {
+            drugConfig.setHospitalId(Long.valueOf(hospitalId));
+            drugConfig.setModifier(userId);
+            drugConfig.setGmtModified(now);
+            String form = StringUtil.isBlank(drugConfig.getForm()) ? "" : drugConfig.getForm();
+            if (drugConfig.getId() == null) {
+                if (configMap.get(drugConfig.getHisName()) != null
+                        && configMap.get(drugConfig.getHisName()).get(form) != null
+                        && configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()) != null) {
+                    deleteIds.add(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
+                }
+                drugConfig.setCreator(userId);
+                drugConfig.setGmtCreate(now);
+            }
+            if (drugConfig.getIsDeleted() == null) {
+                drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Drug.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < drugConfigList.size(); i++) {
+            if (!names.contains(drugConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        drugConfigList = drugConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        drugConfigService.saveOrUpdateBatch(drugConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return Map<hisName,Map<form,Map<uniqueName,id>>>
+     */
+    public Map<String, Map<String,Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Map<String, Long>>> retMap = new HashMap<>();
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DrugConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DrugConfig>> entry : hisNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, Map<String, Long>> formMap = new HashMap<>();
+                entry.getValue().forEach(i -> {
+                    if (StringUtil.isBlank(i.getForm())) {
+                        i.setForm("");
+                    }
+                });
+                Map<String, List<DrugConfig>> subMap
+                        = EntityUtil.makeEntityListMap(entry.getValue(), "form");
+                for (Map.Entry<String, List<DrugConfig>> subEntry : subMap.entrySet()) {
+                    if (ListUtil.isNotEmpty(subEntry.getValue())) {
+                        formMap.put(subEntry.getKey(),
+                                EntityUtil.makeMapWithKeyValue(subEntry.getValue(), "uniqueName", "id"));
+                    }
+                }
+                retMap.put(entry.getKey(), formMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<form,Map<hisName,id>>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String,Map<String,Map<String,Long>>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Map<String, Long>>> retMap = new HashMap<>();
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(i -> {
+            if (StringUtil.isBlank(i.getForm())) {
+                i.setForm("");
+            }
+        });
+        Map<String, List<DrugConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<DrugConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, Map<String, Long>> formMap = new HashMap<>();
+                Map<String, List<DrugConfig>> subMap
+                        = EntityUtil.makeEntityListMap(entry.getValue(), "form");
+                for (Map.Entry<String, List<DrugConfig>> subEntry : subMap.entrySet()) {
+                    if (ListUtil.isNotEmpty(subEntry.getValue())) {
+                        formMap.put(subEntry.getKey(),
+                                EntityUtil.makeMapWithKeyValue(subEntry.getValue(), "hisName", "id"));
+                    }
+                }
+                retMap.put(entry.getKey(), formMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return Map<hisName,Map<uniqueName,id>>
+     */
+    public Map<String, Map<String,Long>> getConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DrugConfig>> hisNameMap
+                = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DrugConfig>> entry : hisNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(),
+                        EntityUtil.makeMapWithKeyValue(records, "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<hisName,id>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String,Map<String,Long>> getUniqueNameConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(i -> {
+            if (StringUtil.isBlank(i.getForm())) {
+                i.setForm("");
+            }
+        });
+        Map<String, List<DrugConfig>> uniqueNameMap
+                = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<DrugConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(),
+                        EntityUtil.makeMapWithKeyValue(records, "hisName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        String fileName = "药品映射.xls";
+        ExcelUtils.exportExcel(records, getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return drugConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "药品映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 剂型说明
+     *
+     * @return
+     */
+    private String getFrom() {
+        String from = "药品模板——药品剂型填写说明[不填";
+        //药品剂型
+        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
+        List<String> formList = dicTypeMappingList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getName())
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(formList)) {
+            for (String s : formList) {
+                if (StringUtil.isNotBlank(s)) {
+                    from += "、" + s;
+                }
+            }
+        }
+        from += "]";
+        return from;
+    }
+}

+ 30 - 0
cdssman-service/src/main/java/com/diagbot/facade/EnumsDataFacade.java

@@ -0,0 +1,30 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.EnumsDataService;
+import com.diagbot.util.EnumEntriesBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 枚举数据装饰类
+ * @author: gaodm
+ * @time: 2018/9/19 14:28
+ */
+@Component
+public class EnumsDataFacade {
+    @Autowired
+    private EnumsDataService enumsDataService;
+
+    /**
+     * 用户枚举数据获取
+     *
+     * @return 用户枚举类map
+     */
+    public Map<String, List<EnumEntriesBuilder.Entry>> getEnumsData() {
+        return enumsDataService.getEnumsData();
+    }
+
+}

+ 333 - 0
cdssman-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java

@@ -0,0 +1,333 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.entity.DeptConfig;
+import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.entity.DrugConfig;
+import com.diagbot.entity.HospitalInfo;
+import com.diagbot.entity.LisConfig;
+import com.diagbot.entity.OperationConfig;
+import com.diagbot.entity.PacsConfig;
+import com.diagbot.entity.Plan;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.DeptConfigService;
+import com.diagbot.service.DiseaseConfigService;
+import com.diagbot.service.DrugConfigService;
+import com.diagbot.service.HospitalInfoService;
+import com.diagbot.service.LisConfigService;
+import com.diagbot.service.OperationConfigService;
+import com.diagbot.service.PacsConfigService;
+import com.diagbot.service.TransfusionConfigService;
+import com.diagbot.service.impl.HospitalInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.Cn2SpellUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.HospitalInfoListVO;
+import com.diagbot.vo.HospitalInfoPageVO;
+import com.diagbot.vo.HospitalSaveVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 18:37
+ */
+@Component
+public class HospitalInfoFacade extends HospitalInfoServiceImpl {
+    @Autowired
+    @Qualifier("hospitalInfoServiceImpl")
+    private HospitalInfoService hospitalInfoService;
+    @Autowired
+    private DeptConfigService deptConfigService;
+    @Autowired
+    private DiseaseConfigService diseaseConfigService;
+    @Autowired
+    private DrugConfigService drugConfigService;
+    @Autowired
+    private LisConfigService lisConfigService;
+    @Autowired
+    private OperationConfigService operationConfigService;
+    @Autowired
+    private PacsConfigService pacsConfigService;
+    @Autowired
+    private TransfusionConfigService transfusionConfigService;
+    @Autowired
+    private PlanFacade planFacade;
+
+    public List<HospitalInfoDTO> getHospitalInfo() {
+        QueryWrapper<HospitalInfo> hospitalInfo = new QueryWrapper<>();
+        hospitalInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<HospitalInfo> list = list(hospitalInfo);
+        List<HospitalInfoDTO> data = new ArrayList<>();
+        data = BeanUtil.listCopyTo(list, HospitalInfoDTO.class);
+        return data;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param hospitalInfo
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(HospitalInfo hospitalInfo) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        hospitalInfo.setModifier(userId);
+        hospitalInfo.setGmtModified(now);
+        QueryWrapper<HospitalInfo> queryWrapper = new QueryWrapper<>();
+        if (StringUtil.isNotBlank(hospitalInfo.getName())) {
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            queryWrapper.eq("name", hospitalInfo.getName());
+            HospitalInfo oldRecord = this.getOne(queryWrapper, false);
+            if (hospitalInfo.getId() == null
+                    && oldRecord != null) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院名称已存在");
+            }
+            if (hospitalInfo.getId() != null
+                    && oldRecord != null
+                    && !hospitalInfo.getId().equals(oldRecord.getId())) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院名称已存在");
+            }
+        }
+        /*if (StringUtil.isNotBlank(hospitalInfo.getCode())) {
+            queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            queryWrapper.eq("code", hospitalInfo.getCode());
+            HospitalInfo oldRecord = this.getOne(queryWrapper, false);
+            if (hospitalInfo.getId() == null
+                    && oldRecord != null) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院编码已存在");
+            }
+            if (hospitalInfo.getId() != null
+                    && oldRecord != null
+                    && !hospitalInfo.getId().equals(oldRecord.getId())) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院编码已存在");
+            }
+        }*/
+
+        //新增数据
+        if (hospitalInfo.getId() == null) {
+            hospitalInfo.setCreator(userId);
+            hospitalInfo.setGmtCreate(now);
+            hospitalInfo.setConnect(1);
+        }
+        if (StringUtil.isBlank(hospitalInfo.getSpell())) {
+            hospitalInfo.setSpell(Cn2SpellUtil.converterToFirstSpell(hospitalInfo.getName()));
+        }
+        if (hospitalInfo.getIsDeleted() == null) {
+            hospitalInfo.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        this.saveOrUpdate(hospitalInfo);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param hospitalInfoListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(HospitalInfoListVO hospitalInfoListVO) {
+        if (ListUtil.isEmpty(hospitalInfoListVO.getHospitalInfoList())) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        hospitalInfoListVO.getHospitalInfoList().forEach(item -> {
+            item.setModifier(userId);
+            item.setGmtModified(now);
+            if (item.getId() == null) {
+                item.setCreator(userId);
+                item.setGmtCreate(now);
+            }
+        });
+        hospitalInfoService.saveOrUpdateBatch(hospitalInfoListVO.getHospitalInfoList());
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        HospitalInfo hospitalInfo = hospitalInfoService.getById(idVO.getId());
+        if (hospitalInfo == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据不存在");
+        }
+        if (hospitalInfo.getIsDeleted().equals(IsDeleteEnum.Y.getKey())) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据已删除");
+        }
+
+        //校验关联数据
+        List<DeptConfig> deptConfigList
+                = deptConfigService.list(new QueryWrapper<DeptConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(deptConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<DiseaseConfig> diseaseConfigList
+                = diseaseConfigService.list(new QueryWrapper<DiseaseConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(diseaseConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<DrugConfig> drugConfigList
+                = drugConfigService.list(new QueryWrapper<DrugConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(drugConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<LisConfig> lisConfigList
+                = lisConfigService.list(new QueryWrapper<LisConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(lisConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<OperationConfig> operationConfigList
+                = operationConfigService.list(new QueryWrapper<OperationConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(operationConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<PacsConfig> pacsConfigList
+                = pacsConfigService.list(new QueryWrapper<PacsConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(pacsConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<TransfusionConfig> transfusionConfigList
+                = transfusionConfigService.list(new QueryWrapper<TransfusionConfig>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(transfusionConfigList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+        List<Plan> planList
+                = planFacade.list(new QueryWrapper<Plan>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", idVO.getId()));
+        if (ListUtil.isNotEmpty(planList)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+        }
+
+
+        hospitalInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
+        hospitalInfo.setModifier(userId);
+        hospitalInfo.setGmtModified(now);
+        hospitalInfoService.updateById(hospitalInfo);
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        List<HospitalInfo> hospitalInfoList = new ArrayList<>(hospitalInfoService.listByIds(idListVO.getIds()));
+
+        if (ListUtil.isEmpty(hospitalInfoList)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据不存在");
+        }
+
+        hospitalInfoList.forEach(hospitalInfo -> {
+            hospitalInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
+            hospitalInfo.setModifier(userId);
+            hospitalInfo.setGmtModified(now);
+        });
+        hospitalInfoService.updateBatchById(hospitalInfoList);
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param hospitalInfoPageVO
+     * @return
+     */
+    public IPage<DiseaseConfig> getPage(HospitalInfoPageVO hospitalInfoPageVO) {
+        return hospitalInfoService.getPage(hospitalInfoPageVO);
+    }
+
+    /**
+     * 保存医院信息--医院端只能修改对接状态
+     *
+     * @param hospitalSaveVO
+     * @return
+     */
+    public Boolean modifyConnectStatus(HospitalSaveVO hospitalSaveVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        UpdateWrapper<HospitalInfo> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.set("connect", hospitalSaveVO.getConnect())
+                .set("modifier", userId)
+                .set("gmt_modified", now)
+                .eq("id", hospitalSaveVO.getId());
+        return this.update(updateWrapper);
+    }
+
+    public Map<Long, String> getHospitalInfoData(List<Long> hospitalId) {
+        QueryWrapper<HospitalInfo> hospitalInfo = new QueryWrapper<>();
+        hospitalInfo.eq("is_deleted", IsDeleteEnum.N.getKey()).in("id", hospitalId);
+        List<HospitalInfo> list = list(hospitalInfo);
+        List<HospitalInfoDTO> data = new ArrayList<>();
+        data = BeanUtil.listCopyTo(list, HospitalInfoDTO.class);
+        Map<Long, String> hospitalInfoData = data.stream().collect(Collectors.toMap(k -> k.getId(), v -> v.getName()));
+        return hospitalInfoData;
+    }
+
+    /**
+     * 启用禁用
+     *
+     * @param changeStatusVO
+     * @return
+     */
+    public Boolean changeStatus(ChangeStatusVO changeStatusVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        UpdateWrapper<HospitalInfo> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", changeStatusVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("gmt_modified", now)
+                .set("modifier", userId)
+                .set("status", changeStatusVO.getStatus());
+        this.update(updateWrapper);
+        return true;
+    }
+}

+ 486 - 0
cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -0,0 +1,486 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.LisConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.LisConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.LisConfigListVO;
+import com.diagbot.vo.LisConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/29 15:03
+ */
+@Component
+public class LisConfigFacade{
+    @Autowired
+    private LisConfigService lisConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param lisConfig
+     * @return
+     */
+    public Boolean isExistRecord(LisConfig lisConfig) {
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", lisConfig.getHospitalId())
+                .eq("his_name", lisConfig.getHisName())
+                .eq("unique_name", lisConfig.getUniqueName());
+        if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
+            queryWrapper.and(i -> i.isNull("his_detail_name")
+                    .or()
+                    .eq("his_detail_name", ""));
+        } else {
+            queryWrapper
+                    .eq("his_detail_name", lisConfig.getHisDetailName());
+        }
+        LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
+        if (lisConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (lisConfig.getId() != null
+                && oldRecord != null
+                && !lisConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param lisConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(LisConfig lisConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        lisConfig.setModifier(userId);
+        lisConfig.setGmtModified(now);
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", lisConfig.getHospitalId())
+                .eq("his_name", lisConfig.getHisName())
+                .eq("unique_name", lisConfig.getUniqueName());
+        if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
+            queryWrapper.and(i -> i.isNull("his_detail_name")
+                    .or()
+                    .eq("his_detail_name", ""));
+        } else {
+            queryWrapper
+                    .eq("his_detail_name", lisConfig.getHisDetailName());
+        }
+        LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
+        if (lisConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (lisConfig.getId() != null
+                && oldRecord != null
+                && !lisConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (lisConfig.getId() == null) {
+            lisConfig.setCreator(userId);
+            lisConfig.setGmtCreate(now);
+        }
+        if (lisConfig.getIsDeleted() == null) {
+            lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        lisConfigService.saveOrUpdate(lisConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param lisConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(LisConfigListVO lisConfigListVO) {
+        if (ListUtil.isEmpty(lisConfigListVO.getLisConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(lisConfigListVO.getLisConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param lisConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<LisConfig> lisConfigList) {
+        if (ListUtil.isEmpty(lisConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤套餐或公表名为空的数据,hospitalId不允许为空
+        lisConfigList = lisConfigList
+                .stream()
+                .filter(i->i.getHospitalId()!=null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if(ListUtil.isEmpty(lisConfigList)){
+            return false;
+        }
+        Long hosptialId=lisConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Map<String, Long>>> configMap
+                = getConfigMap(hosptialId, null, null);
+        lisConfigList.forEach(lisConfig -> {
+            lisConfig.setModifier(userId);
+            lisConfig.setGmtModified(now);
+            if (lisConfig.getId() == null) {
+                if (configMap.containsKey(lisConfig.getHisName())) {
+                    if (lisConfig.getHisDetailName() == null
+                            && configMap.get(lisConfig.getHisName()).containsKey("")) {
+                        if (configMap.get(lisConfig.getHisName()).get("").containsKey(lisConfig.getUniqueName())) {
+                            deleteIds.add(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
+                        }
+                    } else if (configMap.get(lisConfig.getHisName()).containsKey(lisConfig.getHisDetailName())) {
+                        if (configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).containsKey(lisConfig.getUniqueName())) {
+                            deleteIds.add(configMap
+                                    .get(lisConfig.getHisName())
+                                    .get(lisConfig.getHisDetailName())
+                                    .get(lisConfig.getUniqueName()));
+                        }
+                    }
+                }
+                lisConfig.setCreator(userId);
+                lisConfig.setGmtCreate(now);
+            }
+            if (lisConfig.getIsDeleted() == null) {
+                lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+
+        lisConfigService.saveOrUpdateBatch(lisConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        lisConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        lisConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param lisConfigPageVO
+     * @return
+     */
+    public IPage<LisConfig> getPage(LisConfigPageVO lisConfigPageVO) {
+        return lisConfigService.getPage(lisConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        //从Excel读取数据
+        List<LisConfig> lisConfigList = ExcelUtils.importExcel(file, 0, 1, LisConfig.class);
+        if (ListUtil.isNotEmpty(lisConfigList)) {
+            lisConfigList.forEach(lisConfig -> {
+                lisConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(lisConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param lisConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<LisConfig> lisConfigList,HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        lisConfigList = lisConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getHisDetailName())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(lisConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < lisConfigList.size(); i++) {
+            if (StringUtil.isBlank(lisConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(lisConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(lisConfigList.get(i).getHisName())) {
+                lisConfigList.get(i).setHisName(lisConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(lisConfigList.get(i).getUniqueName())) {
+                lisConfigList.get(i).setUniqueName(lisConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(lisConfigList.get(i).getUniqueCode())) {
+                lisConfigList.get(i).setUniqueCode(lisConfigList.get(i).getUniqueCode().trim());
+            } else {
+                lisConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        List<String> hisNames = lisConfigList
+                .stream()
+                .map(i -> i.getHisName())
+                .collect(Collectors.toList());
+        List<String> uniqueNames = lisConfigList
+                .stream()
+                .map(i -> i.getUniqueName())
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Map<String, Long>>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), hisNames, uniqueNames);
+        lisConfigList.forEach(lisConfig -> {
+            lisConfig.setHospitalId(Long.valueOf(hospitalId));
+            lisConfig.setModifier(userId);
+            lisConfig.setGmtModified(now);
+            if (lisConfig.getId() == null) {
+                if (configMap.containsKey(lisConfig.getHisName())) {
+                    if (lisConfig.getHisDetailName() == null
+                            && configMap.get(lisConfig.getHisName()).containsKey("")) {
+                        if (configMap.get(lisConfig.getHisName()).get("").containsKey(lisConfig.getUniqueName())) {
+                            deleteIds.add(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
+                        }
+                    } else if (configMap.get(lisConfig.getHisName()).containsKey(lisConfig.getHisDetailName())) {
+                        if (configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).containsKey(lisConfig.getUniqueName())) {
+                            deleteIds.add(configMap
+                                    .get(lisConfig.getHisName())
+                                    .get(lisConfig.getHisDetailName())
+                                    .get(lisConfig.getUniqueName()));
+                        }
+                    }
+                }
+                lisConfig.setCreator(userId);
+                lisConfig.setGmtCreate(now);
+            }
+            if (lisConfig.getIsDeleted() == null) {
+                lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
+        RespDTO<List<String>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respLisPackDTO, "标准术语校验失败");
+        List<String> lisPackNames = respLisPackDTO.data;
+        conceptVO.setType(ConceptTypeEnum.Lis.getKey());
+        RespDTO<List<String>> respLisDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respLisDTO, "标准术语校验失败");
+        List<String> lisNames = respLisDTO.data;
+        for (int i = 0; i < lisConfigList.size(); i++) {
+            if (!lisPackNames.contains(lisConfigList.get(i).getUniqueName())
+                    && !lisNames.contains(lisConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        lisConfigList = lisConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        lisConfigService.saveOrUpdateBatch(lisConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-id
+     * Map<hisName,Map<hisDetailName,Map<uniqueName,id>>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Map<String, Long>>> retMap = new HashMap<>();
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<LisConfig> records = lisConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        records.forEach(lisConfig -> {
+            if (lisConfig.getHisDetailName() == null) {
+                lisConfig.setHisDetailName("");
+            }
+        });
+
+        Map<String, List<LisConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<LisConfig>> entry : hisNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, Map<String, Long>> detailNameMap = new HashMap<>();
+                //his名称映射到标准词,1:n
+                Map<String, List<LisConfig>> hisDetailNameMap
+                        = EntityUtil.makeEntityListMap(entry.getValue(), "hisDetailName");
+                for (Map.Entry<String, List<LisConfig>> detailEntry : hisDetailNameMap.entrySet()) {
+                    if (ListUtil.isNotEmpty(detailEntry.getValue())) {
+                        detailNameMap.put(detailEntry.getKey(),
+                                EntityUtil.makeMapWithKeyValue(detailEntry.getValue(), "uniqueName", "id"));
+                    }
+                }
+                retMap.put(entry.getKey(), detailNameMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<LisConfig> records = lisConfigService.list(queryWrapper);
+        String fileName = "检验映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return lisConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "检验映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+    }
+}

+ 418 - 0
cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -0,0 +1,418 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.OperationConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.OperationConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.OperationConfigListVO;
+import com.diagbot.vo.OperationConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/29 15:05
+ */
+@Component
+public class OperationConfigFacade {
+    @Autowired
+    private OperationConfigService operationConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param operationConfig
+     * @return
+     */
+    public Boolean isExistRecord(OperationConfig operationConfig) {
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", operationConfig.getHospitalId())
+                .eq("his_name", operationConfig.getHisName())
+                .eq("unique_name", operationConfig.getUniqueName());
+        OperationConfig oldRecord = operationConfigService.getOne(queryWrapper, false);
+        if (operationConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (operationConfig.getId() != null
+                && oldRecord != null
+                && !operationConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param operationConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(OperationConfig operationConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        operationConfig.setModifier(userId);
+        operationConfig.setGmtModified(now);
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", operationConfig.getHospitalId())
+                .eq("his_name", operationConfig.getHisName())
+                .eq("unique_name", operationConfig.getUniqueName());
+        OperationConfig oldRecord = operationConfigService.getOne(queryWrapper, false);
+        if (operationConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (operationConfig.getId() != null
+                && oldRecord != null
+                && !operationConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (operationConfig.getId() == null) {
+            operationConfig.setCreator(userId);
+            operationConfig.setGmtCreate(now);
+        }
+        if (operationConfig.getIsDeleted() == null) {
+            operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        operationConfigService.saveOrUpdate(operationConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param operationConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(OperationConfigListVO operationConfigListVO) {
+        if (ListUtil.isEmpty(operationConfigListVO.getOperationConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(operationConfigListVO.getOperationConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param operationConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<OperationConfig> operationConfigList) {
+        if (ListUtil.isEmpty(operationConfigList)) {
+            return false;
+        }
+
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        operationConfigList = operationConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        if (ListUtil.isEmpty(operationConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = operationConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(hospitalId, null, null);
+        operationConfigList.forEach(operationConfig -> {
+            operationConfig.setModifier(userId);
+            operationConfig.setGmtModified(now);
+            if (operationConfig.getId() == null) {
+                if (configMap.containsKey(operationConfig.getHisName())) {
+                    deleteIds.add(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
+                }
+                operationConfig.setCreator(userId);
+                operationConfig.setGmtCreate(now);
+            }
+            if (operationConfig.getIsDeleted() == null) {
+                operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        operationConfigService.saveOrUpdateBatch(operationConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        operationConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        operationConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param operationConfigPageVO
+     * @return
+     */
+    public IPage<OperationConfig> getPage(OperationConfigPageVO operationConfigPageVO) {
+        return operationConfigService.getPage(operationConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<OperationConfig> operationConfigList = ExcelUtils.importExcel(file, 0, 1, OperationConfig.class);
+        if (ListUtil.isNotEmpty(operationConfigList)) {
+            operationConfigList.forEach(operationConfig -> {
+                operationConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(operationConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param operationConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<OperationConfig> operationConfigList, HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        operationConfigList = operationConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(operationConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < operationConfigList.size(); i++) {
+            if (StringUtil.isBlank(operationConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(operationConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(operationConfigList.get(i).getHisName())) {
+                operationConfigList.get(i).setHisName(operationConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(operationConfigList.get(i).getUniqueName())) {
+                operationConfigList.get(i).setUniqueName(operationConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(operationConfigList.get(i).getUniqueCode())) {
+                operationConfigList.get(i).setUniqueCode(operationConfigList.get(i).getUniqueCode().trim());
+            } else {
+                operationConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        operationConfigList.forEach(operationConfig -> {
+            operationConfig.setHospitalId(Long.valueOf(hospitalId));
+            operationConfig.setModifier(userId);
+            operationConfig.setGmtModified(now);
+            if (operationConfig.getId() == null) {
+                if (configMap.containsKey(operationConfig.getHisName())) {
+                    deleteIds.add(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
+                }
+                operationConfig.setCreator(userId);
+                operationConfig.setGmtCreate(now);
+            }
+            if (operationConfig.getIsDeleted() == null) {
+                operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        List<String> uniqueNames = operationConfigList.stream()
+                .map(i -> i.getUniqueName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Opeartion.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < operationConfigList.size(); i++) {
+            if (!names.contains(operationConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        operationConfigList = operationConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        operationConfigService.saveOrUpdateBatch(operationConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<OperationConfig> records = operationConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<OperationConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<OperationConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<OperationConfig> records = operationConfigService.list(queryWrapper);
+        String fileName = "手术映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return operationConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "手术映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+    }
+}

+ 416 - 0
cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -0,0 +1,416 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.PacsConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.PacsConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.PacsConfigListVO;
+import com.diagbot.vo.PacsConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/29 15:03
+ */
+@Component
+public class PacsConfigFacade {
+    @Autowired
+    private PacsConfigService pacsConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param pacsConfig
+     * @return
+     */
+    public Boolean isExistRecord(PacsConfig pacsConfig) {
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", pacsConfig.getHospitalId())
+                .eq("his_name", pacsConfig.getHisName())
+                .eq("unique_name", pacsConfig.getUniqueName());
+        PacsConfig oldRecord = pacsConfigService.getOne(queryWrapper, false);
+        if (pacsConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (pacsConfig.getId() != null
+                && oldRecord != null
+                && !pacsConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param pacsConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(PacsConfig pacsConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        pacsConfig.setModifier(userId);
+        pacsConfig.setGmtModified(now);
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", pacsConfig.getHospitalId())
+                .eq("his_name", pacsConfig.getHisName())
+                .eq("unique_name", pacsConfig.getUniqueName());
+        PacsConfig oldRecord = pacsConfigService.getOne(queryWrapper, false);
+        if (pacsConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (pacsConfig.getId() != null
+                && oldRecord != null
+                && !pacsConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (pacsConfig.getId() == null) {
+            pacsConfig.setCreator(userId);
+            pacsConfig.setGmtCreate(now);
+        }
+        if (pacsConfig.getIsDeleted() == null) {
+            pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        pacsConfigService.saveOrUpdate(pacsConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param pacsConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(PacsConfigListVO pacsConfigListVO) {
+        if (ListUtil.isEmpty(pacsConfigListVO.getPacsConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(pacsConfigListVO.getPacsConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param pacsConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<PacsConfig> pacsConfigList) {
+        if (ListUtil.isEmpty(pacsConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        pacsConfigList = pacsConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(pacsConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = pacsConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(hospitalId, null, null);
+        pacsConfigList.forEach(pacsConfig -> {
+            pacsConfig.setModifier(userId);
+            pacsConfig.setGmtModified(now);
+            if (pacsConfig.getId() == null) {
+                if (configMap.containsKey(pacsConfig.getHisName())) {
+                    deleteIds.add(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
+                }
+                pacsConfig.setCreator(userId);
+                pacsConfig.setGmtCreate(now);
+            }
+            if (pacsConfig.getIsDeleted() == null) {
+                pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        pacsConfigService.saveOrUpdateBatch(pacsConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        pacsConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        pacsConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param pacsConfigPageVO
+     * @return
+     */
+    public IPage<PacsConfig> getPage(PacsConfigPageVO pacsConfigPageVO) {
+        return pacsConfigService.getPage(pacsConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<PacsConfig> pacsConfigList = ExcelUtils.importExcel(file, 0, 1, PacsConfig.class);
+        if (ListUtil.isNotEmpty(pacsConfigList)) {
+            pacsConfigList.forEach(pacsConfig -> {
+                pacsConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(pacsConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param pacsConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<PacsConfig> pacsConfigList, HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        pacsConfigList = pacsConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(pacsConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < pacsConfigList.size(); i++) {
+            if (StringUtil.isBlank(pacsConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(pacsConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(pacsConfigList.get(i).getHisName())) {
+                pacsConfigList.get(i).setHisName(pacsConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(pacsConfigList.get(i).getUniqueName())) {
+                pacsConfigList.get(i).setUniqueName(pacsConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(pacsConfigList.get(i).getUniqueCode())) {
+                pacsConfigList.get(i).setUniqueCode(pacsConfigList.get(i).getUniqueCode().trim());
+            } else {
+                pacsConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        pacsConfigList.forEach(pacsConfig -> {
+            pacsConfig.setHospitalId(Long.valueOf(hospitalId));
+            pacsConfig.setModifier(userId);
+            pacsConfig.setGmtModified(now);
+            if (pacsConfig.getId() == null) {
+                if (configMap.containsKey(pacsConfig.getHisName())) {
+                    deleteIds.add(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
+                }
+                pacsConfig.setCreator(userId);
+                pacsConfig.setGmtCreate(now);
+            }
+            if (pacsConfig.getIsDeleted() == null) {
+                pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        List<String> uniqueNames = pacsConfigList.stream()
+                .map(i -> i.getUniqueName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Pacs.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < pacsConfigList.size(); i++) {
+            if (!names.contains(pacsConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        pacsConfigList = pacsConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        pacsConfigService.saveOrUpdateBatch(pacsConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<PacsConfig> records = pacsConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<PacsConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<PacsConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<PacsConfig> records = pacsConfigService.list(queryWrapper);
+        String fileName = "检查映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return pacsConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "检查映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+    }
+}

+ 30 - 0
cdssman-service/src/main/java/com/diagbot/facade/PermissionFacade.java

@@ -0,0 +1,30 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.PermissionsAllDTO;
+import com.diagbot.entity.Permission;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.PermissionServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.vo.PermissionsAllVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-10 10:31
+ */
+@Component
+public class PermissionFacade extends PermissionServiceImpl {
+
+    public List<PermissionsAllDTO> getPermissionAlls(PermissionsAllVO permissionsAllVO) {
+        QueryWrapper<Permission> permissionQuery = new QueryWrapper<>();
+        permissionQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq(permissionsAllVO.getType() != null, "type", permissionsAllVO.getType());
+        List<Permission> list = list(permissionQuery);
+        List<PermissionsAllDTO> data = BeanUtil.listCopyTo(list, PermissionsAllDTO.class);
+        return data;
+    }
+}

+ 180 - 0
cdssman-service/src/main/java/com/diagbot/facade/PlanDetailFacade.java

@@ -0,0 +1,180 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.PlanDetailDTO;
+import com.diagbot.entity.PlanDetail;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.PlanDetailService;
+import com.diagbot.service.impl.PlanDetailServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.HospitalPlanDetailSaveVO;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.PlanDetailCancelVO;
+import com.diagbot.vo.PlanDetailRevStopVO;
+import com.diagbot.vo.PlanDetailSaveVO;
+import com.diagbot.vo.PlanDetailSubSaveVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-07 10:38
+ */
+@Component
+public class PlanDetailFacade extends PlanDetailServiceImpl {
+    @Autowired
+    PlanDetailService planDetailService;
+
+
+    public List<PlanDetailDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
+        QueryWrapper<PlanDetail> sysSetInfo = new QueryWrapper<>();
+        sysSetInfo.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalSetVO.getHospitalId())
+                .eq(StringUtil.isNotBlank(hospitalSetVO.getCode()), "code", hospitalSetVO.getCode())
+                .in("plan_id", hospitalSetVO.getPlanId())
+                .orderByAsc("plan_id", "order_no");
+        List<PlanDetail> sysSetData = list(sysSetInfo);
+        List<PlanDetailDTO> sysSetInfoData = BeanUtil.listCopyTo(sysSetData, PlanDetailDTO.class);
+        List<PlanDetailDTO> planDetailParent = new ArrayList<>();//父级数据
+        List<PlanDetailDTO> planDetailSub = new ArrayList<>();//子级数据
+        //分离数据,-1分父级菜单
+        for (PlanDetailDTO dataDeta : sysSetInfoData) {
+            if (dataDeta.getParentId() == (-1)) {
+                planDetailParent.add(dataDeta);
+            } else {
+                planDetailSub.add(dataDeta);
+            }
+        }
+        //把子级数据,放在父级下
+        Map<Long, List<PlanDetailDTO>> mapParentId = planDetailSub.stream().collect(Collectors.groupingBy(PlanDetailDTO::getParentId));
+        for (Long key : mapParentId.keySet()) {
+            for (PlanDetailDTO sysPlanInfos : planDetailParent) {
+                if (sysPlanInfos.getId().equals(key)) {
+                    sysPlanInfos.setPlanDetails(mapParentId.get(key));
+                }
+            }
+        }
+        return planDetailParent;
+    }
+
+    public List<PlanDetailDTO> getByPlanIds(List<Long> planIds) {
+        List<PlanDetailDTO> dataNew = new ArrayList<PlanDetailDTO>();
+        if (ListUtil.isNotEmpty(planIds)) {
+            QueryWrapper<PlanDetail> planDetailQuery = new QueryWrapper<>();
+            planDetailQuery
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("STATUS", StatusEnum.Enable.getKey())
+                    .in("plan_id", planIds)
+                    .orderByDesc("gmt_create")
+                    .orderByAsc("order_no");
+            List<PlanDetail> datas = list(planDetailQuery);
+            dataNew = BeanUtil.listCopyTo(datas, PlanDetailDTO.class);
+        }
+        return dataNew;
+    }
+
+    public boolean savePlanDetail(PlanDetailSaveVO planDetailSaveVO) {
+        boolean res = false;
+        Date now = DateUtil.now();
+        QueryWrapper<PlanDetail> planDetailQuery = new QueryWrapper<>();
+        planDetailQuery.eq("plan_id", planDetailSaveVO.getPlanId())
+                .eq("hospital_id", planDetailSaveVO.getHospitalId())//医院id
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+        // 删除所有的配置
+        res = remove(planDetailQuery);
+        //先保存父类
+        List<PlanDetail> planDetailParentNew = new ArrayList<>();
+        List<HospitalPlanDetailSaveVO> planDetailParent = planDetailSaveVO.getPlanDetailParent();
+        for (HospitalPlanDetailSaveVO planDetailSave : planDetailParent) {
+            PlanDetail planDetails = new PlanDetail();
+            BeanUtil.copyProperties(planDetailSave, planDetails);
+            planDetails.setParentId(-1L);
+            planDetails.setGmtCreate(now);
+            planDetails.setCreator(UserUtils.getCurrentPrincipleID());
+            planDetails.setModifier(UserUtils.getCurrentPrincipleID());
+            planDetails.setGmtModified(now);
+            planDetailService.save(planDetails);
+            List<PlanDetailSubSaveVO> data = planDetailSave.getPlanDetailSub();
+            if(ListUtil.isNotEmpty(data)){
+                List<PlanDetail> planDetailList = new ArrayList<>();
+                //再保存子类
+                for (PlanDetailSubSaveVO planDetailVO : data) {
+                    if(planDetailVO.getCode()!=null){
+                        PlanDetail planDetail = new PlanDetail();
+                        BeanUtil.copyProperties(planDetailVO, planDetail);
+                        planDetail.setPlanId(planDetailSaveVO.getPlanId());
+                        planDetail.setParentId(planDetails.getId());
+                        planDetail.setGmtCreate(now);
+                        planDetail.setCreator(UserUtils.getCurrentPrincipleID());
+                        planDetail.setModifier(UserUtils.getCurrentPrincipleID());
+                        planDetail.setGmtModified(now);
+                        planDetailList.add(planDetail);
+                    }
+                }
+                res = planDetailService.saveBatch(planDetailList);
+            }
+        }
+
+        return res;
+    }
+
+    public boolean cancelPlanDetail(PlanDetailCancelVO planDetailCancelVO) {
+        boolean res = false;
+        // 1.先判断数据是否存在有效
+        UpdateWrapper<PlanDetail> planDetailNew = new UpdateWrapper<>();
+        planDetailNew
+                .eq("hospital_id", planDetailCancelVO.getHospitalId())
+                .eq("plan_id", planDetailCancelVO.getPlanId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        res = update(new PlanDetail(), planDetailNew);
+        return res;
+    }
+
+    public boolean revStopPlanDetail(PlanDetailRevStopVO planDetailRevStopVO) {
+        checkPlan(planDetailRevStopVO.getId());
+        UpdateWrapper<PlanDetail> planNew = new UpdateWrapper<>();
+        planNew
+                .eq("id", planDetailRevStopVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("status", planDetailRevStopVO.getStatus())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        return update(new PlanDetail(), planNew);
+
+    }
+
+    /**
+     * 判断数据是否存在有效
+     *
+     * @param id
+     */
+    private PlanDetail checkPlan(Long id) {
+        // 1.先判断数据是否存在有效
+        QueryWrapper<PlanDetail> PlanFand = new QueryWrapper<>();
+        PlanFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        PlanDetail planDetail = getOne(PlanFand, false);
+        if (null == planDetail) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+        return planDetail;
+    }
+}
+

+ 339 - 0
cdssman-service/src/main/java/com/diagbot/facade/PlanFacade.java

@@ -0,0 +1,339 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.PlanDetailDTO;
+import com.diagbot.dto.PlanInfoDefaultDTO;
+import com.diagbot.dto.PlanInfoPagesDTO;
+import com.diagbot.entity.Plan;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.PlanServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.HospitalPlanCancelVO;
+import com.diagbot.vo.HospitalPlanDetailSaveVO;
+import com.diagbot.vo.HospitalPlanIdVO;
+import com.diagbot.vo.HospitalPlanPageVO;
+import com.diagbot.vo.HospitalPlanSaveVO;
+import com.diagbot.vo.HospitalPlanVO;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.PlanDetailCancelVO;
+import com.diagbot.vo.PlanDetailSaveVO;
+import com.diagbot.vo.PlanDetailSubSaveVO;
+import com.diagbot.vo.PlanRevStopVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-07 10:29
+ */
+@Component
+public class PlanFacade extends PlanServiceImpl {
+
+    @Autowired
+    PlanDetailFacade planDetailFacade;
+    @Autowired
+    private HospitalInfoFacade hospitalInfoFacade;
+
+
+    /**
+     * @param hospitalPlanSaveVO
+     * @return
+     */
+    public boolean savePlanInfoDatas(HospitalPlanSaveVO hospitalPlanSaveVO) {
+        Long planId = hospitalPlanSaveVO.getId();
+        Date now = DateUtil.now();
+        boolean res = false;
+        // 校验名称是否相同
+        int count = this.count(new QueryWrapper<Plan>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalPlanSaveVO.getHospitalId())
+                .eq("plan_name", hospitalPlanSaveVO.getPlanName())
+                .ne("id", hospitalPlanSaveVO.getId() == null ? -1 : hospitalPlanSaveVO.getId()));
+        if (count > 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该方案名称已存在");
+        }
+        int countTow = this.count(new QueryWrapper<Plan>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalPlanSaveVO.getHospitalId())
+                .eq("plan_code", hospitalPlanSaveVO.getPlanCode())
+                .ne("id", hospitalPlanSaveVO.getId() == null ? -1 : hospitalPlanSaveVO.getId()));
+        if (countTow > 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该方案编码已存在");
+        }
+        if (hospitalPlanSaveVO.getId() != null) {
+            UpdateWrapper<Plan> planQuery = new UpdateWrapper<>();
+            planQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("id", hospitalPlanSaveVO.getId())
+                    .set("gmt_modified", now)
+                    .set("modifier", UserUtils.getCurrentPrincipleID())
+                    .set("hospital_id", hospitalPlanSaveVO.getHospitalId())
+                    .set("plan_name", hospitalPlanSaveVO.getPlanName())
+                    .set("plan_code", hospitalPlanSaveVO.getPlanCode())
+                    .set("plan_status", StatusEnum.Enable.getKey());
+            res = update(new Plan(), planQuery);
+        } else {
+            Plan plan = new Plan();
+            BeanUtil.copyProperties(hospitalPlanSaveVO, plan);
+            plan.setGmtCreate(now);
+            plan.setGmtModified(now);
+            plan.setCreator(UserUtils.getCurrentPrincipleID());
+            plan.setModifier(UserUtils.getCurrentPrincipleID());
+            res = this.save(plan);
+            planId = plan.getId();
+        }
+        PlanDetailSaveVO planDetailSaveVO = new PlanDetailSaveVO();
+        planDetailSaveVO.setPlanId(planId);
+        planDetailSaveVO.setHospitalId(hospitalPlanSaveVO.getHospitalId());
+        List<HospitalPlanDetailSaveVO> planDetailParentNew = new ArrayList<>();
+        List<HospitalPlanDetailSaveVO> planDetailParent = hospitalPlanSaveVO.getPlanDetailParent();
+        if (ListUtil.isNotEmpty(planDetailParent)) {
+            for (HospitalPlanDetailSaveVO data : planDetailParent) {
+                HospitalPlanDetailSaveVO dataNew = new HospitalPlanDetailSaveVO();
+                BeanUtil.copyProperties(data, dataNew);
+                dataNew.setPlanId(planId);
+                List<PlanDetailSubSaveVO> planDetailSubNew = new ArrayList<>();
+                List<PlanDetailSubSaveVO> planDetailSub = data.getPlanDetailSub();
+                if (ListUtil.isNotEmpty(planDetailSub)) {
+                    for (PlanDetailSubSaveVO dataSub : planDetailSub) {
+                        PlanDetailSubSaveVO dataSubNew = new PlanDetailSubSaveVO();
+                        BeanUtil.copyProperties(dataSub, dataSubNew);
+                        dataSubNew.setPlanId(planId);
+                        planDetailSubNew.add(dataSubNew);
+                    }
+                    dataNew.setPlanDetailSub(planDetailSubNew);
+                    planDetailParentNew.add(dataNew);
+                }
+            }
+        }
+
+        planDetailSaveVO.setPlanDetailParent(planDetailParentNew);
+        res = planDetailFacade.savePlanDetail(planDetailSaveVO);
+        return res;
+    }
+
+    public IPage<PlanInfoPagesDTO> getPlanInfoPage(HospitalPlanPageVO hospitalPlanPageVO) {
+        IPage<PlanInfoPagesDTO> data = getPlanInfoPageAll(hospitalPlanPageVO);
+        List<PlanInfoPagesDTO> planInfos = data.getRecords();
+        List<Long> hospitaIds = new ArrayList<>();
+        for (PlanInfoPagesDTO h : planInfos) {
+            hospitaIds.add(h.getHospitalId());
+        }
+        if (ListUtil.isNotEmpty(hospitaIds)) {
+            Map<Long, String> hospitalInfo = hospitalInfoFacade.getHospitalInfoData(hospitaIds);
+            for (PlanInfoPagesDTO planInfodata : planInfos) {
+                planInfodata.setHospitalName(hospitalInfo.get(planInfodata.getHospitalId()));
+            }
+        }
+        // 取版本id查明细
+        List<Long> ids = new ArrayList<>();
+        if (planInfos != null) {
+            // 当查出的数据不为空时,取到版本id,再去版本明细表中查询详细的信息
+            for (PlanInfoPagesDTO planInfo : planInfos) {
+                ids.add(planInfo.getId());
+            }
+            // 获取明细信息
+            List<PlanDetailDTO> PlanDetailDatas = planDetailFacade.getByPlanIds(ids);
+            List<PlanDetailDTO> sysSetInfoData = BeanUtil.listCopyTo(PlanDetailDatas, PlanDetailDTO.class);
+            List<PlanDetailDTO> planDetailParent = new ArrayList<>();//父级数据
+            List<PlanDetailDTO> planDetailSub = new ArrayList<>();//子级数据
+            //分离数据,-1分父级菜单
+            for (PlanDetailDTO dataDeta : sysSetInfoData) {
+                if (dataDeta.getParentId() == (-1)) {
+                    planDetailParent.add(dataDeta);
+                } else {
+                    planDetailSub.add(dataDeta);
+                }
+            }
+            //把子级数据,放在父级下
+            Map<Long, List<PlanDetailDTO>> mapParentId = planDetailSub.stream().collect(Collectors.groupingBy(PlanDetailDTO::getParentId));
+            for (Long key : mapParentId.keySet()) {
+                for (PlanDetailDTO sysPlanInfos : planDetailParent) {
+                    if (sysPlanInfos.getId().equals(key)) {
+                        sysPlanInfos.setPlanDetails(mapParentId.get(key));
+                    }
+                }
+            }
+
+            Map<Long, List<PlanDetailDTO>> map = new HashMap<>();
+            // 获取所有用户开通的产品信息
+            map = EntityUtil.makeEntityListMap(planDetailParent, "planId");
+            if (map.size() > 0) {
+                for (PlanInfoPagesDTO planInfo : planInfos) {
+                    List<PlanDetailDTO> planDetails = map.get(planInfo.getId());
+                    if (ListUtil.isNotEmpty(planDetails)) {
+                        planInfo.setSysSetInfo(planDetails);
+                    }
+                }
+            }
+        }
+        return data.setRecords(planInfos);
+    }
+
+    public boolean cancelPlanData(HospitalPlanCancelVO hospitalPlanCancelVO) {
+        PlanDetailCancelVO planDetailCancelVO = new PlanDetailCancelVO();
+        planDetailCancelVO.setHospitalId(hospitalPlanCancelVO.getHospitalId());
+        planDetailCancelVO.setPlanId(hospitalPlanCancelVO.getPlanId());
+        boolean res = false;
+        // 1.先判断数据是否存在有效
+        Plan plan = checkPlan(hospitalPlanCancelVO.getPlanId());
+        if (plan.getPlanStatus() == 1) {
+            throw new CommonException(CommonErrorCode.FAIL, "该方案启用中,不能删除!");
+        }
+        UpdateWrapper<Plan> planNew = new UpdateWrapper<>();
+        planNew
+                .eq("id", hospitalPlanCancelVO.getPlanId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalPlanCancelVO.getHospitalId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        res = update(new Plan(), planNew);
+        //再删除明细
+        planDetailFacade.cancelPlanDetail(planDetailCancelVO);
+
+        return res;
+    }
+
+    public boolean revStopPlan(PlanRevStopVO planRevStopVO) {
+        checkPlan(planRevStopVO.getId());
+        UpdateWrapper<Plan> planNew = new UpdateWrapper<>();
+        planNew
+                .eq("id", planRevStopVO.getId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("plan_status", planRevStopVO.getStatus())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        return update(new Plan(), planNew);
+    }
+
+    /**
+     * 判断数据是否存在有效
+     *
+     * @param id
+     */
+    private Plan checkPlan(Long id) {
+        // 1.先判断数据是否存在有效
+        QueryWrapper<Plan> PlanFand = new QueryWrapper<>();
+        PlanFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        Plan plan = getOne(PlanFand, false);
+        if (null == plan) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+        return plan;
+    }
+
+
+    public PlanInfoDefaultDTO getPlansDefaults() {
+        PlanInfoDefaultDTO data = new PlanInfoDefaultDTO();
+        QueryWrapper<Plan> planFand = new QueryWrapper<>();
+        planFand.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("plan_code", "plan_default")
+                .eq("hospital_id", -1L);
+        Plan plan = getOne(planFand, false);
+        BeanUtil.copyProperties(plan, data);
+        List<Long> planId = new ArrayList<>();
+        planId.add(plan.getId());
+        HospitalSetVO hospitalSetVO = new HospitalSetVO();
+        hospitalSetVO.setHospitalId(-1L);
+        hospitalSetVO.setPlanId(planId);
+        List<PlanDetailDTO> sysSetInfoData = planDetailFacade.getSysSetInfoData(hospitalSetVO);
+        data.setPlanDetailDefault(sysSetInfoData);
+        return data;
+    }
+
+    public List<PlanInfoPagesDTO> getSysPlanInfoData(HospitalPlanVO hospitalPlanVO) {
+        //查询该医院有没有相关方案配置
+        List<PlanInfoPagesDTO> sysPlanInfoDTO = new ArrayList<>();
+        QueryWrapper<Plan> sysPlanInfo = new QueryWrapper<>();
+        sysPlanInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
+        sysPlanInfo.eq("hospital_id", hospitalPlanVO.getHospitalId());
+        sysPlanInfo.eq(StringUtil.isNotBlank(hospitalPlanVO.getPlanCode()), "plan_code", hospitalPlanVO.getPlanCode());
+        sysPlanInfo.eq("plan_status", StatusEnum.Enable.getKey());
+        List<Plan> sysPlanInfoData = list(sysPlanInfo);
+        List<Long> planId = new ArrayList<>();
+        Long hospitalId = hospitalPlanVO.getHospitalId();
+        if (ListUtil.isNotEmpty(sysPlanInfoData)) {
+            sysPlanInfoDTO = BeanUtil.listCopyTo(sysPlanInfoData, PlanInfoPagesDTO.class);
+            for (PlanInfoPagesDTO data : sysPlanInfoDTO) {
+                planId.add(data.getId());
+            }
+        }
+        if (ListUtil.isEmpty(planId)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院没有配置方案,请先配置方案!");
+        }
+        HospitalSetVO hospitalSetVO = new HospitalSetVO();
+        hospitalSetVO.setHospitalId(hospitalId);
+        hospitalSetVO.setPlanId(planId);
+        List<PlanDetailDTO> sysSetInfoData = planDetailFacade.getSysSetInfoData(hospitalSetVO);
+        //把父级和子级数据sysSetInfoData放在方案下
+        Map<Long, List<PlanDetailDTO>> dataMap = sysSetInfoData.stream().collect(Collectors.groupingBy(PlanDetailDTO::getPlanId));
+        for (Long key : dataMap.keySet()) {
+            for (PlanInfoPagesDTO sysPlanInfos : sysPlanInfoDTO) {
+                if (sysPlanInfos.getId().equals(key)) {
+                    sysPlanInfos.setSysSetInfo(dataMap.get(key));
+                }
+            }
+        }
+
+        return sysPlanInfoDTO;
+    }
+
+    public List<PlanInfoPagesDTO> getPlanInfoIds(HospitalPlanIdVO hospitalPlanIdVO) {
+
+        //查询该医院有没有相关方案配置
+        List<PlanInfoPagesDTO> sysPlanInfoDTO = new ArrayList<>();
+        QueryWrapper<Plan> sysPlanInfo = new QueryWrapper<>();
+        sysPlanInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
+        sysPlanInfo.eq("hospital_id", hospitalPlanIdVO.getHospitalId());
+        sysPlanInfo.eq("id", hospitalPlanIdVO.getId());
+        List<Plan> sysPlanInfoData = list(sysPlanInfo);
+        List<Long> planId = new ArrayList<>();
+        Long hospitalId = hospitalPlanIdVO.getHospitalId();
+        List<Long> hospitaIds = new ArrayList<>();
+        if (ListUtil.isNotEmpty(sysPlanInfoData)) {
+            sysPlanInfoDTO = BeanUtil.listCopyTo(sysPlanInfoData, PlanInfoPagesDTO.class);
+            for (PlanInfoPagesDTO data : sysPlanInfoDTO) {
+                planId.add(data.getId());
+                hospitaIds.add(data.getHospitalId());
+            }
+
+        }
+        Map<Long, String> hospitalInfo = hospitalInfoFacade.getHospitalInfoData(hospitaIds);
+        if (ListUtil.isEmpty(planId)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在!");
+        }
+        HospitalSetVO hospitalSetVO = new HospitalSetVO();
+        hospitalSetVO.setHospitalId(hospitalId);
+        hospitalSetVO.setPlanId(planId);
+        List<PlanDetailDTO> sysSetInfoData = planDetailFacade.getSysSetInfoData(hospitalSetVO);
+        //把父级和子级数据sysSetInfoData放在方案下
+        Map<Long, List<PlanDetailDTO>> dataMap = sysSetInfoData.stream().collect(Collectors.groupingBy(PlanDetailDTO::getPlanId));
+        for (Long key : dataMap.keySet()) {
+            for (PlanInfoPagesDTO sysPlanInfos : sysPlanInfoDTO) {
+                if (sysPlanInfos.getId().equals(key)) {
+                    sysPlanInfos.setSysSetInfo(dataMap.get(key));
+                }
+                sysPlanInfos.setHospitalName(hospitalInfo.get(sysPlanInfos.getHospitalId()));
+            }
+        }
+        return sysPlanInfoDTO;
+    }
+}

+ 34 - 0
cdssman-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -0,0 +1,34 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.RetrievalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:44
+ */
+@Component
+public class RetrievalFacade {
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public RetrievalDTO index(RetrievalVO retrievalVO) {
+        RetrievalDTO retrievalDTO = new RetrievalDTO();
+        RespDTO<RetrievalDTO> respDTO = cdssCoreClient.index(retrievalVO);
+        RespDTOUtil.respNGDealCover(respDTO, "检索失败");
+        retrievalDTO = respDTO.data;
+        return retrievalDTO;
+    }
+}

+ 167 - 0
cdssman-service/src/main/java/com/diagbot/facade/TokenHospitalFacade.java

@@ -0,0 +1,167 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.TokenHospitaDTO;
+import com.diagbot.entity.TokenHospital;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.TokenHospitalService;
+import com.diagbot.service.impl.TokenHospitalServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.RSATokenIdUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.TokenHospitalCancelVO;
+import com.diagbot.vo.TokenHospitalInfoVO;
+import com.diagbot.vo.TokenHospitalUpdataVO;
+import com.diagbot.vo.TokenHospitalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-06 14:55
+ */
+@Component
+public class TokenHospitalFacade extends TokenHospitalServiceImpl {
+
+    @Autowired
+    TokenHospitalService tokenHospitalService;
+
+    /**
+     * @param tokenHospitalVO
+     * @return
+     */
+
+    public IPage<TokenHospitaDTO> getTokenHospitals(TokenHospitalVO tokenHospitalVO) {
+        IPage<TokenHospitaDTO> data = getTokenHospitalPages(tokenHospitalVO);
+        return data;
+    }
+
+    public Boolean addTokenHospitals(TokenHospitalInfoVO tokenHospitalInfoVO) {
+        //校验改医院是否存在token信息
+        UpdateWrapper<TokenHospital> tokenHospitalQueryWrapper = new UpdateWrapper<>();
+        tokenHospitalQueryWrapper
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", tokenHospitalInfoVO.getHospitalId());
+        int count = tokenHospitalService.count(tokenHospitalQueryWrapper);
+        if (count > 0) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院Token信息已存在!");
+        }
+        TokenHospital tokenHospitalData = getOne(tokenHospitalQueryWrapper, false);
+        Date now = DateUtil.now();
+        Date startTime = tokenHospitalInfoVO.getStartTime();
+        Date endTime = tokenHospitalInfoVO.getEndTime();
+        if (endTime.getTime() < startTime.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        int validDays = (int) ((endTime.getTime() - startTime.getTime()) / (1000 * 3600 * 24));
+        //生成Token规则, 请勿调换顺序!
+        StringBuffer sb = new StringBuffer();
+        sb.append("Token")
+                .append(DateUtil.formatDateTime(startTime))// 开始时间
+                .append(DateUtil.formatDateTime(endTime)) //结束时间
+                .append(tokenHospitalInfoVO.getHospitalId().toString()); // 医院id
+        TokenHospital tokenHospital = new TokenHospital();
+        //加密Token
+        try {
+            String appidToken = RSATokenIdUtil.encrypt(sb.toString());
+            if (appidToken.isEmpty()) {
+                throw new CommonException(CommonErrorCode.FAIL, "生成token失败!");
+            }
+            BeanUtil.copyProperties(tokenHospitalInfoVO, tokenHospital);
+            tokenHospital.setValidDays(validDays);
+            tokenHospital.setAppidToken(appidToken);
+            tokenHospital.setGmtCreate(now);
+            tokenHospital.setGmtModified(now);
+            tokenHospital.setModifier(UserUtils.getCurrentPrincipleID());
+            tokenHospital.setCreator(UserUtils.getCurrentPrincipleID());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return tokenHospitalService.save(tokenHospital);
+    }
+
+    public boolean cancelTokenHospitals(TokenHospitalCancelVO tokenHospitalCancelVO) {
+        UpdateWrapper<TokenHospital> tokenHospitalQueryWrapper = new UpdateWrapper<>();
+        tokenHospitalQueryWrapper
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", tokenHospitalCancelVO.getId());
+        return tokenHospitalService.remove(tokenHospitalQueryWrapper);
+    }
+
+    public boolean updataTokenHospitals(TokenHospitalUpdataVO tokenHospitalInfoVO) {
+        //校验数据
+        checkTokenHospital(tokenHospitalInfoVO.getId());
+        Date now = DateUtil.now();
+        Date startTime = tokenHospitalInfoVO.getStartTime();
+        Date endTime = tokenHospitalInfoVO.getEndTime();
+        if (endTime.getTime() < startTime.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        int validDays = (int) ((endTime.getTime() - startTime.getTime()) / (1000 * 3600 * 24));
+        //生成Token规则, 请勿调换顺序!
+        StringBuffer sb = new StringBuffer();
+        sb.append("Token")
+                .append(DateUtil.formatDateTime(startTime))// 开始时间
+                .append(DateUtil.formatDateTime(endTime)) //结束时间
+                .append(tokenHospitalInfoVO.getHospitalId().toString()); // 医院id
+        //加密Token
+        String appidToken = "";
+        try {
+            appidToken = RSATokenIdUtil.encrypt(sb.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (appidToken.isEmpty()) {
+            throw new CommonException(CommonErrorCode.FAIL, "生成token失败!");
+        }
+        UpdateWrapper<TokenHospital> tokenHospitalQueryWrapper = new UpdateWrapper<>();
+        tokenHospitalQueryWrapper
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", tokenHospitalInfoVO.getId())
+                .eq("hospital_id", tokenHospitalInfoVO.getHospitalId())
+                .set("appid_token", appidToken)
+                .set("start_time", startTime)
+                .set("end_time", endTime)
+                .set("valid_days", validDays);
+        return update(new TokenHospital(), tokenHospitalQueryWrapper);
+    }
+
+    /**
+     * 检验数据是否有效
+     */
+    private TokenHospital checkTokenHospital(Long id) {
+        // 1.先判断数据是否存在有效
+        QueryWrapper<TokenHospital> tokenHospitalFand = new QueryWrapper<>();
+        tokenHospitalFand.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        TokenHospital tokenHospital = getOne(tokenHospitalFand, false);
+        if (null == tokenHospital) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+        return tokenHospital;
+    }
+
+    /**
+     * 根据医院Id提供Token id
+     * @param hospitalId
+     * @return
+     */
+    public Long getHospitalTokenId(Long hospitalId) {
+        QueryWrapper<TokenHospital> tokenHospitalFand = new QueryWrapper<>();
+        tokenHospitalFand.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        TokenHospital tokenHospital = getOne(tokenHospitalFand);
+        if (null == tokenHospital) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院未生成Token!");
+        }
+        return tokenHospital.getId();
+    }
+
+}

+ 112 - 0
cdssman-service/src/main/java/com/diagbot/facade/TokenPermissionFacade.java

@@ -0,0 +1,112 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.PermissionAllDTO;
+import com.diagbot.entity.TokenPermission;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.TokenPermissionServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.PermissionTokenAllVO;
+import com.diagbot.vo.PermissionTokenCancelVO;
+import com.diagbot.vo.PermissionTokenUpadataVO;
+import com.diagbot.vo.TokenPermissionAllVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-08-10 10:18
+ */
+@Component
+public class TokenPermissionFacade extends TokenPermissionServiceImpl {
+
+    @Autowired
+    TokenHospitalFacade tokenHospitalFacade;
+
+    public List<PermissionAllDTO> getPermissionAlls(TokenPermissionAllVO tokenPermissionAllVO) {
+        List<PermissionAllDTO> data = getPermissionAll(tokenPermissionAllVO);
+        return data;
+    }
+
+    /**
+     * @param permissionTokenAllVO
+     * @return
+     */
+    public Boolean boundPermissionTokens(PermissionTokenAllVO permissionTokenAllVO) {
+        Date now = DateUtil.now();
+        Long tokenId = tokenHospitalFacade.getHospitalTokenId(permissionTokenAllVO.getHospitalId());
+        QueryWrapper<TokenPermission> tokenPermissionQuery = new QueryWrapper<>();
+        tokenPermissionQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("token_id", tokenId)
+                .eq("permission_id", permissionTokenAllVO.getPermissionId());
+        int count = count(tokenPermissionQuery);
+        if(count>0){
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该数据已存在");
+        }
+        TokenPermission tokenPermission = new TokenPermission();
+        BeanUtil.copyProperties(permissionTokenAllVO, tokenPermission);
+        tokenPermission.setCreator(UserUtils.getCurrentPrincipleID());
+        tokenPermission.setModifier(UserUtils.getCurrentPrincipleID());
+        tokenPermission.setTokenId(tokenId);
+        tokenPermission.setGmtModified(now);
+        tokenPermission.setGmtCreate(now);
+        return save(tokenPermission);
+    }
+
+    /**
+     * @param permissionTokenUpadataVO
+     * @return
+     */
+    public Boolean updataPermissionToken(PermissionTokenUpadataVO permissionTokenUpadataVO) {
+        Date now = DateUtil.now();
+        checkTokenPermission(permissionTokenUpadataVO.getId());
+        UpdateWrapper<TokenPermission> tokenPermission = new UpdateWrapper<>();
+        tokenPermission.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", permissionTokenUpadataVO.getId())
+                .eq("permission_id", permissionTokenUpadataVO.getPermissionId())
+                .set("param_key", permissionTokenUpadataVO.getParamKey())
+                .set("param_value", permissionTokenUpadataVO.getParamValue())
+                .set("gmt_modified", now)
+                .set("gmt_create", now)
+                .set("creator", UserUtils.getCurrentPrincipleID())
+                .set("modifier", UserUtils.getCurrentPrincipleID());
+        return update(new TokenPermission(), tokenPermission);
+
+    }
+
+    /**
+     * 判断数据是否存在有效
+     *
+     * @param id
+     */
+    private TokenPermission checkTokenPermission(Long id) {
+        // 1.先判断数据是否存在有效
+        QueryWrapper<TokenPermission> tokenPermissionData = new QueryWrapper<>();
+        tokenPermissionData.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("id", id);
+        TokenPermission tokenData = getOne(tokenPermissionData, false);
+        if (null == tokenData) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在");
+        }
+        return tokenData;
+    }
+
+    public Boolean cancelPermissionToken(PermissionTokenCancelVO permissionTokenCancelVO) {
+        checkTokenPermission(permissionTokenCancelVO.getId());
+        UpdateWrapper<TokenPermission> tokenPermission = new UpdateWrapper<>();
+        tokenPermission.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", permissionTokenCancelVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("gmt_modified", DateUtil.now())
+                .set("modifier", UserUtils.getCurrentPrincipleID());
+        return update(new TokenPermission(), tokenPermission);
+    }
+}

+ 0 - 0
cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java


Some files were not shown because too many files changed in this diff