Explorar o código

Merge remote-tracking branch 'origin/master'

SGTY hai 5 meses
pai
achega
410ac5afc8
Modificáronse 73 ficheiros con 3662 adicións e 1 borrados
  1. 42 0
      pom.xml
  2. 12 1
      src/main/java/com/qizhen/healsphere/Application.java
  3. 33 0
      src/main/java/com/qizhen/healsphere/config/MybatisPlusConfigurer.java
  4. 16 0
      src/main/java/com/qizhen/healsphere/dto/BaseNodeDTO.java
  5. 18 0
      src/main/java/com/qizhen/healsphere/dto/BaseNodeRSDTO.java
  6. 19 0
      src/main/java/com/qizhen/healsphere/dto/CategorieDTO.java
  7. 29 0
      src/main/java/com/qizhen/healsphere/dto/GNodeDTO.java
  8. 17 0
      src/main/java/com/qizhen/healsphere/dto/GraphDTO.java
  9. 19 0
      src/main/java/com/qizhen/healsphere/dto/GraphLabelDTO.java
  10. 23 0
      src/main/java/com/qizhen/healsphere/dto/LinkDTO.java
  11. 15 0
      src/main/java/com/qizhen/healsphere/dto/NextNodeDTO.java
  12. 45 0
      src/main/java/com/qizhen/healsphere/dto/RespDTO.java
  13. 18 0
      src/main/java/com/qizhen/healsphere/dto/Tree.java
  14. 17 0
      src/main/java/com/qizhen/healsphere/dto/TreeDTO.java
  15. 73 0
      src/main/java/com/qizhen/healsphere/dto/TreeNodeDTO.java
  16. 160 0
      src/main/java/com/qizhen/healsphere/entity/PresetInfo.java
  17. 42 0
      src/main/java/com/qizhen/healsphere/enums/IsDeleteEnum.java
  18. 67 0
      src/main/java/com/qizhen/healsphere/exception/CommonErrorCode.java
  19. 36 0
      src/main/java/com/qizhen/healsphere/exception/CommonException.java
  20. 81 0
      src/main/java/com/qizhen/healsphere/exception/CommonExceptionHandler.java
  21. 15 0
      src/main/java/com/qizhen/healsphere/exception/ErrorCode.java
  22. 39 0
      src/main/java/com/qizhen/healsphere/exception/ServiceErrorCode.java
  23. 157 0
      src/main/java/com/qizhen/healsphere/facade/KgFacade.java
  24. 13 0
      src/main/java/com/qizhen/healsphere/facade/PresetInfoFacade.java
  25. 24 0
      src/main/java/com/qizhen/healsphere/mapper/KgMapper.java
  26. 16 0
      src/main/java/com/qizhen/healsphere/mapper/PresetInfoMapper.java
  27. 225 0
      src/main/java/com/qizhen/healsphere/model/Disease.java
  28. 51 0
      src/main/java/com/qizhen/healsphere/model/Zbyy.java
  29. 51 0
      src/main/java/com/qizhen/healsphere/model/Zczzbfbz.java
  30. 51 0
      src/main/java/com/qizhen/healsphere/model/Zdbz.java
  31. 51 0
      src/main/java/com/qizhen/healsphere/model/Zdxgjc.java
  32. 51 0
      src/main/java/com/qizhen/healsphere/model/Zl.java
  33. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlcs.java
  34. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlcz.java
  35. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlfa.java
  36. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlfs.java
  37. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlmb.java
  38. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlqx.java
  39. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlxgjc.java
  40. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlyj.java
  41. 51 0
      src/main/java/com/qizhen/healsphere/model/Zlyw.java
  42. 50 0
      src/main/java/com/qizhen/healsphere/model/Zlyz.java
  43. 51 0
      src/main/java/com/qizhen/healsphere/model/Zz.java
  44. 15 0
      src/main/java/com/qizhen/healsphere/repository/DiseaseRepository.java
  45. 10 0
      src/main/java/com/qizhen/healsphere/repository/ZbyyRepository.java
  46. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZczzbfbzRepository.java
  47. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZdbzRepository.java
  48. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZdxgjcRepository.java
  49. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlRepository.java
  50. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlcsRepository.java
  51. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlczRepository.java
  52. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlfaRepository.java
  53. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlfsRepository.java
  54. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlmbRepository.java
  55. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlqxRepository.java
  56. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlxgjcRepository.java
  57. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlyjRepository.java
  58. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlywRepository.java
  59. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZlyzRepository.java
  60. 8 0
      src/main/java/com/qizhen/healsphere/repository/ZzRepository.java
  61. 19 0
      src/main/java/com/qizhen/healsphere/service/KgService.java
  62. 18 0
      src/main/java/com/qizhen/healsphere/service/PresetInfoService.java
  63. 29 0
      src/main/java/com/qizhen/healsphere/service/impl/KgServiceImpl.java
  64. 20 0
      src/main/java/com/qizhen/healsphere/service/impl/PresetInfoServiceImpl.java
  65. 52 0
      src/main/java/com/qizhen/healsphere/util/BeanUtil.java
  66. 702 0
      src/main/java/com/qizhen/healsphere/util/EntityUtil.java
  67. 23 0
      src/main/java/com/qizhen/healsphere/vo/KgQueryVO.java
  68. 23 0
      src/main/java/com/qizhen/healsphere/vo/KgTreeVO.java
  69. 58 0
      src/main/java/com/qizhen/healsphere/web/demo/KgController.java
  70. 58 0
      src/main/resources/application.yml
  71. 27 0
      src/main/resources/mapper/KgMapper.xml
  72. 19 0
      src/main/resources/mapper/PresetInfoMapper.xml
  73. 383 0
      src/test/java/com/qizhen/healsphere/DiseaseTests.java

+ 42 - 0
pom.xml

@@ -42,6 +42,46 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.1.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-neo4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.neo4j.driver</groupId>
+            <artifactId>neo4j-java-driver</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi</artifactId>
@@ -100,6 +140,8 @@
             <artifactId>jakarta.validation-api</artifactId>
             <version>2.0.1</version>
         </dependency>
+
+
     </dependencies>
     <dependencyManagement>
         <dependencies>

+ 12 - 1
src/main/java/com/qizhen/healsphere/Application.java

@@ -1,9 +1,20 @@
 package com.qizhen.healsphere;
 
+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.data.neo4j.repository.config.EnableNeo4jRepositories;
 
-@SpringBootApplication
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
+        JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class },scanBasePackages = "com.qizhen.healsphere")
+@ConfigurationPropertiesScan
+@MapperScan("com.qizhen.healsphere.mapper")
+@EnableNeo4jRepositories
 public class Application {
 
     public static void main(String[] args) {

+ 33 - 0
src/main/java/com/qizhen/healsphere/config/MybatisPlusConfigurer.java

@@ -0,0 +1,33 @@
+package com.qizhen.healsphere.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @Description: MybatisPlus配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:39
+ */
+@EnableTransactionManagement
+@Configuration
+@MapperScan("com.qizhen.healsphere.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;
+    }
+
+}

+ 16 - 0
src/main/java/com/qizhen/healsphere/dto/BaseNodeDTO.java

@@ -0,0 +1,16 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 11:02
+ */
+@Getter
+@Setter
+public class BaseNodeDTO {
+    private String name;
+    private String label;
+}

+ 18 - 0
src/main/java/com/qizhen/healsphere/dto/BaseNodeRSDTO.java

@@ -0,0 +1,18 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 11:02
+ */
+@Getter
+@Setter
+public class BaseNodeRSDTO {
+    private String rType;
+    private List<NextNodeDTO> eNodeDTOS;
+}

+ 19 - 0
src/main/java/com/qizhen/healsphere/dto/CategorieDTO.java

@@ -0,0 +1,19 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/17 15:08
+ */
+@Getter
+@Setter
+public class CategorieDTO {
+    private String name;
+
+    public CategorieDTO(String name){
+        this.name = name;
+    }
+}

+ 29 - 0
src/main/java/com/qizhen/healsphere/dto/GNodeDTO.java

@@ -0,0 +1,29 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 10:11
+ */
+@Getter
+@Setter
+public class GNodeDTO {
+    private String type;
+    private Integer category;
+    private String label;
+    private Integer name;
+    private String symbol;
+    private Integer symbolSize;
+
+    public GNodeDTO(String type, Integer category, String label, Integer name, String symbol, Integer symbolSize) {
+        this.type = type;
+        this.category = category;
+        this.label = label;
+        this.name = name;
+        this.symbol = symbol;
+        this.symbolSize = symbolSize;
+    }
+}

+ 17 - 0
src/main/java/com/qizhen/healsphere/dto/GraphDTO.java

@@ -0,0 +1,17 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 10:57
+ */
+@Getter
+@Setter
+public class GraphDTO extends BaseNodeDTO{
+    private List<BaseNodeRSDTO> eNodeRSDTOS;
+}

+ 19 - 0
src/main/java/com/qizhen/healsphere/dto/GraphLabelDTO.java

@@ -0,0 +1,19 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 15:06
+ */
+@Getter
+@Setter
+public class GraphLabelDTO {
+    private List<CategorieDTO> categories;
+    private List<GNodeDTO> node;
+    private List<LinkDTO> links;
+}

+ 23 - 0
src/main/java/com/qizhen/healsphere/dto/LinkDTO.java

@@ -0,0 +1,23 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/17 15:09
+ */
+@Getter
+@Setter
+public class LinkDTO {
+    private Integer source;
+    private Integer target;
+    private String value;
+
+    public LinkDTO(Integer source, Integer target, String value) {
+        this.source = source;
+        this.target = target;
+        this.value = value;
+    }
+}

+ 15 - 0
src/main/java/com/qizhen/healsphere/dto/NextNodeDTO.java

@@ -0,0 +1,15 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 11:02
+ */
+@Getter
+@Setter
+public class NextNodeDTO extends BaseNodeDTO {
+    private Integer pCount;
+}

+ 45 - 0
src/main/java/com/qizhen/healsphere/dto/RespDTO.java

@@ -0,0 +1,45 @@
+package com.qizhen.healsphere.dto;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 通用返回格式
+ * @author: gaodm
+ * @time: 2018/8/1 14:55
+ */
+public class RespDTO<T> implements Serializable {
+
+
+    public String code = "0";
+    public String msg = "";
+    public T data;
+
+    public static RespDTO onSuc(Object data) {
+        RespDTO resp = new RespDTO();
+        resp.data = data;
+        return resp;
+    }
+
+    public static RespDTO onSucBoth(String code,String msg,Object data) {
+        RespDTO resp = new RespDTO();
+        resp.code = code;
+        resp.msg = msg;
+        resp.data = data;
+        return resp;
+    }
+    public static RespDTO onError(String errMsg) {
+        RespDTO resp = new RespDTO();
+        resp.code = "-1";
+        resp.msg = errMsg;
+        return resp;
+    }
+
+    @Override
+    public String toString() {
+        return "RespDTO{" +
+                "code='" + code + '\'' +
+                ", msg='" + msg + '\'' +
+                ", data=" + data +
+                '}';
+    }
+}

+ 18 - 0
src/main/java/com/qizhen/healsphere/dto/Tree.java

@@ -0,0 +1,18 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/18 9:55
+ */
+@Getter
+@Setter
+public class Tree {
+    private String name;
+    private List<Tree> sNode;
+}

+ 17 - 0
src/main/java/com/qizhen/healsphere/dto/TreeDTO.java

@@ -0,0 +1,17 @@
+package com.qizhen.healsphere.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/17 9:04
+ */
+@Getter
+@Setter
+public class TreeDTO {
+    private List<TreeNodeDTO> nodes;
+}

+ 73 - 0
src/main/java/com/qizhen/healsphere/dto/TreeNodeDTO.java

@@ -0,0 +1,73 @@
+package com.qizhen.healsphere.dto;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/18 9:18
+ */
+public class TreeNodeDTO {
+
+    private String icon;
+    private String iconOpen;
+    private String iconClose;
+    private Integer id;
+    private String name;
+    private Integer pId;
+
+    public TreeNodeDTO(String icon, String iconOpen, String iconClose, Integer id, String name, Integer pId) {
+        this.icon = icon;
+        this.iconOpen = iconOpen;
+        this.iconClose = iconClose;
+        this.id = id;
+        this.name = name;
+        this.pId = pId;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getIconOpen() {
+        return iconOpen;
+    }
+
+    public void setIconOpen(String iconOpen) {
+        this.iconOpen = iconOpen;
+    }
+
+    public String getIconClose() {
+        return iconClose;
+    }
+
+    public void setIconClose(String iconClose) {
+        this.iconClose = iconClose;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getpId() {
+        return pId;
+    }
+
+    public void setpId(Integer pId) {
+        this.pId = pId;
+    }
+}

+ 160 - 0
src/main/java/com/qizhen/healsphere/entity/PresetInfo.java

@@ -0,0 +1,160 @@
+package com.qizhen.healsphere.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;
+
+/**
+ * <p>
+ * 知识平台预设信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-03-31
+ */
+@TableName("ltkg_preset_info")
+public class PresetInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 类型 (0:默认,1:病历,20:疾病ICD10)
+     */
+    private Integer type;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 备注
+     */
+    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 LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime 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 Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    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 getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "PresetInfo{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", type=" + type +
+            ", title=" + title +
+            ", content=" + content +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 42 - 0
src/main/java/com/qizhen/healsphere/enums/IsDeleteEnum.java

@@ -0,0 +1,42 @@
+package com.qizhen.healsphere.enums;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 是否,例如:是否删除
+ * @author: gaodm
+ * @time: 2018/9/3 16:01
+ */
+public enum IsDeleteEnum {
+
+    Y("Y", "是"),
+    N("N", "否");
+
+    @Getter
+    @Setter
+    private String key;
+
+    @Getter
+    @Setter
+    private String name;
+
+    IsDeleteEnum(String key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static IsDeleteEnum getEnum(String key) {
+        for (IsDeleteEnum item : IsDeleteEnum.values()) {
+            if (item.key.equals(key)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(String key) {
+        IsDeleteEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+}

+ 67 - 0
src/main/java/com/qizhen/healsphere/exception/CommonErrorCode.java

@@ -0,0 +1,67 @@
+package com.qizhen.healsphere.exception;
+
+/**
+ * @Description: 通用错误码
+ * 系统码(3位) + 等级码(1位) + 4位顺序号
+ * 系统码 通用码 000;用户中心 100; 管理中心 200;
+ * @author: gaodm
+ * @time: 2018/8/1 14:56
+ */
+public enum CommonErrorCode implements ErrorCode {
+
+    OK("0", "操作成功"),
+    FAIL("00000001", "操作失败"),
+    RPC_ERROR("00000002", "远程调度失败"),
+    CHECK_CONNECTION("00000005","是否解除绑定"),
+    SAVE_SUCCESSFUL("00000007","添加成功"),
+    ALTER_SUCCESSFUL("00000009","修改成功"),
+    PARAM_ERROR("00029999", "%s"), //参数错误
+    NOT_EXISTS("00020001", "该数据不存在!"),
+    INSERT_DATA_FAILED("00020002", "数据库写入失败!"),
+    UPDATE_INFO_FAIL("00020003", "更新数据失败!"),
+    PARAM_IS_NULL("00020004", "传入的参数为空!"),
+    PARAM_IS_ERROR("00020005", "传入的参数为错误!"),
+    STATUS_IS_ERROR("00020006", "参数状态错误!"),
+    SERVER_IS_ERROR("00020007", "各自业务错误!"),
+    NO_PERMISSION("00020008", "无权访问!"),
+    IS_EXISTS("00020009", "已存在!"),
+    ANALYZER_TOKEN_FAIL("10020010", "解析token失败"),
+    TOKEN_PAST("10020011", "token已失效,请重新登录"),
+
+    SECURITYCODE_ERROR("20020001", "防伪码错误"),
+    APPKEY_ERROR("20020002", "appkey或secret错误"),
+    PRODUCT_STOP_ERROR("20020003", "该产品已停用"),
+    OVERDUE_ERROR("20020004", "访问权限已过期"),
+    NOPERMISSION_ERROR("20020005", "无权限访问"),
+    SERVICE_STOP_ERROR("20020006", "当前服务已停用"),
+    NOTVALID_ERROR("20020007", "该产品未在有效服务期内,无法使用"),
+    EXPIRE_ERROR("20020008", "该产品已超出有效服务期,无法使用");
+
+
+    private String code;
+    private String msg;
+
+
+    CommonErrorCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public static CommonErrorCode codeOf(String code) {
+        for (CommonErrorCode state : values()) {
+            if (state.getCode().equals(code)) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 36 - 0
src/main/java/com/qizhen/healsphere/exception/CommonException.java

@@ -0,0 +1,36 @@
+package com.qizhen.healsphere.exception;
+
+
+/**
+ * @Description: 通用错误封装
+ * @author: gaodm
+ * @time: 2018/8/1 14:56
+ */
+public class CommonException extends RuntimeException {
+
+    private ErrorCode errorCode;
+
+    public CommonException(ErrorCode errorCode) {
+        super(errorCode.getMsg());
+        this.errorCode = errorCode;
+    }
+
+    public CommonException(ErrorCode errorCode, String msg) {
+        super(msg);
+        this.errorCode = errorCode;
+    }
+
+    public ErrorCode getErrorCode() {
+        return errorCode;
+    }
+
+
+    public String getCode() {
+        return errorCode.getCode();
+    }
+
+    public String getMsg() {
+        return errorCode.getMsg();
+    }
+
+}

+ 81 - 0
src/main/java/com/qizhen/healsphere/exception/CommonExceptionHandler.java

@@ -0,0 +1,81 @@
+package com.qizhen.healsphere.exception;
+
+import cn.hutool.json.JSONUtil;
+import com.qizhen.healsphere.dto.RespDTO;
+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 = JSONUtil.toJsonStr(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 = JSONUtil.toJsonStr(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 = JSONUtil.toJsonStr(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);
+    }
+
+}

+ 15 - 0
src/main/java/com/qizhen/healsphere/exception/ErrorCode.java

@@ -0,0 +1,15 @@
+package com.qizhen.healsphere.exception;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 错误基础接口
+ * @author: gaodm
+ * @time: 2018/9/10 11:01
+ */
+public interface ErrorCode extends Serializable {
+
+    String getCode();
+
+    String getMsg();
+}

+ 39 - 0
src/main/java/com/qizhen/healsphere/exception/ServiceErrorCode.java

@@ -0,0 +1,39 @@
+package com.qizhen.healsphere.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;
+    }
+}

+ 157 - 0
src/main/java/com/qizhen/healsphere/facade/KgFacade.java

@@ -0,0 +1,157 @@
+package com.qizhen.healsphere.facade;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.qizhen.healsphere.dto.*;
+import com.qizhen.healsphere.entity.PresetInfo;
+import com.qizhen.healsphere.enums.IsDeleteEnum;
+import com.qizhen.healsphere.exception.CommonErrorCode;
+import com.qizhen.healsphere.exception.CommonException;
+import com.qizhen.healsphere.service.impl.KgServiceImpl;
+import com.qizhen.healsphere.vo.KgQueryVO;
+import com.qizhen.healsphere.vo.KgTreeVO;
+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;
+
+/**
+ * @Description: 用户日志业务层
+ * @author: gaodm
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class KgFacade extends KgServiceImpl {
+    @Autowired
+    private PresetInfoFacade presetInfoFacade;
+
+    public GraphLabelDTO getGraphFac(KgQueryVO kgQueryVO) {
+        GraphLabelDTO graphLabelDTO = new GraphLabelDTO();
+        List<CategorieDTO> categories = new ArrayList<>();
+        List<GNodeDTO> node = new ArrayList<>();
+        List<LinkDTO> links = new ArrayList<>();
+        List<GraphDTO> res = this.getGraph(kgQueryVO);
+        if (CollUtil.isEmpty(res)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS);
+        } else {
+            Integer nodeId = 0;
+            categories.add(new CategorieDTO("中心词"));
+            categories.add(new CategorieDTO("关系"));
+            Map<String, Integer> cMap = new HashMap<>();
+            cMap.put("中心词", 0);
+            cMap.put("关系", 1);
+
+            GraphDTO graphDTO = res.get(0);
+            GNodeDTO gNodeDTO
+                    = new GNodeDTO(graphDTO.getLabel(), 0, graphDTO.getName(), nodeId, "circle", 50);
+            nodeId++;
+            node.add(gNodeDTO);
+            if (CollUtil.isNotEmpty(graphDTO.getENodeRSDTOS())) {
+                Integer rsId = 2;
+                for (BaseNodeRSDTO baseNodeRSDTO : graphDTO.getENodeRSDTOS()) {
+                    if (null == cMap.get(baseNodeRSDTO.getRType())) {
+                        cMap.put(baseNodeRSDTO.getRType(), rsId);
+                        categories.add(new CategorieDTO(baseNodeRSDTO.getRType()));
+                        rsId++;
+                    }
+                    GNodeDTO nNodeDTO
+                            = new GNodeDTO("", 1, "", nodeId, "diamond", 10);
+                    node.add(nNodeDTO);
+                    links.add(new LinkDTO(gNodeDTO.getName(), nNodeDTO.getName(), baseNodeRSDTO.getRType()));
+                    nodeId++;
+                    if (CollUtil.isNotEmpty(baseNodeRSDTO.getENodeDTOS())) {
+                        for (NextNodeDTO baseNodeDTO : baseNodeRSDTO.getENodeDTOS()) {
+                            String symbol = "diamond";
+                            if (baseNodeDTO.getPCount() > 0) {
+                                symbol = "circle";
+                            }
+                            GNodeDTO eNodeDTO
+                                    = new GNodeDTO(baseNodeDTO.getLabel(), cMap.get(baseNodeRSDTO.getRType()),
+                                    baseNodeDTO.getName(), nodeId, symbol, 28);
+                            nodeId++;
+                            node.add(eNodeDTO);
+                            links.add(new LinkDTO(nNodeDTO.getName(), eNodeDTO.getName(), ""));
+                        }
+                    }
+                }
+            }
+            graphLabelDTO.setCategories(categories);
+            graphLabelDTO.setNode(node);
+            graphLabelDTO.setLinks(links);
+        }
+
+        return graphLabelDTO;
+    }
+
+    public TreeDTO getTreeFac(KgTreeVO kgTreeVO) {
+        TreeDTO treeDTO = new TreeDTO();
+        if ((kgTreeVO.getType() == 1
+                && (kgTreeVO.getSubType() == 1 || kgTreeVO.getSubType() == 2 || kgTreeVO.getSubType() == 3))
+                || (kgTreeVO.getType() == 2 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 3 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 4 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 5 && (kgTreeVO.getSubType() == 0))
+                || (kgTreeVO.getType() == 6 && (kgTreeVO.getSubType() == 0))) {
+            // KgQueryVO kgQueryVO = new KgQueryVO();
+            // kgQueryVO.setLabelName("诊断依据");
+            // kgQueryVO.setInputStr("诊断依据");
+            // String tree = this.getTree(kgQueryVO);
+            PresetInfo presetInfo = presetInfoFacade.getOne(new QueryWrapper<PresetInfo>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("type", (kgTreeVO.getType() * 10 + kgTreeVO.getSubType())), false);
+            String tree = "";
+            if (null != presetInfo){
+                tree = presetInfo.getContent();
+            }
+            if (StrUtil.isBlank(tree)) {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS);
+            } else {
+                treeDTO = getTreeDTO(tree);
+            }
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR);
+        }
+        return treeDTO;
+    }
+
+    private TreeDTO getTreeDTO(String tree) {
+        TreeDTO treeDTO = new TreeDTO();
+        List<TreeNodeDTO> nodes = new ArrayList<>();
+        Tree treeObj = JSONUtil.toBean(tree, Tree.class);
+        if (null != treeObj) {
+            Map<String, Integer> treeMap = new HashMap<>();
+            treeMap.put("根节点", 0);
+            addTree(nodes, treeObj, treeMap, "根节点");
+        }
+
+        treeDTO.setNodes(nodes);
+        return treeDTO;
+    }
+
+    private void addTree(List<TreeNodeDTO> nodes, Tree treeObj, Map<String, Integer> treeMap, String pName) {
+        if (null == treeMap.get(treeObj.getName())) {
+            treeMap.put(treeObj.getName(), treeMap.size());
+        }
+
+        TreeNodeDTO node = new TreeNodeDTO("/images/icon.png",
+                "/images/iconOpen.png",
+                "/images/iconClose.png",
+                treeMap.get(treeObj.getName()), treeObj.getName(), treeMap.get(pName));
+        nodes.add(node);
+        if (CollUtil.isNotEmpty(treeObj.getSNode())) {
+            for (Tree tree : treeObj.getSNode()) {
+                addTree(nodes, tree, treeMap, treeObj.getName());
+            }
+        } else {
+            node.setIcon("/images/node.png");
+            node.setIconOpen("");
+            node.setIconClose("");
+        }
+    }
+
+}

+ 13 - 0
src/main/java/com/qizhen/healsphere/facade/PresetInfoFacade.java

@@ -0,0 +1,13 @@
+package com.qizhen.healsphere.facade;
+
+import com.qizhen.healsphere.service.impl.PresetInfoServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/31 9:16
+ */
+@Component
+public class PresetInfoFacade extends PresetInfoServiceImpl {
+}

+ 24 - 0
src/main/java/com/qizhen/healsphere/mapper/KgMapper.java

@@ -0,0 +1,24 @@
+package com.qizhen.healsphere.mapper;
+
+import com.qizhen.healsphere.dto.GraphDTO;
+import com.qizhen.healsphere.vo.KgQueryVO;
+import org.springframework.data.neo4j.repository.query.Query;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface KgMapper {
+
+    List<GraphDTO> getGraph(KgQueryVO kgQueryVO);
+
+//    @Query("MATCH (n:`{0}`)-[r]->(m) where n.name = {1} RETURN head(Labels(n)) as sLabel,n.name as sName,Type (r) as rType, head(Labels(m)) as eLabel,m.name as eName" +
+//            "        ORDER BY rType")
+//    List<GraphDTO> getGraphNew(String labelName, String inputStr);
+}

+ 16 - 0
src/main/java/com/qizhen/healsphere/mapper/PresetInfoMapper.java

@@ -0,0 +1,16 @@
+package com.qizhen.healsphere.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qizhen.healsphere.entity.PresetInfo;
+
+/**
+ * <p>
+ * 知识平台预设信息 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-03-31
+ */
+public interface PresetInfoMapper extends BaseMapper<PresetInfo> {
+
+}

+ 225 - 0
src/main/java/com/qizhen/healsphere/model/Disease.java

@@ -0,0 +1,225 @@
+package com.qizhen.healsphere.model;
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+import org.springframework.data.neo4j.core.schema.Relationship;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Node("疾病名称")
+public class Disease {
+
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String icd10;
+
+
+    public Disease() {// 从 Neo4j API 2.0.5开始需要无参构造函数
+
+    }
+
+    public Disease(String name, String icd10) {
+        this.name = name;
+        this.icd10 = icd10;
+    }
+    
+    
+    @Relationship(type = "疾病相关诊疗操作")
+    public Set<Zlcz> zlczs;
+
+    public void addZlcz(Zlcz zlcz) {
+        if (zlczs == null) {
+            zlczs = new HashSet<>();
+        }
+        zlczs.add(zlcz);
+    }
+    
+    
+    @Relationship(type = "疾病相关治疗方案")
+    public Set<Zlfa> zlfas;
+
+    public void addZlfa(Zlfa zlfa) {
+        if (zlfas == null) {
+            zlfas = new HashSet<>();
+        }
+        zlfas.add(zlfa);
+    }
+
+    @Relationship(type = "疾病相关诊断标准")
+    public Set<Zdbz> zdbzs;
+
+    public void addZdbz(Zdbz zdbz) {
+        if (zdbzs == null) {
+            zdbzs = new HashSet<>();
+        }
+        zdbzs.add(zdbz);
+    }
+
+
+    @Relationship(type = "疾病相关治疗目标")
+    public Set<Zlmb> zlmbs;
+
+    public void addZlmb(Zlmb zlmb) {
+        if (zlmbs == null) {
+            zlmbs = new HashSet<>();
+        }
+        zlmbs.add(zlmb);
+    }
+
+    @Relationship(type = "疾病相关治疗方式")
+    public Set<Zlfs> zlfss;
+
+    public void addZlfs(Zlfs zlfs) {
+        if (zlfss == null) {
+            zlfss = new HashSet<>();
+        }
+        zlfss.add(zlfs);
+    }
+
+
+    @Relationship(type = "疾病相关治疗相关检查")
+    public Set<Zlxgjc> zlxgjcs;
+
+    public void addZlxgjc(Zlxgjc zlxgjc) {
+        if (zlxgjcs == null) {
+            zlxgjcs = new HashSet<>();
+        }
+        zlxgjcs.add(zlxgjc);
+    }
+
+    @Relationship(type = "疾病相关致病原因")
+    public Set<Zbyy> zbyys;
+
+    public void addZbyy(Zbyy zbyy) {
+        if (zbyys == null) {
+            zbyys = new HashSet<>();
+        }
+        zbyys.add(zbyy);
+    }
+
+
+    @Relationship(type = "疾病相关治疗原则")
+    public Set<Zlyz> zlyzs;
+
+    public void addZlyz(Zlyz zlyz) {
+        if (zlyzs == null) {
+            zlyzs = new HashSet<>();
+        }
+        zlyzs.add(zlyz);
+    }
+
+    @Relationship(type = "疾病相关诊疗依据")
+    public Set<Zlyj> zlyjs;
+
+    public void addZlyj(Zlyj zlyj) {
+        if (zlyjs == null) {
+            zlyjs = new HashSet<>();
+        }
+        zlyjs.add(zlyj);
+    }
+
+
+    @Relationship(type = "疾病相关治疗场所")
+    public Set<Zlcs> zlcss;
+
+    public void addZlcs(Zlcs zlcs) {
+        if (zlcss == null) {
+            zlcss = new HashSet<>();
+        }
+        zlcss.add(zlcs);
+    }
+
+    @Relationship(type = "疾病相关子类")
+    public Set<Zl> zls;
+
+    public void addZl(Zl zl) {
+        if (zls == null) {
+            zls = new HashSet<>();
+        }
+        zls.add(zl);
+    }
+
+
+    @Relationship(type = "疾病相关治疗器械")
+    public Set<Zlqx> zlqxs;
+
+    public void addZlqx(Zlqx zlqx) {
+        if (zlqxs == null) {
+            zlqxs = new HashSet<>();
+        }
+        zlqxs.add(zlqx);
+    }
+
+    @Relationship(type = "疾病相关治疗药物")
+    public Set<Zlyw> zlyws;
+
+    public void addZlyw(Zlyw zlyw) {
+        if (zlyws == null) {
+            zlyws = new HashSet<>();
+        }
+        zlyws.add(zlyw);
+    }
+
+
+    @Relationship(type = "疾病相关转出重症病房标准")
+    public Set<Zczzbfbz> zczzbfbzs;
+
+    public void addZczzbfbz(Zczzbfbz zczzbfbz) {
+        if (zczzbfbzs == null) {
+            zczzbfbzs = new HashSet<>();
+        }
+        zczzbfbzs.add(zczzbfbz);
+    }
+
+    @Relationship(type = "疾病相关诊断相关检查")
+    public Set<Zdxgjc> zdxgjcs;
+
+    public void addZdxgjc(Zdxgjc zdxgjc) {
+        if (zdxgjcs == null) {
+            zdxgjcs = new HashSet<>();
+        }
+        zdxgjcs.add(zdxgjc);
+    }
+
+
+    @Relationship(type = "疾病相关症状")
+    public Set<Zz> zzs;
+
+    public void addZz(Zz zz) {
+        if (zzs == null) {
+            zzs = new HashSet<>();
+        }
+        zzs.add(zz);
+    }
+    
+   
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getIcd10() {
+        return icd10;
+    }
+
+    public void setIcd10(String icd10) {
+        this.icd10 = icd10;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zbyy.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("致病原因")
+public class Zbyy {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zbyy() {
+
+    }
+
+    public Zbyy(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zczzbfbz.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("转出重症病房标准")
+public class Zczzbfbz {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zczzbfbz() {
+
+    }
+
+    public Zczzbfbz(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zdbz.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("诊断标准")
+public class Zdbz {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zdbz() {
+
+    }
+
+    public Zdbz(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zdxgjc.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("诊断相关检查")
+public class Zdxgjc {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zdxgjc() {
+
+    }
+
+    public Zdxgjc(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zl.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("子类")
+public class Zl {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zl() {
+
+    }
+
+    public Zl(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlcs.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗场所")
+public class Zlcs {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlcs() {
+
+    }
+
+    public Zlcs(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlcz.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("诊疗操作")
+public class Zlcz {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlcz() {
+
+    }
+
+    public Zlcz(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlfa.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗方案")
+public class Zlfa {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlfa() {
+
+    }
+
+    public Zlfa(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlfs.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗方式")
+public class Zlfs {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlfs() {
+
+    }
+
+    public Zlfs(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlmb.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗目标")
+public class Zlmb {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlmb() {
+
+    }
+
+    public Zlmb(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlqx.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗器械")
+public class Zlqx {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlqx() {
+
+    }
+
+    public Zlqx(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlxgjc.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗相关检查")
+public class Zlxgjc {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlxgjc() {
+
+    }
+
+    public Zlxgjc(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlyj.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("诊疗依据")
+public class Zlyj {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlyj() {
+
+    }
+
+    public Zlyj(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zlyw.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗药物")
+public class Zlyw {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlyw() {
+
+    }
+
+    public Zlyw(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 50 - 0
src/main/java/com/qizhen/healsphere/model/Zlyz.java

@@ -0,0 +1,50 @@
+package com.qizhen.healsphere.model;
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("治疗原则")
+public class Zlyz {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zlyz() {
+
+    }
+
+    public Zlyz(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 51 - 0
src/main/java/com/qizhen/healsphere/model/Zz.java

@@ -0,0 +1,51 @@
+package com.qizhen.healsphere.model;
+
+
+import org.springframework.data.neo4j.core.schema.GeneratedValue;
+import org.springframework.data.neo4j.core.schema.Id;
+import org.springframework.data.neo4j.core.schema.Node;
+
+@Node("症状")
+public class Zz {
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    private String name;
+
+    private String description;
+
+    public Zz() {
+
+    }
+
+    public Zz(String name, String description) {
+        this.name = name;
+        this.description = description;
+    }
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+}

+ 15 - 0
src/main/java/com/qizhen/healsphere/repository/DiseaseRepository.java

@@ -0,0 +1,15 @@
+package com.qizhen.healsphere.repository;
+
+
+import com.qizhen.healsphere.model.Disease;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface DiseaseRepository extends Neo4jRepository<Disease, Long> {
+
+    Disease findByName(String name);
+
+//    void update(Disease disease);
+}

+ 10 - 0
src/main/java/com/qizhen/healsphere/repository/ZbyyRepository.java

@@ -0,0 +1,10 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zbyy;
+import org.springframework.data.neo4j.repository.Neo4jRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ZbyyRepository extends Neo4jRepository<Zbyy, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZczzbfbzRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zczzbfbz;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZczzbfbzRepository extends CrudRepository<Zczzbfbz, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZdbzRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zdbz;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZdbzRepository extends CrudRepository<Zdbz, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZdxgjcRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zdxgjc;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZdxgjcRepository extends CrudRepository<Zdxgjc, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zl;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlRepository extends CrudRepository<Zl, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlcsRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlcs;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlcsRepository extends CrudRepository<Zlcs, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlczRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlcz;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlczRepository extends CrudRepository<Zlcz, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlfaRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlfa;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlfaRepository extends CrudRepository<Zlfa, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlfsRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlfs;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlfsRepository extends CrudRepository<Zlfs, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlmbRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlmb;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlmbRepository extends CrudRepository<Zlmb, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlqxRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlqx;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlqxRepository extends CrudRepository<Zlqx, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlxgjcRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlxgjc;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlxgjcRepository extends CrudRepository<Zlxgjc, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlyjRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlyj;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlyjRepository extends CrudRepository<Zlyj, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlywRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlyw;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlywRepository extends CrudRepository<Zlyw, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZlyzRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zlyz;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZlyzRepository extends CrudRepository<Zlyz, Long> {
+
+}

+ 8 - 0
src/main/java/com/qizhen/healsphere/repository/ZzRepository.java

@@ -0,0 +1,8 @@
+package com.qizhen.healsphere.repository;
+
+import com.qizhen.healsphere.model.Zz;
+import org.springframework.data.repository.CrudRepository;
+
+public interface ZzRepository extends CrudRepository<Zz, Long> {
+
+}

+ 19 - 0
src/main/java/com/qizhen/healsphere/service/KgService.java

@@ -0,0 +1,19 @@
+package com.qizhen.healsphere.service;
+
+import com.qizhen.healsphere.dto.GraphDTO;
+import com.qizhen.healsphere.vo.KgQueryVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface KgService {
+
+    List<GraphDTO> getGraph(KgQueryVO kgQueryVO);
+}

+ 18 - 0
src/main/java/com/qizhen/healsphere/service/PresetInfoService.java

@@ -0,0 +1,18 @@
+package com.qizhen.healsphere.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qizhen.healsphere.entity.PresetInfo;
+
+/**
+ * <p>
+ * 知识平台预设信息 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-03-31
+ */
+@DS("mysql")
+public interface PresetInfoService extends IService<PresetInfo> {
+
+}

+ 29 - 0
src/main/java/com/qizhen/healsphere/service/impl/KgServiceImpl.java

@@ -0,0 +1,29 @@
+package com.qizhen.healsphere.service.impl;
+
+import com.qizhen.healsphere.dto.GraphDTO;
+import com.qizhen.healsphere.mapper.KgMapper;
+import com.qizhen.healsphere.service.KgService;
+import com.qizhen.healsphere.vo.KgQueryVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+@Service
+public class KgServiceImpl implements KgService {
+    @Autowired
+    private KgMapper kgMapper;
+
+    @Override
+    public List<GraphDTO> getGraph(KgQueryVO kgQueryVO){
+        return kgMapper.getGraph(kgQueryVO);
+    }
+}

+ 20 - 0
src/main/java/com/qizhen/healsphere/service/impl/PresetInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.qizhen.healsphere.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qizhen.healsphere.entity.PresetInfo;
+import com.qizhen.healsphere.mapper.PresetInfoMapper;
+import com.qizhen.healsphere.service.PresetInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 知识平台预设信息 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-03-31
+ */
+@Service
+public class PresetInfoServiceImpl extends ServiceImpl<PresetInfoMapper, PresetInfo> implements PresetInfoService {
+
+}

+ 52 - 0
src/main/java/com/qizhen/healsphere/util/BeanUtil.java

@@ -0,0 +1,52 @@
+package com.qizhen.healsphere.util;
+
+
+import org.springframework.beans.BeanUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @Description: 对象转换工具类
+ * @author: gaodm
+ * @time: 2018/12/14 14:21
+ */
+public class BeanUtil {
+    /**
+     * 把一个对象的属性值复制给另外一个对象的属性值
+     *
+     * @param source 源对象,被转换的对象
+     * @param target 目标对象,即转换后对象
+     */
+    public static void copyProperties(Object source, Object target) {
+        BeanUtils.copyProperties(source, target);
+    }
+
+    /**
+     * 复制集合
+     *
+     * @param <E>
+     * @param source           转换前的列表
+     * @param destinationClass 转换后列表类
+     * @return 转换后列表
+     */
+    public static <E> List<E> listCopyTo(List<?> source, Class<E> destinationClass) {
+        try {
+            if (source.size() == 0) {
+                return Collections.emptyList();
+            }
+            List<E> res = new ArrayList<E>(source.size());
+            for (Object o : source) {
+                E e = destinationClass.newInstance();
+                BeanUtils.copyProperties(o, e);
+                res.add(e);
+            }
+            return res;
+        } catch (IllegalAccessException ex) {
+            throw new RuntimeException(ex);
+        } catch (InstantiationException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+}

+ 702 - 0
src/main/java/com/qizhen/healsphere/util/EntityUtil.java

@@ -0,0 +1,702 @@
+package com.qizhen.healsphere.util;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Validate;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 实体对象工具类
+ * @author: gaodm
+ * @time: 2018/9/13 20:12
+ */
+@Slf4j
+public class EntityUtil {
+
+    private static final String DATE_CLASS_NAME = Date.class.getName();
+    public static String[]  dateFormats = {
+            "yyyy年MM月dd日HH时mm分",
+            "yyyy年MM月dd日HH:mm",
+            "yyyy年MM月dd日H时mm分",
+            "yyyy年MM月dd日HH时m分",
+            "yyyy年MM月dd日H时m分",
+            "yyyy年M月dd日HH时mm分",
+            "yyyy年M月dd日H时mm分",
+            "yyyy年M月dd日HH时m分",
+            "yyyy年M月dd日H时m分",
+            "yyyy年MM月d日HH时mm分",
+            "yyyy年MM月d日H时mm分",
+            "yyyy年MM月d日HH时m分",
+            "yyyy年MM月d日H时m分",
+            "yyyy年M月d日HH时mm分",
+            "yyyy年M月d日H时mm分",
+            "yyyy年M月d日HH时m分",
+            "yyyy年M月d日H时m分",
+            "yyyy-MM-ddHH:mm:ss",
+            "yyyy-MM-ddHH:mm",
+            "yyyy-MM-ddHH:m",
+            "yyyy-MM-ddH:mm",
+            "yyyy-MM-ddH:m",
+            "yyyy-M-ddHH:mm",
+            "yyyy-M-ddHH:m",
+            "yyyy-M-ddH:mm",
+            "yyyy-M-ddH:m",
+            "yyyy-MM-dHH:mm",
+            "yyyy-MM-dHH:m",
+            "yyyy-MM-dH:mm",
+            "yyyy-MM-dH:m",
+            "yyyy-M-dHH:mm",
+            "yyyy-M-dHH:m",
+            "yyyy-M-dH:mm",
+            "yyyy-M-dH:m",
+            "yyyy-MM-dd",
+            "yyyy年MM月dd日H时",
+            "yyyy/MM/ddHH:mm:ss",
+            "yyyy/MM/ddHH:mm",
+            "yyyy/MM/ddHH:m",
+            "yyyy/MM/ddH:mm",
+            "yyyy/MM/ddH:m",
+            "yyyy/MM/ddHH:mm:",
+            "yyyy/M/ddHH:mm",
+            "yyyy/M/ddHH:m",
+            "yyyy/M/ddH:mm",
+            "yyyy/M/ddH:m",
+            "yyyy/MM/dHH:mm",
+            "yyyy/MM/dHH:m",
+            "yyyy/MM/dH:mm",
+            "yyyy/MM/dH:m",
+            "yyyy/M/dHH:mm",
+            "yyyy/M/dHH:m",
+            "yyyy/M/dH:mm",
+            "yyyy/M/dH:m",
+            "yyyy/MM/dd",
+            "yyyy.MM.dd",
+            "yyyy-MM-ddHH:mm:ss.000",
+            "yyyyMMddHH:mm",
+            "yyyy-MM-dd'T'HH:mm:ss",
+            "MM/dd/yyyyHH:mm:ss"
+    };
+
+    /**
+     * 将list中元素的某一成员组装成list返回。注意:会去重!
+     *
+     * @param list      元素列表
+     * @param fieldName 成员变量的field
+     * @param <T>       元素类型
+     * @return 返回该字段组成的list
+     */
+    public static <T> List makeListByFieldName(List<T> list, String fieldName) {
+        List returnList = new LinkedList();
+        if (list.isEmpty()) {
+            return returnList;
+        }
+        Object firstObj = list.get(0);
+        Field field = FieldUtils.getField(firstObj.getClass(), fieldName, true);
+        if (field == null) {
+            throw new RuntimeException(firstObj.getClass().getName() + "不存在" + fieldName);
+        }
+        try {
+            for (T o : list) {
+                if (!returnList.contains(field.get(o))) {
+                    returnList.add(field.get(o));
+                }
+            }
+        } catch (IllegalAccessException e) {
+            //懒得在外面try catch, 直接ignore
+            throw new RuntimeException(e);
+        }
+        return returnList;
+    }
+
+    /**
+     * 将Collection中元素的某一成员组装成Set返回
+     *
+     * @param collection 元素列表
+     * @param fieldName  成员变量的field
+     * @param <T>        元素类型
+     * @return 返回该字段组成的LinkedHashSet。若元素中不存在名为fieldName的成员变量,则返回EmptySet
+     */
+    public static <T> LinkedHashSet makeLinkedSetByFieldName(Collection<T> collection, String fieldName) {
+        LinkedHashSet returnLinkedSet = new LinkedHashSet<>();
+        Iterator<T> it = collection.iterator();
+        boolean isFirst = true;
+        Field field = null;
+        while (it.hasNext()) {
+            T o = it.next();
+            if (isFirst) {
+                field = FieldUtils.getField(o.getClass(), fieldName, true);
+                if (field == null) {
+                    throw new RuntimeException(o.getClass().getName() + "不存在" + fieldName);
+                }
+                isFirst = false;
+            }
+            try {
+                returnLinkedSet.add(field.get(o));
+            } catch (IllegalAccessException e) {
+                //ignore
+                throw new RuntimeException(e);
+            }
+        }
+        return returnLinkedSet;
+    }
+
+    /**
+     * 将list中的元素放到Map<M, N>以建立 key - value 索引<p>
+     * modified from com.tqmall.saint.biz.util.EntityUtil#makeEntityMap(java.util.List, java.lang.String)
+     *
+     * @param collection     Collection<V> 元素列表
+     * @param keyFieldName   String 元素的属性名称, 该属性的值作为Map的key
+     * @param valueFieldName String 元素的属性名称, 该属性的值作为Map的value
+     * @param <M>            key类型
+     * @param <N>            value类型
+     * @param <V>            列表元素类型
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <M, N, V> Map<M, N> makeMapWithKeyValue(Collection<V> collection, String keyFieldName, String valueFieldName) {
+        Map<M, N> map = new HashMap<>();
+        if (collection == null || collection.isEmpty()) {
+            return map;
+        }
+        Iterator<V> it = collection.iterator();
+        boolean isFirst = true;
+        Method keyGetter = null;
+        Method valueGetter = null;
+        try {
+            while (it.hasNext()) {
+                V o = it.next();
+                if (isFirst) {
+                    keyGetter = getMethod(o.getClass(), keyFieldName, "get");
+                    valueGetter = getMethod(o.getClass(), valueFieldName, "get");
+                    isFirst = false;
+                }
+                map.put((M) keyGetter.invoke(o), (N) valueGetter.invoke(o));
+            }
+        } catch (Exception e) {
+            log.error("makeEntityMap error list is " + collection, e);
+            return map;
+        }
+        return map;
+    }
+
+    /**
+     * 将list中的元素放到Map<K, V>以建立 key - value 索引<p>
+     *
+     * @param list         List<V> 元素列表
+     * @param keyFieldName String 元素的属性名称, 该属性的值作为索引key
+     * @param <K>          key类型
+     * @param <V>          value类型
+     * @return Map<K   ,       V> key - value 索引
+     */
+    @SuppressWarnings("unchecked")
+    public static <K, V> Map<K, V> makeEntityMap(List<V> list, String keyFieldName) {
+        Map<K, V> map = new HashMap<>();
+        if (list == null || list.size() == 0) {
+            return map;
+        }
+        try {
+            Method getter = getMethod(list.get(0).getClass(), keyFieldName, "get");
+            for (V item : list) {
+                map.put((K) getter.invoke(item), item);
+            }
+        } catch (Exception e) {
+            log.error("makeEntityMap error list is " + list, e);
+            return map;
+        }
+        return map;
+    }
+
+    /**
+     * 将list中的元素放到Map<String, V>以建立 key - value 索引<p>
+     *
+     * @param list          List<V> 元素列表
+     * @param splitVar      属性之间间隔
+     * @param keyFieldNames String 元素的属性名称动态数组, 依次循环该属性的值作为索引key
+     * @param <V>           value类型
+     * @return Map<String   ,       V> key - value 索引
+     */
+
+    @SuppressWarnings("unchecked")
+    public static <V> Map<String, V> makeEntityMapByKeys(List<V> list, String splitVar, String... keyFieldNames) {
+        Map<String, V> map = new HashMap<>();
+        if (list == null || list.size() == 0 || keyFieldNames == null || keyFieldNames.length == 0 || StrUtil.isEmpty(splitVar)) {
+            return map;
+        }
+        try {
+            List<Method> getterList = new ArrayList<>();
+            for (String key : keyFieldNames) {
+                getterList.add(getMethod(list.get(0).getClass(), key, "get"));
+            }
+            for (V item : list) {
+                StringBuffer keys = new StringBuffer("");
+                for (int i = 0; i < getterList.size(); i++) {
+                    keys.append(getterList.get(i).invoke(item));
+                    if (i < getterList.size() - 1) {
+                        keys.append(splitVar);
+                    }
+                }
+                map.put(keys.toString(), item);
+            }
+        } catch (Exception e) {
+            log.error("makeEntityMap error list is " + list, e);
+            return map;
+        }
+        return map;
+    }
+
+    /**
+     * 将list中的元素放到Map<K, List<V>> 以建立 key - List<value> 索引<p>
+     *
+     * @param list         List<V> 元素列表
+     * @param keyFieldName String 元素的属性名称, 该属性的值作为索引key
+     * @param <K>          key类型
+     * @param <V>          value类型
+     * @return Map<K   ,       V> key - value 索引
+     */
+    public static <K, V> Map<K, List<V>> makeEntityListMap(List<V> list, String keyFieldName) {
+        Map<K, List<V>> map = new LinkedHashMap<>();
+        if (list == null || list.size() == 0) {
+            return map;
+        }
+        try {
+            Method getter = getMethod(list.get(0).getClass(), keyFieldName, "get");
+            for (V item : list) {
+                @SuppressWarnings("unchecked")
+                K key = (K) getter.invoke(item);
+                List<V> groupList = map.get(key);
+                if (groupList == null) {
+                    groupList = new ArrayList<>();
+                    map.put(key, groupList);
+                }
+                groupList.add(item);
+            }
+        } catch (Exception e) {
+            log.error("makeEntityListMap error list is " + list, e);
+            return map;
+        }
+        return map;
+    }
+
+    /**
+     * 获取getter或setter
+     */
+    @SuppressWarnings("unchecked")
+    private static Method getMethod(@SuppressWarnings("rawtypes") Class clazz, String fieldName,
+                                    String methodPrefix) throws NoSuchMethodException {
+        String first = fieldName.substring(0, 1);
+        String getterName = methodPrefix + fieldName.replaceFirst(first, first.toUpperCase());
+        return clazz.getMethod(getterName);
+    }
+
+    /**
+     * 比较两个对象改变了的属性值,然后以string拼接返回
+     *
+     * @param oldObj 对象1
+     * @param newObj 对象2
+     * @return 改变的属性值拼接的字符串
+     */
+    public static <T> String compareToObjProperty(T oldObj, T newObj) {
+        String modifiedStr = "";
+        Field[] fields = oldObj.getClass().getDeclaredFields();
+        for (Field field : fields) {
+            try {
+                if (!Modifier.isStatic(field.getModifiers())) {
+                    String tempFieldType = field.getType().getName();
+                    Method tempMethod = getMethod(oldObj.getClass(), field.getName(), "get");
+                    if (field.getName().equals("ATTRIBUTE_ORDER_SN")) {
+                        System.out.println("aa");
+                    }
+                    if (tempMethod != null) {
+                        Object tempOld = tempMethod.invoke(oldObj);
+                        Object tempNew = tempMethod.invoke(newObj);
+                        if (findDifference(tempOld, tempNew)) {
+                            if (tempFieldType.equals("java.util.Date")) {
+                                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd mm:HH:ss");
+                                modifiedStr += field.getName() + "[" + (tempOld == null ? null : sdf.format(tempOld)) + "," +
+                                        (tempNew == null ? null : sdf.format(tempNew)) + "],";
+                            } else {
+                                modifiedStr += field.getName() + "[" + tempOld + "," + tempNew + "],";
+                            }
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                log.error("compareTo error", e);
+            }
+        }
+        return modifiedStr;
+    }
+
+    /**
+     * 获取所有field,不包含field,修改自FieldUtils的getAllFieldsList方法
+     *
+     * @param cls         类
+     * @param forceAccess 是否包含private的field
+     * @return
+     */
+    private static List<Field> getFieldsList(Class<?> cls, final boolean forceAccess) {
+        Validate.isTrue(cls != null, "The class must not be null");
+        final List<Field> allFields = new ArrayList<Field>();
+        Class<?> currentClass = cls;
+        final Field[] declaredFields = currentClass.getDeclaredFields();
+        for (Field field : declaredFields) {
+            if (!Modifier.isPublic(field.getModifiers())) {
+                if (forceAccess) {
+                    field.setAccessible(true);
+                } else {
+                    continue;
+                }
+            }
+            allFields.add(field);
+        }
+        return allFields;
+    }
+
+    /**
+     * 获取所有field,包含所有父类,来自FieldUtils的getAllFieldsList方法
+     *
+     * @param cls         类
+     * @param forceAccess 是否包含private的field
+     * @return
+     */
+    private static List<Field> getAllFieldsList(Class<?> cls, final boolean forceAccess) {
+        Validate.isTrue(cls != null, "The class must not be null");
+        final List<Field> allFields = new ArrayList<Field>();
+        Class<?> currentClass = cls;
+        while (currentClass != null) {
+            final Field[] declaredFields = currentClass.getDeclaredFields();
+            for (Field field : declaredFields) {
+                if (!Modifier.isPublic(field.getModifiers())) {
+                    if (forceAccess) {
+                        field.setAccessible(true);
+                    } else {
+                        continue;
+                    }
+                }
+                allFields.add(field);
+            }
+            currentClass = currentClass.getSuperclass();
+        }
+        return allFields;
+    }
+
+    /**
+     * 获取类型的field
+     *
+     * @param cls         类型
+     * @param checkSupers 是否要获取父类的field
+     * @param forceAccess 是否包含private的field
+     * @return
+     */
+    private static List<Field> getFieldsList(Class<?> cls, final boolean checkSupers, final boolean forceAccess) {
+        if (checkSupers) {
+            return getAllFieldsList(cls, forceAccess);
+        } else {
+            return getFieldsList(cls, forceAccess);
+        }
+    }
+
+    /**
+     * 比较两个对象改变了的属性值,然后以string拼接返回
+     *
+     * @param oldObj      对象1
+     * @param newObj      对象2
+     * @param formatter   格式(默认为%s[%s,%s],第一个%s对应fieldname,第二个%对应对象1的fieldname的值,第三个%s对应对象2的fieldname的值)
+     * @param checkSupers 是否需要比较所有父类(无视继承的接口)
+     * @param forceAccess 是否需要比较private成员变量
+     * @param <T>         要比较的对象类型
+     * @return
+     */
+    public static <T> String compareToObjProperty(T oldObj, T newObj, String formatter, final boolean checkSupers, final boolean forceAccess) {
+        StringBuilder builder = new StringBuilder();
+        if (oldObj == newObj) {
+            return builder.toString();
+        }
+        if (StringUtils.isEmpty(formatter)) {
+            formatter = "%s[%s,%s]";
+        }
+        List<Field> fields = getFieldsList(oldObj.getClass(), checkSupers, forceAccess);
+        for (Field field : fields) {
+            try {
+                Object tmpOld = field.get(oldObj);
+                Object tmpNew = field.get(newObj);
+                if (findDifference(tmpOld, tmpNew)) {
+                    if (field.getType().getName().equals(DATE_CLASS_NAME)) {
+                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd mm:HH:ss");
+                        String strOld = tmpOld == null ? null : sdf.format(tmpOld);
+                        String strNew = tmpNew == null ? null : sdf.format(tmpNew);
+                        builder.append(String.format(formatter, field.getName(), strOld, strNew));
+                        builder.append(",");
+                    } else {
+                        builder.append(String.format(formatter, field.getName(), tmpOld, tmpNew));
+                        builder.append(",");
+                    }
+                }
+            } catch (Exception e) {
+                log.error("compareTo error", e);
+            }
+        }
+        return builder.toString();
+    }
+
+    /**
+     * 比较两个对象的值是否不同
+     *
+     * @param obj1 对象1
+     * @param obj2 对象2
+     * @param <T>  object
+     * @return 若俩对象的值不相同则为true,反之为false
+     */
+    public static <T> Boolean findDifference(T obj1, T obj2) {
+        if (obj1 == null && obj2 == null) {
+            return false;
+        }
+        if (obj1 == null || obj2 == null) {
+            return true;
+        }
+        if (obj1 instanceof BigDecimal) {
+            return ((BigDecimal) obj1).compareTo((BigDecimal) obj2) != 0;
+        } else {
+            return !obj1.equals(obj2);
+        }
+    }
+
+    public static <V, K> Map<V, K> makeEntityMapNew(List<Map<String, Object>> hashMap, String keyFieldName) {
+        Map<V, K> map = new HashMap<>();
+        if (hashMap == null || hashMap.size() == 0) {
+            return map;
+        }
+        try {
+            for (Map linkedHashMap : hashMap) {
+                map.put((V) linkedHashMap.get(keyFieldName).toString(), (K) linkedHashMap);
+            }
+        } catch (Exception e) {
+            log.error("makeEntityListMap error list is " + hashMap, e);
+            return map;
+        }
+        return map;
+    }
+
+
+    public static Map<Integer, Map> makeEntityMapSpecial(List<Map> hashMap, String keyFieldName) {
+        Map<Integer, Map> map = new HashMap<>();
+        if (hashMap == null || hashMap.size() == 0) {
+            return map;
+        }
+        try {
+            for (Map linkedHashMap : hashMap) {
+                map.put(Integer.valueOf(linkedHashMap.get(keyFieldName).toString()), linkedHashMap);
+            }
+        } catch (Exception e) {
+            log.error("makeEntityListMap error list is " + hashMap, e);
+            return map;
+        }
+        return map;
+    }
+
+    /**
+     * 以Map<key, V> 形式返回,如果key相同,会覆盖前面的内容
+     *
+     * @param list          列表
+     * @param splitSmybool  key分隔符
+     * @param multiProperty 多个属性
+     * @param <V>
+     * @return
+     */
+    public static <V> List<V> getNoRepeatList(List<V> list, String splitSmybool, String dateProperty, String... multiProperty) {
+        List<V> res = new ArrayList<>();
+        Map<String, V> multiKeyObject = getMultiKeyObject(list, splitSmybool, dateProperty, multiProperty);
+        if (multiKeyObject != null && !multiKeyObject.isEmpty()) {
+            for (String key : multiKeyObject.keySet()) {
+                res.add(multiKeyObject.get(key));
+            }
+        }
+        return res;
+    }
+
+    /**
+     * 以Map<key, V> 形式返回,如果key相同,根据时间排序,后面时间覆盖前面时间
+     *
+     * @param list          列表
+     * @param splitSmybool  key分隔符
+     * @param dateProperty  时间属性
+     * @param multiProperty 多个属性
+     * @param <V>
+     * @return
+     */
+    public static <V> Map<String, V> getMultiKeyObject(List<V> list, String splitSmybool, String dateProperty, String... multiProperty) {
+        if (CollUtil.isEmpty(list)) {
+            return new LinkedHashMap<>();
+        }
+        return list.stream().collect(Collectors.toMap(k -> {
+            List<String> keyList = new ArrayList<>();
+            for (String property : multiProperty) {
+                keyList.add(getProperty(k, property));
+            }
+            return StringUtils.join(keyList, splitSmybool);
+        }, v -> v, (v1, v2) -> {
+            String date1 = getProperty(v1, dateProperty);
+            if (StrUtil.isBlank(date1)) {
+                return v2;
+            }
+            String date2 = getProperty(v2, dateProperty);
+            if (StrUtil.isBlank(date2)) {
+                return v1;
+            }
+            int flag = compareTime(date1, date2);
+            if (flag == 0) {
+                return v1;
+            } else {
+                return v2;
+            }
+        }, LinkedHashMap::new));
+    }
+
+    /**
+     * 获取对象的属性值,直接使用getDeclaredFields()方法只能获取当前类声明的字段,需要递归向上获取
+     *
+     * @param object    : 子类对象
+     * @param fieldName : 父类中的属性名
+     * @return : 父类中的属性值
+     */
+    public static <T> T getProperty(Object object, String fieldName) {
+        try {
+            //根据 对象和属性名通过反射获取Field对象
+            Field field = getDeclaredField(object, fieldName);
+            // 容错处理
+            if (field == null) {
+                return null;
+            }
+            //抑制Java对其的检查
+            field.setAccessible(true);
+            //获取 object 中 field 所代表的属性值
+            return (T) field.get(object);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 对象赋值
+     *
+     * @param object
+     * @param property
+     * @param value
+     */
+    public static void setProperty(Object object, String property, Object value) {
+        //根据 对象和属性名通过反射 调用上面的方法获取 Field对象
+        Field field = getDeclaredField(object, property);
+        //抑制Java对其的检查
+        field.setAccessible(true);
+        try {
+            field.set(object, value);
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 循环向上转型, 获取对象的 DeclaredField
+     *
+     * @param object    : 子类对象
+     * @param fieldName : 父类中的属性名
+     * @return 父类中的属性对象
+     */
+    public static Field getDeclaredField(Object object, String fieldName) {
+        Field field = null;
+        Class<?> clazz = object.getClass();
+        for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
+            try {
+                field = clazz.getDeclaredField(fieldName);
+                return field;
+            } catch (Exception e) {
+                //这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
+                //如果这里的异常打印或者往外抛,则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 比较时间,endDateStr >= startDateStr
+     * @param startDateStr
+     * @param endDateStr
+     * @return -1:无法比较或出错,0:endDateStr < startDateStr,1:endDateStr >= startDateStr
+     */
+    public static int compareTime(String startDateStr, String endDateStr) {
+        int flag = -1;
+        if (StrUtil.isBlank(startDateStr) || StrUtil.isBlank(endDateStr)) {
+            return flag;
+        }
+        try {
+            Date startDate = parseStringDate(startDateStr);
+            Date endDate = parseStringDate(endDateStr);
+            Long timeStart = startDate.getTime();
+            Long timeEnd = endDate.getTime();
+            if (timeEnd >= timeStart) {
+                flag = 1;
+            } else {
+                flag = 0;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return flag;
+    }
+
+    /**
+     * 解析时间
+     *
+     * @param datetime
+     * @return
+     */
+    public static Date parseStringDate(String datetime) {
+        if (StrUtil.isBlank(datetime)) {
+            return null;
+        }
+        Date date = null;
+        try {
+            datetime = remove_ctl(datetime);
+
+            if (datetime.contains("至")) {
+                datetime = datetime.split("至")[1].replaceAll("[\\u4e00-\\u9fa5]", "");
+            }
+
+            if (datetime.length() > 0) {
+                date = DateUtils.parseDate(datetime, dateFormats);
+            }
+        } catch (ParseException ex) {
+            ex.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * 删除字符串中的换行和控制字符
+     *
+     * @param str
+     */
+    public static String remove_ctl(String str) {
+        String trim = "";
+        if (StringUtils.isNotEmpty(str)) {
+            trim = str.replaceAll("\r|\n|\r\n", "").trim();
+        }
+        return trim;
+    }
+
+}

+ 23 - 0
src/main/java/com/qizhen/healsphere/vo/KgQueryVO.java

@@ -0,0 +1,23 @@
+package com.qizhen.healsphere.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/16 9:47
+ */
+@Getter
+@Setter
+public class KgQueryVO {
+    @ApiModelProperty(value = "标签名")
+    @NotBlank(message = "标签名不能为空")
+    private String labelName;
+    @ApiModelProperty(value = "搜索内容")
+    @NotBlank(message = "搜索内容不能为空")
+    private String inputStr;
+}

+ 23 - 0
src/main/java/com/qizhen/healsphere/vo/KgTreeVO.java

@@ -0,0 +1,23 @@
+package com.qizhen.healsphere.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/3/17 9:00
+ */
+@Getter
+@Setter
+public class KgTreeVO {
+    @ApiModelProperty(value = "类型")
+    @NotNull(message = "类型不能为空")
+    private Integer type;
+    @ApiModelProperty(value = "子类型 默认:0")
+    @NotNull(message = "子类型不能为空")
+    private Integer subType;
+}

+ 58 - 0
src/main/java/com/qizhen/healsphere/web/demo/KgController.java

@@ -0,0 +1,58 @@
+package com.qizhen.healsphere.web.demo;
+
+import com.qizhen.healsphere.dto.GraphLabelDTO;
+import com.qizhen.healsphere.dto.RespDTO;
+import com.qizhen.healsphere.dto.TreeDTO;
+import com.qizhen.healsphere.facade.KgFacade;
+import com.qizhen.healsphere.vo.KgQueryVO;
+import com.qizhen.healsphere.vo.KgTreeVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description: 朗通知识图谱控制层
+ * @author: gaodm
+ * @time: 2018/8/30 10:12
+ */
+@RestController
+@RequestMapping("/kg")
+@Api(value = "朗通知识图谱API", tags = { "朗通知识图谱API" })
+@SuppressWarnings("unchecked")
+@Slf4j
+public class KgController {
+    private static final String KGTREECACHE = "KgTreeCache";
+
+    @Autowired
+    private KgFacade kgFacade;
+
+    @ApiOperation(value = "获取图谱", notes = "获取图谱")
+    @PostMapping("/getGraph")
+    public RespDTO<GraphLabelDTO> getGraph(@RequestBody @Valid KgQueryVO kgQueryVO) {
+        return RespDTO.onSuc(kgFacade.getGraphFac(kgQueryVO));
+    }
+
+    @ApiOperation(value = "获取树形分类",
+            notes = "获取树形分类(疾病ICD10:t:1,st:1)<br>" +
+                    "(疾病科室:t:1,st:2)<br>" +
+                    "(药品:t:2,st:0)<br>" +
+                    "(症状:t:3,st:0)<br>" +
+                    "(手术和操作:t:4,st:0)<br>" +
+                    "(实验室检查:t:5,st:0)<br>" +
+                    "(辅助检查:t:6,st:0)<br>")
+    @PostMapping("/getTree")
+    @Cacheable(value = KGTREECACHE, key = "'kgtree:t_' + #kgTreeVO.type + '_st_' + #kgTreeVO.subType")
+    public RespDTO<TreeDTO> getTree(@RequestBody @Valid KgTreeVO kgTreeVO) {
+        log.info("获取树形分类缓存成功");
+        return RespDTO.onSuc(kgFacade.getTreeFac(kgTreeVO));
+    }
+}
+

+ 58 - 0
src/main/resources/application.yml

@@ -2,9 +2,67 @@ server:
   port: 8080
   max-http-header-size: 10MB
 
+
 swagger:
   enable: true
 
+
+spring:
+  datasource:
+    dynamic:
+      primary: neo4j
+      # 数据库配置
+      datasource:
+        neo4j:
+          driver-class-name: org.neo4j.jdbc.Driver
+          url: jdbc:neo4j:http://173.18.12.194:7474
+          username: neo4j
+          password: 12345678
+        mysql:
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: jdbc:mysql://173.18.12.194:3306/sys-ltkg?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+          username: root
+          password: dsYun8!@#
+  neo4j:
+    uri: bolt://172.16.8.59:7687
+    authentication:
+      username: neo4j
+      password: 1Qaz@wsx
+
+#mybatis
+mybatis:
+  type-aliases-package: com.qizhen.healsphere.entity
+  mapper-locations: classpath:mapper/*.xml
+
+#mybatis-plus
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.qizhen.healsphere.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
 springfox:
   documentation:
     enabled: true

+ 27 - 0
src/main/resources/mapper/KgMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qizhen.healsphere.mapper.KgMapper">
+
+    <resultMap id="GraphResultMap" type="com.qizhen.healsphere.dto.GraphDTO">
+        <result column="sName" property="name"/>
+        <result column="sLabel" property="label"/>
+        <collection property="eNodeRSDTOS" ofType="com.qizhen.healsphere.dto.BaseNodeRSDTO">
+            <result column="rType" property="rType"/>
+            <collection property="eNodeDTOS" ofType="com.qizhen.healsphere.dto.NextNodeDTO">
+                <result column="eName" property="name"/>
+                <result column="eLabel" property="label"/>
+                <result column="pCount" property="pCount"/>
+            </collection>
+        </collection>
+    </resultMap>
+
+    <select id="getGraph" parameterType='com.qizhen.healsphere.vo.KgQueryVO' resultMap="GraphResultMap">
+        MATCH (n:${labelName})-[r]->(m)
+        where n.name = #{inputStr}
+        OPTIONAL MATCH p=(m)-[]->(o) where head(Labels(m)) in ["疾病","症状","药品通用名","手术和操作","实验室检查","辅助检查"]
+        RETURN head(Labels(n)) as sLabel,n.name as sName,Type (r) as rType, head(Labels(m)) as eLabel,m.name as eName, count(p) as pCount
+        ORDER BY rType
+    </select>
+
+</mapper>

+ 19 - 0
src/main/resources/mapper/PresetInfoMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qizhen.healsphere.mapper.PresetInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.qizhen.healsphere.entity.PresetInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="type" property="type" />
+        <result column="title" property="title" />
+        <result column="content" property="content" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 383 - 0
src/test/java/com/qizhen/healsphere/DiseaseTests.java

@@ -0,0 +1,383 @@
+package com.qizhen.healsphere;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.qizhen.healsphere.model.*;
+import com.qizhen.healsphere.repository.*;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.stereotype.Component;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+@RunWith(SpringRunner.class)
+@ComponentScan(basePackages = {"com.qizhen.healsphere.model","com.qizhen.healsphere.repository"})
+@SpringBootTest
+public class DiseaseTests {
+    @Autowired(required = false)
+    DiseaseRepository diseaseRepository;
+    @Autowired(required = false)
+    ZbyyRepository zbyyRepository;
+    @Autowired(required = false)
+    ZczzbfbzRepository zczzbfbzRepository;
+    @Autowired(required = false)
+    ZdbzRepository zdbzRepository;
+    @Autowired(required = false)
+    ZdxgjcRepository zdxgjcRepository;
+    @Autowired(required = false)
+    ZlcsRepository zlcsRepository;
+    @Autowired(required = false)
+    ZlczRepository zlczRepository;
+    @Autowired(required = false)
+    ZlfaRepository zlfaRepository;
+    @Autowired(required = false)
+    ZlfsRepository zlfsRepository;
+    @Autowired(required = false)
+    ZlmbRepository zlmbRepository;
+    @Autowired(required = false)
+    ZlqxRepository zlqxRepository;
+    @Autowired(required = false)
+    ZlRepository zlRepository;
+    @Autowired(required = false)
+    ZlxgjcRepository zlxgjcRepository;
+    @Autowired(required = false)
+    ZlyjRepository zlyjRepository;
+    @Autowired(required = false)
+    ZlywRepository zlywRepository;
+    @Autowired(required = false)
+    ZlyzRepository zlyzRepository;
+    @Autowired(required = false)
+    ZzRepository zzRepository;
+
+
+    @Test
+    public void contextLoads() {}
+
+    @Test
+    public void testSaveDiseaseFromExcel() {
+
+        String urlExcelPath = "D:\\neo4j需要处理的数据\\心血管科.xlsx"; // 包含URL的Excel文件路径
+        // 读取URL并检查文章内容
+        try (InputStream urlInputStream = Files.newInputStream(Paths.get(urlExcelPath))) {
+            Workbook urlWorkbook = new XSSFWorkbook(urlInputStream);
+            Sheet urlSheet = urlWorkbook.getSheetAt(0);
+
+            // 创建新列来存储包含的疾病名称和ID
+            for (int rowNum = 1; rowNum <= urlSheet.getLastRowNum(); rowNum++) {
+//                if (rowNum != 17){
+//                    continue;
+//                }
+                Row row = urlSheet.getRow(rowNum);
+                String diseaseName = row.getCell(0).getStringCellValue().trim();
+
+                String propertyName = row.getCell(1).getStringCellValue().trim();
+                String propertyValue = row.getCell(2).getStringCellValue().replace("\\","").trim();
+                String icd10Value = row.getCell(4).getStringCellValue().trim();
+
+                try {
+                    JSONArray jsonArray = new JSONArray(icd10Value);
+                    JSONObject icd10Obj = JSONUtil.parseObj(jsonArray.get(0));
+
+                    Disease disease = diseaseRepository.findByName(diseaseName);
+                    if (disease == null) {
+                        disease = new Disease(diseaseName,icd10Obj.getStr("code"));
+                    }
+
+                    if ("诊疗操作".equals(propertyName)) {
+                        Set<Zlcz> zlczSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlczObj = JSONUtil.parseObj(object);
+                            Zlcz zlcz = new Zlcz(zlczObj.getStr("name"),zlczObj.getStr("description"));
+                            zlczSet.add(zlcz);
+                            disease.addZlcz(zlcz);
+                        }
+                        zlczRepository.saveAll(zlczSet);
+                    }
+
+                    if ("治疗方案".equals(propertyName)) {
+                        Set<Zlfa> zlfaSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlfaObj = JSONUtil.parseObj(object);
+                            Zlfa zlfa = new Zlfa(zlfaObj.getStr("name"),zlfaObj.getStr("description"));
+                            zlfaSet.add(zlfa);
+                            disease.addZlfa(zlfa);
+                        }
+                        zlfaRepository.saveAll(zlfaSet);
+                    }
+
+                    if ("诊断标准".equals(propertyName)) {
+                        Set<Zdbz> zdbzSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zdbzObj = JSONUtil.parseObj(object);
+                            Zdbz zdbz = new Zdbz(zdbzObj.getStr("name"),zdbzObj.getStr("description"));
+                            zdbzSet.add(zdbz);
+                            disease.addZdbz(zdbz);
+                        }
+                        zdbzRepository.saveAll(zdbzSet);
+                    }
+
+                    if ("治疗目标".equals(propertyName)) {
+                        Set<Zlmb> zlmbSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlmbObj = JSONUtil.parseObj(object);
+                            Zlmb zlmb = new Zlmb(zlmbObj.getStr("name"),zlmbObj.getStr("description"));
+                            zlmbSet.add(zlmb);
+                            disease.addZlmb(zlmb);
+                        }
+                        zlmbRepository.saveAll(zlmbSet);
+                    }
+
+                    if ("治疗方式".equals(propertyName)) {
+                        Set<Zlfs> zlfsSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlfsObj = JSONUtil.parseObj(object);
+                            Zlfs zlfs = new Zlfs(zlfsObj.getStr("name"),zlfsObj.getStr("description"));
+                            zlfsSet.add(zlfs);
+                            disease.addZlfs(zlfs);
+                        }
+                        zlfsRepository.saveAll(zlfsSet);
+                    }
+
+                    if ("治疗相关检查".equals(propertyName)) {
+                        Set<Zlxgjc> zlxhjcSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlxgjcObj = JSONUtil.parseObj(object);
+                            Zlxgjc zlxgjc = new Zlxgjc(zlxgjcObj.getStr("name"),zlxgjcObj.getStr("description"));
+                            zlxhjcSet.add(zlxgjc);
+                            disease.addZlxgjc(zlxgjc);
+                        }
+                        zlxgjcRepository.saveAll(zlxhjcSet);
+                    }
+
+                    if ("致病原因".equals(propertyName)) {
+                        Set<Zbyy> zbyySet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zbyyObj = JSONUtil.parseObj(object);
+                            Zbyy zbyy = new Zbyy(zbyyObj.getStr("name"),zbyyObj.getStr("description"));
+                            zbyySet.add(zbyy);
+                            disease.addZbyy(zbyy);
+                        }
+                        zbyyRepository.saveAll(zbyySet);
+                    }
+
+                    if ("治疗原则".equals(propertyName)) {
+                        Set<Zlyz> zlyzSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlyzObj = JSONUtil.parseObj(object);
+                            Zlyz zlyz = new Zlyz(zlyzObj.getStr("name"),zlyzObj.getStr("description"));
+                            zlyzSet.add(zlyz);
+                            disease.addZlyz(zlyz);
+                        }
+                        zlyzRepository.saveAll(zlyzSet);
+                    }
+
+                    if ("诊疗依据".equals(propertyName)) {
+                        Set<Zlyj> zlyjSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlyjObj = JSONUtil.parseObj(object);
+                            Zlyj zlyj = new Zlyj(zlyjObj.getStr("name"),zlyjObj.getStr("description"));
+                            zlyjSet.add(zlyj);
+                            disease.addZlyj(zlyj);
+                        }
+                        zlyjRepository.saveAll(zlyjSet);
+                    }
+
+                    if ("治疗场所".equals(propertyName)) {
+                        Set<Zlcs> zlcsSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlcsObj = JSONUtil.parseObj(object);
+                            Zlcs zlcs = new Zlcs(zlcsObj.getStr("name"),zlcsObj.getStr("description"));
+                            zlcsSet.add(zlcs);
+                            disease.addZlcs(zlcs);
+                        }
+                        zlcsRepository.saveAll(zlcsSet);
+                    }
+
+                    if ("子类".equals(propertyName)) {
+                        Set<Zl> zlSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlObj = JSONUtil.parseObj(object);
+                            Zl zl = new Zl(zlObj.getStr("name"),zlObj.getStr("description"));
+                            zlSet.add(zl);
+                            disease.addZl(zl);
+                        }
+                        zlRepository.saveAll(zlSet);
+                    }
+
+                    if ("治疗器械".equals(propertyName)) {
+                        Set<Zlqx> zlqxSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlqxObj = JSONUtil.parseObj(object);
+                            Zlqx zlqx = new Zlqx(zlqxObj.getStr("name"),zlqxObj.getStr("description"));
+                            zlqxSet.add(zlqx);
+                            disease.addZlqx(zlqx);
+                        }
+                        zlqxRepository.saveAll(zlqxSet);
+                    }
+
+                    if ("治疗药物".equals(propertyName)) {
+                        Set<Zlyw> zlywSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zlywObj = JSONUtil.parseObj(object);
+                            Zlyw zlyw = new Zlyw(zlywObj.getStr("name"),zlywObj.getStr("description"));
+                            zlywSet.add(zlyw);
+                            disease.addZlyw(zlyw);
+                        }
+                        zlywRepository.saveAll(zlywSet);
+                    }
+
+                    if ("转出重症病房标准".equals(propertyName)) {
+                        Set<Zczzbfbz> zczzbfbzSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zczzbfbzObj = JSONUtil.parseObj(object);
+                            Zczzbfbz zczzbfbz = new Zczzbfbz(zczzbfbzObj.getStr("name"),zczzbfbzObj.getStr("description"));
+                            zczzbfbzSet.add(zczzbfbz);
+                            disease.addZczzbfbz(zczzbfbz);
+                        }
+                        zczzbfbzRepository.saveAll(zczzbfbzSet);
+                    }
+
+                    if ("诊断相关检查".equals(propertyName)) {
+                        Set<Zdxgjc> zdxgjcSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zdxgjcObj = JSONUtil.parseObj(object);
+                            Zdxgjc zdxgjc = new Zdxgjc(zdxgjcObj.getStr("name"),zdxgjcObj.getStr("description"));
+                            zdxgjcSet.add(zdxgjc);
+                            disease.addZdxgjc(zdxgjc);
+                        }
+                        zdxgjcRepository.saveAll(zdxgjcSet);
+                    }
+
+                    if ("症状".equals(propertyName)) {
+                        Set<Zz> zzSet = new HashSet<>();
+                        JSONArray propertyArray = new JSONArray(propertyValue);
+                        for (Object object : propertyArray) {
+                            JSONObject zzObj = JSONUtil.parseObj(object);
+                            Zz zz = new Zz(zzObj.getStr("name"),zzObj.getStr("description"));
+                            zzSet.add(zz);
+                            disease.addZz(zz);
+                        }
+                        zzRepository.saveAll(zzSet);
+                    }
+                    diseaseRepository.save(disease);
+                }catch (Exception e){
+                    System.out.println("当前内容处理报错,行号:" + rowNum + ",diseaseName=" + diseaseName + ",propertyName="+propertyName+",propertyValue="+propertyValue+",icd10Value="+icd10Value);
+                    e.printStackTrace();
+                    continue;
+                }
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    @Test
+    public void deleteAll() {
+
+        // 调用各个Repository的deleteAll方法
+        diseaseRepository.deleteAll();
+        zbyyRepository.deleteAll();
+        zczzbfbzRepository.deleteAll();
+        zdbzRepository.deleteAll();
+        zdxgjcRepository.deleteAll();
+        zlcsRepository.deleteAll();
+        zlczRepository.deleteAll();
+        zlfaRepository.deleteAll();
+        zlfsRepository.deleteAll();
+        zlmbRepository.deleteAll();
+        zlqxRepository.deleteAll();
+        zlRepository.deleteAll();
+        zlxgjcRepository.deleteAll();
+        zlyjRepository.deleteAll();
+        zlywRepository.deleteAll();
+        zlyzRepository.deleteAll();
+        zzRepository.deleteAll();
+        System.out.println("所有数据删除成功!");
+
+
+    }
+
+
+    @Test
+    public void testSaveDisease() {
+
+        diseaseRepository.deleteAll();
+        Disease disease = new Disease("高血压","l10");
+
+        diseaseRepository.save(disease);
+
+    }
+
+    @Test
+    public void testSaveZz() {
+
+//        diseaseRepository.deleteAll();
+        Zz zz1 = new Zz("头晕","111");
+        Zz zz2 = new Zz("目眩","112");
+
+        zzRepository.save(zz1);
+        zzRepository.save(zz2);
+
+        Disease disease = diseaseRepository.findByName("高血压");
+        disease.addZz(zz1);
+        disease.addZz(zz2);
+        diseaseRepository.save(disease);
+
+    }
+
+    @Test
+    public void testSaveZdbz() {
+
+        Zdbz zz1 = new Zdbz("收缩压和舒张压标准","收缩压(高压)≥140mmHg,或舒张压(低压)≥90mmHg");
+        Zdbz zz2 = new Zdbz("药物影响","患者在服用降压药物后,虽然血压可能会降至正常范围,但仍应诊断为高血压");
+
+        zdbzRepository.save(zz1);
+        zdbzRepository.save(zz2);
+
+        Disease disease = diseaseRepository.findByName("高血压");
+        disease.addZdbz(zz1);
+        disease.addZdbz(zz2);
+        diseaseRepository.save(disease);
+
+    }
+
+    @Test
+    public void testFindDisease() {
+        Disease disease = diseaseRepository.findByName("高血压");
+        System.out.println(JSONUtil.toJsonStr(disease));
+
+    }
+
+}
+