Browse Source

fix bug:解决拓扑图草稿保存丢失问题

lijie 2 years ago
parent
commit
c75b578a5f
80 changed files with 2092 additions and 55 deletions
  1. 1 18
      .idea/compiler.xml
  2. 0 30
      .idea/gradle.xml
  3. 2 1
      .idea/misc.xml
  4. 4 0
      gradle.properties
  5. 5 0
      labsl/build.gradle
  6. 1 3
      labsl/src/main/kotlin/com/persagy/labsl/LaBSLApp.kt
  7. 59 0
      labsl/src/main/kotlin/com/persagy/labsl/config/MybatisPlusConfig.kt
  8. 4 1
      labsl/src/main/kotlin/com/persagy/labsl/controller/GraphController.kt
  9. 73 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/AnchorEntity.kt
  10. 71 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/AnchorPubEntity.kt
  11. 61 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/AttachObjectIdsEntity.kt
  12. 61 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/AttachObjectIdsPubEntity.kt
  13. 47 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/GraphCategoryEntity.kt
  14. 52 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/GraphCategoryEquipEntity.kt
  15. 125 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/GraphEntity.kt
  16. 120 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/GraphPubEntity.kt
  17. 96 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/MarkerEntity.kt
  18. 96 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/MarkerPubEntity.kt
  19. 116 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/NodeEntity.kt
  20. 116 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/NodePubEntity.kt
  21. 111 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/RelationEntity.kt
  22. 111 0
      labsl/src/main/kotlin/com/persagy/labsl/domain/RelationPubEntity.kt
  23. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/AnchorMapper.kt
  24. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/AnchorPubMapper.kt
  25. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/AttachObjectIdsMapper.kt
  26. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/AttachObjectIdsPubMapper.kt
  27. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphCategoryEquipMapper.kt
  28. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphCategoryMapper.kt
  29. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphMapper.kt
  30. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphPubMapper.kt
  31. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/MarkerMapper.kt
  32. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/MarkerPubMapper.kt
  33. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/NodeMapper.kt
  34. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/NodePubMapper.kt
  35. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/RelationMapper.kt
  36. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/mapper/RelationPubMapper.kt
  37. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/AnchorPubService.kt
  38. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/AnchorService.kt
  39. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/AttachObjectIdsPubService.kt
  40. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/AttachObjectIdsService.kt
  41. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/GraphCategoryEquipService.kt
  42. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/GraphCategoryService.kt
  43. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/GraphPubService.kt
  44. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/GraphService.kt
  45. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/MarkerPubService.kt
  46. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/MarkerService.kt
  47. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/NodePubService.kt
  48. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/NodeService.kt
  49. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/RelationPubService.kt
  50. 9 0
      labsl/src/main/kotlin/com/persagy/labsl/service/RelationService.kt
  51. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/AnchorPubServiceImpl.kt
  52. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/AnchorServiceImpl.kt
  53. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/AttachObjectIdsPubServiceImpl.kt
  54. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/AttachObjectIdsServiceImpl.kt
  55. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphCategoryEquipServiceImpl.kt
  56. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphCategoryServiceImpl.kt
  57. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphPubServiceImpl.kt
  58. 216 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphServiceImpl.kt
  59. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/MarkerPubServiceImpl.kt
  60. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/MarkerServiceImpl.kt
  61. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/NodePubServiceImpl.kt
  62. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/NodeServiceImpl.kt
  63. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/RelationPubServiceImpl.kt
  64. 13 0
      labsl/src/main/kotlin/com/persagy/labsl/service/impl/RelationServiceImpl.kt
  65. 0 1
      labsl/src/main/kotlin/com/persagy/labsl/services/GraphService.kt
  66. 21 1
      labsl/src/main/resources/application.yml
  67. 7 0
      labsl/src/main/resources/mapper/AnchorMapper.xml
  68. 7 0
      labsl/src/main/resources/mapper/AnchorPubMapper.xml
  69. 7 0
      labsl/src/main/resources/mapper/AttachObjectIdsMapper.xml
  70. 7 0
      labsl/src/main/resources/mapper/AttachObjectIdsPubMapper.xml
  71. 7 0
      labsl/src/main/resources/mapper/GraphCategoryEquipMapper.xml
  72. 7 0
      labsl/src/main/resources/mapper/GraphCategoryMapper.xml
  73. 7 0
      labsl/src/main/resources/mapper/GraphMapper.xml
  74. 7 0
      labsl/src/main/resources/mapper/GraphPubMapper.xml
  75. 7 0
      labsl/src/main/resources/mapper/MarkerMapper.xml
  76. 7 0
      labsl/src/main/resources/mapper/MarkerPubMapper.xml
  77. 7 0
      labsl/src/main/resources/mapper/NodeMapper.xml
  78. 7 0
      labsl/src/main/resources/mapper/NodePubMapper.xml
  79. 7 0
      labsl/src/main/resources/mapper/RelationMapper.xml
  80. 7 0
      labsl/src/main/resources/mapper/RelationPubMapper.xml

+ 1 - 18
.idea/compiler.xml

@@ -4,23 +4,6 @@
     <annotationProcessing>
       <profile default="true" name="Default" enabled="true" />
     </annotationProcessing>
-    <bytecodeTargetLevel target="1.8">
-      <module name="adm-backgroud.data-core.main" target="1.8" />
-      <module name="adm-backgroud.data-core.test" target="1.8" />
-      <module name="adm-backgroud.labsl.main" target="1.8" />
-      <module name="adm-backgroud.labsl.test" target="1.8" />
-      <module name="adm-backgroud.meiku.main" target="1.8" />
-      <module name="adm-backgroud.meiku.test" target="1.8" />
-      <module name="adm-backgroud.message-center.main" target="1.8" />
-      <module name="adm-backgroud.message-center.test" target="1.8" />
-      <module name="adm-backgroud.old-data-core.main" target="1.8" />
-      <module name="adm-backgroud.old-data-core.test" target="1.8" />
-      <module name="adm-backgroud.revit-algorithm.main" target="1.8" />
-      <module name="adm-backgroud.revit-algorithm.test" target="1.8" />
-      <module name="adm-backgroud.scanbuilding.main" target="1.8" />
-      <module name="adm-backgroud.scanbuilding.test" target="1.8" />
-      <module name="adm-backgroud.scheduler.main" target="1.8" />
-      <module name="adm-backgroud.scheduler.test" target="1.8" />
-    </bytecodeTargetLevel>
+    <bytecodeTargetLevel target="1.8" />
   </component>
 </project>

+ 0 - 30
.idea/gradle.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="GradleMigrationSettings" migrationVersion="1" />
-  <component name="GradleSettings">
-    <option name="linkedExternalProjectsSettings">
-      <GradleProjectSettings>
-        <option name="delegatedBuild" value="false" />
-        <option name="testRunner" value="PLATFORM" />
-        <option name="distributionType" value="WRAPPED" />
-        <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="gradleJvm" value="1.8" />
-        <option name="modules">
-          <set>
-            <option value="$PROJECT_DIR$" />
-            <option value="$PROJECT_DIR$/data-core" />
-            <option value="$PROJECT_DIR$/labsl" />
-            <option value="$PROJECT_DIR$/meiku" />
-            <option value="$PROJECT_DIR$/message-center" />
-            <option value="$PROJECT_DIR$/old-data-core" />
-            <option value="$PROJECT_DIR$/revit-algorithm" />
-            <option value="$PROJECT_DIR$/scanbuilding" />
-            <option value="$PROJECT_DIR$/scheduler" />
-          </set>
-        </option>
-        <option name="useAutoImport" value="true" />
-        <option name="useQualifiedModuleNames" value="true" />
-      </GradleProjectSettings>
-    </option>
-  </component>
-</project>

+ 2 - 1
.idea/misc.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
   <component name="FrameworkDetectionExcludesConfiguration">
     <file type="web" url="file://$PROJECT_DIR$" />
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>
 </project>

+ 4 - 0
gradle.properties

@@ -67,6 +67,10 @@ MYSQL_VERSION=8.0.12
 FAST_JSON_VERSION=1.2.75
 # https://mvnrepository.com/artifact/com.alibaba/fastjson
 MYBATIS_CORE_VERSION=3.5.6
+# mybatis_plus
+MYBATIS_PLUS_VERSION=3.4.2
+# mybatis_plus
+MYBATIS_PLUS_DYNAMIC_VERSION=3.4.1
 # https://mvnrepository.com/artifact/com.alibaba/fastjson
 XSTREAM_VERSION=1.4.18
 # https://mvnrepository.com/artifact/javax.persistence/persistence-api

+ 5 - 0
labsl/build.gradle

@@ -71,6 +71,11 @@ dependencies {
     compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "persagy-service-mysql", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "dmp-digital-starter", version: DIGITAL_START_VERSION
+    compile group: "com.baomidou", name: "mybatis-plus-boot-starter", version: MYBATIS_PLUS_VERSION
+    compile group: "com.baomidou", name: "mybatis-plus-annotation", version: MYBATIS_PLUS_VERSION
+    compile group: "com.baomidou", name: "mybatis-plus-extension", version: MYBATIS_PLUS_VERSION
+    compile group: "com.baomidou", name: "dynamic-datasource-spring-boot-starter", version: MYBATIS_PLUS_DYNAMIC_VERSION
+    compile group: "com.github.jeffreyning", name:"mybatisplus-plus", version:"1.7.0-RELEASE"
     //compile group: "com.persagy", name: "integrated-config-client", version: PERSAGY_INTERGERT_VERSION
 
    // compile group: "com.persagy", name: "integrated-eureka", version: PERSAGY_INTERGERT_VERSION

+ 1 - 3
labsl/src/main/kotlin/com/persagy/labsl/LaBSLApp.kt

@@ -20,13 +20,11 @@
 
 package com.persagy.labsl
 
-import org.mybatis.spring.annotation.MapperScan
 import org.slf4j.LoggerFactory
 import org.springframework.boot.SpringApplication
 import org.springframework.boot.autoconfigure.SpringBootApplication
 import org.springframework.boot.builder.SpringApplicationBuilder
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
-import org.springframework.context.annotation.Bean
 import org.springframework.context.annotation.ComponentScan
 
 /**
@@ -35,7 +33,7 @@ import org.springframework.context.annotation.ComponentScan
  * @author  Andy
  */
 @ComponentScan(basePackages = ["com.persagy"])           // 配置组件扫描路径
-@MapperScan("com.persagy")                       // Mapper组件扫描路径
+//@MapperScan("com.persagy")                       // Mapper组件扫描路径
 @SpringBootApplication
 open class LaBSLApp : SpringBootServletInitializer() {
     companion object {

+ 59 - 0
labsl/src/main/kotlin/com/persagy/labsl/config/MybatisPlusConfig.kt

@@ -0,0 +1,59 @@
+package com.persagy.labsl.config
+
+import com.baomidou.mybatisplus.annotation.DbType
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
+import com.fasterxml.jackson.databind.ObjectMapper
+import org.mybatis.spring.annotation.MapperScan
+import org.springframework.beans.factory.annotation.Value
+import org.springframework.boot.CommandLineRunner
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.transaction.annotation.EnableTransactionManagement
+
+/**
+ * MybatisPlus公共配置
+ * @author lixing
+ * @description 由 Mybatisplus Code Generator 创建
+ * @since 2020-09-09 09:13:27
+ */
+@MapperScan(value = ["com.persagy.**.mapper","com.persagy.**.services.mappers"])
+@Configuration
+@EnableTransactionManagement
+open class MybatisPlusConfig : CommandLineRunner {
+    @Value("\${persagy.common.sql.limit:500}")
+    private val sqlLimit: Long = 0
+    @Value("\${persagy.common.sql.db.type:mysql}")
+    private val dbType: String? = null
+
+    @Throws(Exception::class)
+    override fun run(vararg args: String) { // 注入objectMapper,处理Java对象转JsonString
+        JacksonTypeHandler.setObjectMapper(objectMapper())
+    }
+
+    /**
+     * 注册Mybatis插件
+     * 使用示例: IPage<Member> memberPage = new Page<>(1, 2,false) true查询总记录数量
+    </Member> */
+    @Bean
+    open fun objectMapper(): ObjectMapper {
+        return ObjectMapper()
+    }
+
+    /**
+     * 注册Mybatis插件
+     * 使用示例: IPage<Member> memberPage = new Page<>(1, 2,false) true查询总记录数量
+    </Member> */
+    @Bean
+    open fun mybatisPlusInterceptor(): MybatisPlusInterceptor {
+        val mybatisPlusInterceptor = MybatisPlusInterceptor()
+        val paginationInnerInterceptor = PaginationInnerInterceptor()
+        // 设置每页查询记录上限,默认500(与mp相同)
+        paginationInnerInterceptor.maxLimit = sqlLimit
+        paginationInnerInterceptor.dbType = DbType.getDbType(dbType)
+        // 添加分页插件
+        mybatisPlusInterceptor.addInnerInterceptor(paginationInnerInterceptor)
+        return mybatisPlusInterceptor
+    }
+}

+ 4 - 1
labsl/src/main/kotlin/com/persagy/labsl/controller/GraphController.kt

@@ -15,6 +15,7 @@ import com.persagy.service.models.responses.SCreateResponse
 import com.persagy.service.models.responses.SQueryResponse
 import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
+import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.web.bind.annotation.PostMapping
 import org.springframework.web.bind.annotation.RequestBody
 import org.springframework.web.bind.annotation.RequestMapping
@@ -29,6 +30,8 @@ import org.springframework.web.bind.annotation.RestController
 @RestController
 @RequestMapping("/graph")
 class GraphController {
+    @Autowired
+    lateinit var graphService: com.persagy.labsl.service.GraphService
 
     /**
      * 创建图
@@ -51,7 +54,7 @@ class GraphController {
     @Operation(summary = "草稿箱-保存图形", description = "")
     @PostMapping("/drafts/save")
     fun save(@RequestBody graph: Graph): SCreateResponse<Graph> {
-        return GraphService.saveLogic(graph)
+        return graphService.saveLogic(graph)
     } // Function save()
 
     /**

+ 73 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/AnchorEntity.kt

@@ -0,0 +1,73 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import lombok.EqualsAndHashCode
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName anchor
+ */
+@TableName(value = "anchor",autoResultMap = true)
+@Data
+@EqualsAndHashCode
+class AnchorEntity : Serializable {
+    /**
+     * 全局id
+     */
+    @TableField(value = "id")
+    @MppMultiId
+    var id: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 锚点id
+     */
+    @MppMultiId
+    @TableField(value = "anchor_id")
+    var anchorId: String? = null
+    /**
+     * 图例节点
+     */
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 锚点的坐标
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 项目id
+     */
+    @TableField(value = "project_id")
+    var projectId: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 71 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/AnchorPubEntity.kt

@@ -0,0 +1,71 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName anchor_pub
+ */
+@TableName(value = "anchor_pub",autoResultMap = true)
+@Data
+class AnchorPubEntity : Serializable {
+    /**
+     * 全局id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 锚点id
+     */
+    @MppMultiId
+    @TableField(value = "anchor_id")
+    var anchorId: String? = null
+    /**
+     * 图例节点
+     */
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 锚点的坐标
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 项目id
+     */
+    @TableField(value = "project_id")
+    var projectId: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 61 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/AttachObjectIdsEntity.kt

@@ -0,0 +1,61 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName attach_object_ids
+ */
+@TableName(value = "attach_object_ids",autoResultMap = true)
+@Data
+class AttachObjectIdsEntity : Serializable {
+    /**
+     * 图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 图例节点id
+     */
+    @MppMultiId
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 对象id
+     */
+    @MppMultiId
+    @TableField(value = "object_id")
+    var objectId: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 61 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/AttachObjectIdsPubEntity.kt

@@ -0,0 +1,61 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName attach_object_ids_pub
+ */
+@TableName(value = "attach_object_ids_pub",autoResultMap = true)
+@Data
+class AttachObjectIdsPubEntity : Serializable {
+    /**
+     * 图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 图例节点id
+     */
+    @MppMultiId
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 对象id
+     */
+    @MppMultiId
+    @TableField(value = "object_id")
+    var objectId: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 47 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/GraphCategoryEntity.kt

@@ -0,0 +1,47 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName graph_category
+ */
+@TableName(value = "graph_category",autoResultMap = true)
+@Data
+class GraphCategoryEntity : Serializable {
+    /**
+     * 分类编码Code
+     */
+    @TableId(value = "id")
+    var id: String? = null
+    /**
+     * 分类名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 上级节点
+     */
+    @TableField(value = "parent_id")
+    var parentId: String? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 52 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/GraphCategoryEquipEntity.kt

@@ -0,0 +1,52 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName graph_category_equip
+ */
+@TableName(value = "graph_category_equip",autoResultMap = true)
+@Data
+class GraphCategoryEquipEntity : Serializable {
+    /**
+     * 分类编码Code
+     */
+    @TableId(value = "id")
+    var id: String? = null
+    /**
+     * 分类名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 上级节点
+     */
+    @TableField(value = "parent_id")
+    var parentId: String? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 编码
+     */
+    @TableField(value = "code")
+    var code: String? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 125 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/GraphEntity.kt

@@ -0,0 +1,125 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import com.persagy.labsl.models.entities.tpt.Graph
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName graph
+ */
+@TableName(value = "graph",autoResultMap = true)
+@Data
+class GraphEntity : Serializable {
+    /**
+     * 对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 系统图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图分类id
+     */
+    @TableField(value = "category_id")
+    var categoryId: String? = null
+    /**
+     * 项目id
+     */
+    @TableField(value = "project_id")
+    var projectId: String? = null
+    /**
+     * 建筑id
+     */
+    @TableField(value = "building_id")
+    var buildingId: String? = null
+    /**
+     * 楼层id
+     */
+    @TableField(value = "floor_id")
+    var floorId: String? = null
+    /**
+     * 说明
+     */
+    @TableField(value = "note")
+    var note: String? = null
+    /**
+     * 版本号
+     */
+    @TableField(value = "version")
+    var version: String? = null
+    /**
+     * 移至回收站时间
+     */
+    @TableField(value = "del_time")
+    var delTime: Date? = null
+    /**
+     * 是否移至回收站 , false 正常,true 以至回收站
+     */
+    @TableField(value = "is_available")
+    var isAvailable: Int? = null
+    /**
+     * 内部版本号
+     */
+    @TableField(value = "tag_version")
+    var tagVersion: Int? = null
+    /**
+     * 图片Key
+     */
+    @TableField(value = "pic")
+    var pic: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 页面尺寸
+     */
+    @TableField(value = "page_size",typeHandler = JacksonTypeHandler::class)
+    var pageSize: Any? = null
+    /**
+     * 标签
+     */
+    @TableField(value = "label",typeHandler = JacksonTypeHandler::class)
+    var label: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 背景色
+     */
+    @TableField(value = "view_background")
+    var viewBackground: String? = null
+
+    companion object {
+        //fun toEntityByObj(graph: Graph): GraphEntity? {
+        //  val graphEntity = GraphEntity()
+        //  graphEntity.id=graph.id
+        //}
+        @TableField(exist = false)
+        private val serialVersionUID = 1L
+    }
+}

+ 120 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/GraphPubEntity.kt

@@ -0,0 +1,120 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName graph_pub
+ */
+@TableName(value = "graph_pub",autoResultMap = true)
+@Data
+class GraphPubEntity : Serializable {
+    /**
+     * 对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 系统图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图分类id
+     */
+    @TableField(value = "category_id")
+    var categoryId: String? = null
+    /**
+     * 项目id
+     */
+    @TableField(value = "project_id")
+    var projectId: String? = null
+    /**
+     * 建筑id
+     */
+    @TableField(value = "building_id")
+    var buildingId: String? = null
+    /**
+     * 楼层id
+     */
+    @TableField(value = "floor_id")
+    var floorId: String? = null
+    /**
+     * 说明
+     */
+    @TableField(value = "note")
+    var note: String? = null
+    /**
+     * 版本号
+     */
+    @TableField(value = "version")
+    var version: String? = null
+    /**
+     * 移至回收站时间
+     */
+    @TableField(value = "del_time")
+    var delTime: Date? = null
+    /**
+     * 是否移至回收站 , false 正常,true 以至回收站
+     */
+    @TableField(value = "is_available")
+    var isAvailable: Int? = null
+    /**
+     * 内部版本号
+     */
+    @TableField(value = "tag_version")
+    var tagVersion: Int? = null
+    /**
+     * 图片Key
+     */
+    @TableField(value = "pic")
+    var pic: String? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 页面尺寸
+     */
+    @TableField(value = "page_size",typeHandler = JacksonTypeHandler::class)
+    var pageSize: Any? = null
+    /**
+     * 标签
+     */
+    @TableField(value = "label",typeHandler = JacksonTypeHandler::class)
+    var label: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 背景色
+     */
+    @TableField(value = "view_background")
+    var viewBackground: String? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 96 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/MarkerEntity.kt

@@ -0,0 +1,96 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName marker
+ */
+@TableName(value = "marker",autoResultMap = true)
+@Data
+class MarkerEntity : Serializable {
+    /**
+     * 图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 标识id
+     */
+    @MppMultiId
+    @TableField(value = "marker_id")
+    var markerId: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 标识名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图标(Image),线类型(Line),文本(Text)
+     */
+    @TableField(value = "type")
+    var type: String? = null
+    /**
+     * 位置信息
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 缩放
+     */
+    @TableField(value = "scale",typeHandler = JacksonTypeHandler::class)
+    var scale: Any? = null
+    /**
+     * 旋转
+     */
+    @TableField(value = "rotate",typeHandler = JacksonTypeHandler::class)
+    var rotate: Any? = null
+    /**
+     * 大小
+     */
+    @TableField(value = "size",typeHandler = JacksonTypeHandler::class)
+    var size: Any? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 96 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/MarkerPubEntity.kt

@@ -0,0 +1,96 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName marker_pub
+ */
+@TableName(value = "marker_pub",autoResultMap = true)
+@Data
+class MarkerPubEntity : Serializable {
+    /**
+     * 图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 标识id
+     */
+    @MppMultiId
+    @TableField(value = "marker_id")
+    var markerId: String? = null
+    /**
+     * 图id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 标识名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图标(Image),线类型(Line),文本(Text)
+     */
+    @TableField(value = "type")
+    var type: String? = null
+    /**
+     * 位置信息
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 缩放
+     */
+    @TableField(value = "scale",typeHandler = JacksonTypeHandler::class)
+    var scale: Any? = null
+    /**
+     * 旋转
+     */
+    @TableField(value = "rotate",typeHandler = JacksonTypeHandler::class)
+    var rotate: Any? = null
+    /**
+     * 大小
+     */
+    @TableField(value = "size",typeHandler = JacksonTypeHandler::class)
+    var size: Any? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 116 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/NodeEntity.kt

@@ -0,0 +1,116 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName node
+ */
+@TableName(value = "node",autoResultMap = true)
+@Data
+class NodeEntity : Serializable {
+    /**
+     * 系统图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 节点id
+     */
+    @MppMultiId
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 系统图 id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图例节点名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图例类型 None/Line/Zone/Image:非图例/线条/区域类型/图标
+     */
+    @TableField(value = "graph_element_type")
+    var graphElementType: String? = null
+    /**
+     * 图元ID
+     */
+    @TableField(value = "graph_element_id")
+    var graphElementId: String? = null
+    /**
+     * 节点类型(image / zone)
+     */
+    @TableField(value = "type")
+    var type: String? = null
+    /**
+     * 位置信息
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 缩放
+     */
+    @TableField(value = "scale",typeHandler = JacksonTypeHandler::class)
+    var scale: Any? = null
+    /**
+     * 旋转
+     */
+    @TableField(value = "rotate",typeHandler = JacksonTypeHandler::class)
+    var rotate: Any? = null
+    /**
+     * 大小
+     */
+    @TableField(value = "size",typeHandler = JacksonTypeHandler::class)
+    var size: Any? = null
+    /**
+     * 轮廓线
+     */
+    @TableField(value = "outline",typeHandler = JacksonTypeHandler::class)
+    var outline: Any? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 对象 id 列表
+     */
+    @TableField(value = "attach_object_ids",typeHandler = JacksonTypeHandler::class)
+    var attachObjectIds: Any? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 116 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/NodePubEntity.kt

@@ -0,0 +1,116 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName node_pub
+ */
+@TableName(value = "node_pub",autoResultMap = true)
+@Data
+class NodePubEntity : Serializable {
+    /**
+     * 系统图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 节点id
+     */
+    @MppMultiId
+    @TableField(value = "node_id")
+    var nodeId: String? = null
+    /**
+     * 系统图 id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 图例节点名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图例类型 None/Line/Zone/Image:非图例/线条/区域类型/图标
+     */
+    @TableField(value = "graph_element_type")
+    var graphElementType: String? = null
+    /**
+     * 图元ID
+     */
+    @TableField(value = "graph_element_id")
+    var graphElementId: String? = null
+    /**
+     * 节点类型(image / zone)
+     */
+    @TableField(value = "type")
+    var type: String? = null
+    /**
+     * 位置信息
+     */
+    @TableField(value = "pos",typeHandler = JacksonTypeHandler::class)
+    var pos: Any? = null
+    /**
+     * 缩放
+     */
+    @TableField(value = "scale",typeHandler = JacksonTypeHandler::class)
+    var scale: Any? = null
+    /**
+     * 旋转
+     */
+    @TableField(value = "rotate",typeHandler = JacksonTypeHandler::class)
+    var rotate: Any? = null
+    /**
+     * 大小
+     */
+    @TableField(value = "size",typeHandler = JacksonTypeHandler::class)
+    var size: Any? = null
+    /**
+     * 轮廓线
+     */
+    @TableField(value = "outline",typeHandler = JacksonTypeHandler::class)
+    var outline: Any? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Int? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 对象 id 列表
+     */
+    @TableField(value = "attach_object_ids",typeHandler = JacksonTypeHandler::class)
+    var attachObjectIds: Any? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 111 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/RelationEntity.kt

@@ -0,0 +1,111 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName relation
+ */
+@TableName(value = "relation",autoResultMap = true)
+@Data
+class RelationEntity : Serializable {
+    /**
+     * 系统图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 关系id
+     */
+    @MppMultiId
+    @TableField(value = "relation_id")
+    var relationId: String? = null
+    /**
+     * 系统图 id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 关系名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图元id
+     */
+    @TableField(value = "graph_element_id")
+    var graphElementId: String? = null
+    /**
+     * 关联节点1_id
+     */
+    @TableField(value = "node1_id")
+    var node1Id: String? = null
+    /**
+     * 关联节点2_id
+     */
+    @TableField(value = "node2_id")
+    var node2Id: String? = null
+    /**
+     * 关联锚点1_id
+     */
+    @TableField(value = "anchor1_id")
+    var anchor1Id: String? = null
+    /**
+     * 关联锚点2_id
+     */
+    @TableField(value = "anchor2_id")
+    var anchor2Id: String? = null
+    /**
+     * 方向(0:无向,1:节点1到节点2,2:节点2到节点1)
+     */
+    @TableField(value = "dir")
+    var dir: Int? = null
+    /**
+     * 直线(Line),水平垂直
+     */
+    @TableField(value = "line_type")
+    var lineType: String? = null
+    /**
+     * 线的顶点坐标
+     */
+    @TableField(value = "point_list",typeHandler = JacksonTypeHandler::class)
+    var pointList: Any? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Short? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 111 - 0
labsl/src/main/kotlin/com/persagy/labsl/domain/RelationPubEntity.kt

@@ -0,0 +1,111 @@
+package com.persagy.labsl.domain
+
+import com.baomidou.mybatisplus.annotation.TableField
+import com.baomidou.mybatisplus.annotation.TableName
+import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId
+import lombok.Data
+import java.io.Serializable
+import java.util.*
+
+/**
+ *
+ * @TableName relation_pub
+ */
+@TableName(value = "relation_pub",autoResultMap = true)
+@Data
+class RelationPubEntity : Serializable {
+    /**
+     * 系统图对象id
+     */
+    @MppMultiId
+    @TableField(value = "id")
+    var id: String? = null
+    /**
+     * 关系id
+     */
+    @MppMultiId
+    @TableField(value = "relation_id")
+    var relationId: String? = null
+    /**
+     * 系统图 id
+     */
+    @MppMultiId
+    @TableField(value = "graph_id")
+    var graphId: String? = null
+    /**
+     * 关系名称
+     */
+    @TableField(value = "name")
+    var name: String? = null
+    /**
+     * 图元id
+     */
+    @TableField(value = "graph_element_id")
+    var graphElementId: String? = null
+    /**
+     * 关联节点1_id
+     */
+    @TableField(value = "node1_id")
+    var node1Id: String? = null
+    /**
+     * 关联节点2_id
+     */
+    @TableField(value = "node2_id")
+    var node2Id: String? = null
+    /**
+     * 关联锚点1_id
+     */
+    @TableField(value = "anchor1_id")
+    var anchor1Id: String? = null
+    /**
+     * 关联锚点2_id
+     */
+    @TableField(value = "anchor2_id")
+    var anchor2Id: String? = null
+    /**
+     * 方向(0:无向,1:节点1到节点2,2:节点2到节点1)
+     */
+    @TableField(value = "dir")
+    var dir: Int? = null
+    /**
+     * 直线(Line),水平垂直
+     */
+    @TableField(value = "line_type")
+    var lineType: String? = null
+    /**
+     * 线的顶点坐标
+     */
+    @TableField(value = "point_list",typeHandler = JacksonTypeHandler::class)
+    var pointList: Any? = null
+    /**
+     * 线的绘图样式
+     */
+    @TableField(value = "style",typeHandler = JacksonTypeHandler::class)
+    var style: Any? = null
+    /**
+     * 图状态(1一般,2待审核,3审核完成,4回收站 ,0发布)
+     */
+    @TableField(value = "state")
+    var state: Short? = null
+    /**
+     * 更新时间
+     */
+    @TableField(value = "last_update")
+    var lastUpdate: Date? = null
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    var createTime: Date? = null
+    /**
+     * 应用自定义
+     */
+    @TableField(value = "properties",typeHandler = JacksonTypeHandler::class)
+    var properties: Any? = null
+
+    companion object {
+        @TableField(exist = false)
+        val serialVersionUID = 1L
+    }
+}

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/AnchorMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.AnchorEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.Anchor
+ */
+interface AnchorMapper : BaseMapper<AnchorEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/AnchorPubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.AnchorPubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.AnchorPub
+ */
+interface AnchorPubMapper : BaseMapper<AnchorPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/AttachObjectIdsMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.AttachObjectIdsEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.AttachObjectIds
+ */
+interface AttachObjectIdsMapper : BaseMapper<AttachObjectIdsEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/AttachObjectIdsPubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.AttachObjectIdsPubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.AttachObjectIdsPub
+ */
+interface AttachObjectIdsPubMapper : BaseMapper<AttachObjectIdsPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphCategoryEquipMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.GraphCategoryEquipEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.GraphCategoryEquip
+ */
+interface GraphCategoryEquipMapper : BaseMapper<GraphCategoryEquipEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphCategoryMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.GraphCategoryEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.GraphCategory
+ */
+interface GraphCategoryMapper : BaseMapper<GraphCategoryEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.GraphEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.Graph
+ */
+interface GraphMapper : BaseMapper<GraphEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/GraphPubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.GraphPubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.GraphPub
+ */
+interface GraphPubMapper : BaseMapper<GraphPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/MarkerMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.MarkerEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.Marker
+ */
+interface MarkerMapper : BaseMapper<MarkerEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/MarkerPubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.MarkerPubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.MarkerPub
+ */
+interface MarkerPubMapper : BaseMapper<MarkerPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/NodeMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.NodeEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.Node
+ */
+interface NodeMapper : BaseMapper<NodeEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/NodePubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.NodePubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.NodePub
+ */
+interface NodePubMapper : BaseMapper<NodePubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/RelationMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.RelationEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.Relation
+ */
+interface RelationMapper : BaseMapper<RelationEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/mapper/RelationPubMapper.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.persagy.labsl.domain.RelationPubEntity
+
+/**
+ * @Entity com.persagy.labsl.domain.RelationPub
+ */
+interface RelationPubMapper : BaseMapper<RelationPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/AnchorPubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.AnchorPubEntity
+
+/**
+ *
+ */
+interface AnchorPubService : IService<AnchorPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/AnchorService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.AnchorEntity
+
+/**
+ *
+ */
+interface AnchorService : IService<AnchorEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/AttachObjectIdsPubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.AttachObjectIdsPubEntity
+
+/**
+ *
+ */
+interface AttachObjectIdsPubService : IService<AttachObjectIdsPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/AttachObjectIdsService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.AttachObjectIdsEntity
+
+/**
+ *
+ */
+interface AttachObjectIdsService : IService<AttachObjectIdsEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/GraphCategoryEquipService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.GraphCategoryEquipEntity
+
+/**
+ *
+ */
+interface GraphCategoryEquipService : IService<GraphCategoryEquipEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/GraphCategoryService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.GraphCategoryEntity
+
+/**
+ *
+ */
+interface GraphCategoryService : IService<GraphCategoryEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/GraphPubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.GraphPubEntity
+
+/**
+ *
+ */
+interface GraphPubService : IService<GraphPubEntity?>

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/GraphService.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.GraphEntity
+import com.persagy.labsl.models.entities.tpt.Graph
+import com.persagy.service.models.responses.SCreateResponse
+
+/**
+ *
+ */
+interface GraphService : IService<GraphEntity?> {
+    fun saveLogic(graph: Graph): SCreateResponse<Graph>
+}

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/MarkerPubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.MarkerPubEntity
+
+/**
+ *
+ */
+interface MarkerPubService : IService<MarkerPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/MarkerService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.MarkerEntity
+
+/**
+ *
+ */
+interface MarkerService : IService<MarkerEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/NodePubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.NodePubEntity
+
+/**
+ *
+ */
+interface NodePubService : IService<NodePubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/NodeService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.NodeEntity
+
+/**
+ *
+ */
+interface NodeService : IService<NodeEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/RelationPubService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.RelationPubEntity
+
+/**
+ *
+ */
+interface RelationPubService : IService<RelationPubEntity?>

+ 9 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/RelationService.kt

@@ -0,0 +1,9 @@
+package com.persagy.labsl.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.persagy.labsl.domain.RelationEntity
+
+/**
+ *
+ */
+interface RelationService : IService<RelationEntity?>

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/AnchorPubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.AnchorPubEntity
+import com.persagy.labsl.mapper.AnchorPubMapper
+import com.persagy.labsl.service.AnchorPubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class AnchorPubServiceImpl : ServiceImpl<AnchorPubMapper?, AnchorPubEntity?>(), AnchorPubService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/AnchorServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.AnchorEntity
+import com.persagy.labsl.mapper.AnchorMapper
+import com.persagy.labsl.service.AnchorService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class AnchorServiceImpl : ServiceImpl<AnchorMapper?, AnchorEntity?>(), AnchorService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/AttachObjectIdsPubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.AttachObjectIdsPubEntity
+import com.persagy.labsl.mapper.AttachObjectIdsPubMapper
+import com.persagy.labsl.service.AttachObjectIdsPubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class AttachObjectIdsPubServiceImpl : ServiceImpl<AttachObjectIdsPubMapper?, AttachObjectIdsPubEntity?>(), AttachObjectIdsPubService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/AttachObjectIdsServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.AttachObjectIdsEntity
+import com.persagy.labsl.mapper.AttachObjectIdsMapper
+import com.persagy.labsl.service.AttachObjectIdsService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class AttachObjectIdsServiceImpl : ServiceImpl<AttachObjectIdsMapper?, AttachObjectIdsEntity?>(), AttachObjectIdsService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphCategoryEquipServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.GraphCategoryEquipEntity
+import com.persagy.labsl.mapper.GraphCategoryEquipMapper
+import com.persagy.labsl.service.GraphCategoryEquipService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class GraphCategoryEquipServiceImpl : ServiceImpl<GraphCategoryEquipMapper?, GraphCategoryEquipEntity?>(), GraphCategoryEquipService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphCategoryServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.GraphCategoryEntity
+import com.persagy.labsl.mapper.GraphCategoryMapper
+import com.persagy.labsl.service.GraphCategoryService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class GraphCategoryServiceImpl : ServiceImpl<GraphCategoryMapper?, GraphCategoryEntity?>(), GraphCategoryService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphPubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.GraphPubEntity
+import com.persagy.labsl.mapper.GraphPubMapper
+import com.persagy.labsl.service.GraphPubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class GraphPubServiceImpl : ServiceImpl<GraphPubMapper?, GraphPubEntity?>(), GraphPubService

+ 216 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/GraphServiceImpl.kt

@@ -0,0 +1,216 @@
+package com.persagy.labsl.service.impl
+
+import cn.hutool.core.bean.BeanUtil
+import cn.hutool.core.collection.CollUtil
+import cn.hutool.core.util.StrUtil
+import com.baomidou.mybatisplus.extension.kotlin.KtQueryWrapper
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.Opts
+import com.persagy.labsl.domain.*
+import com.persagy.labsl.mapper.GraphMapper
+import com.persagy.labsl.models.entities.tpt.Graph
+import com.persagy.labsl.service.*
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.responses.SCreateResponse
+import lombok.extern.slf4j.Slf4j
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+import org.springframework.transaction.annotation.Transactional
+import java.util.*
+import kotlin.collections.ArrayList
+
+/**
+ *
+ */
+@Service
+@Slf4j
+open class GraphServiceImpl : ServiceImpl<GraphMapper?, GraphEntity?>(), GraphService{
+
+    @Autowired
+    lateinit var nodeService: NodeService
+    @Autowired
+    lateinit var markerService: MarkerService
+    @Autowired
+    lateinit var relationService: RelationService
+    @Autowired
+    lateinit var anchorService: AnchorService
+
+    /**
+     * 创建图
+     *
+     * @param graph   图对象
+     * @return 图形对象列表
+     */
+    @Transactional
+    override fun saveLogic(graph: Graph): SCreateResponse<Graph> {
+        val sCreateResponse = SCreateResponse<Graph>()
+            /** 未发布 */
+            if (graph.id.isNullOrEmpty()) {
+                /** id赋值 */
+                graph.id = UUID.randomUUID().toString().replace("-", "")
+            }
+
+            /** 图 id 为空赋值*/
+            if (graph.graphId.isNullOrEmpty()){
+                graph.graphId = UUID.randomUUID().toString().replace("-", "")
+            }
+
+            /** 项目 id 赋值 */
+            graph.projectId = Opts.projectId!!
+
+            /** 清除以前的版本 */
+            delOldData(graph)
+            /** 版本号 */
+            if (graph.version.isNullOrEmpty()) {
+                graph.version = "2.0.1"
+            } else {
+                val listVersion = graph.version!!.split(".")
+                val num = listVersion[2].toInt() + 1
+                graph.version = listVersion[0] + "." + listVersion[1] + "." + num
+            }
+            /** 图标记设置为 1 草稿箱 */
+            graph.state = 1
+            /** 插入图形数据 */
+            val graphEntity = BeanUtil.copyProperties(graph, GraphEntity::class.java)
+            save(graphEntity)
+            /** 列表不能为空 */
+            saveElements(graph)
+            /** 返回标志 */
+            sCreateResponse.result = SResponseType.success
+            /** 返回对象列表 */
+            sCreateResponse.entityList = arrayListOf(graph)
+            /** 返回对象 */
+            return sCreateResponse
+    }
+
+    private fun saveElements(graph: Graph) {
+        if (null==graph.elements){
+            return
+        }
+        val nodesList = graph.elements!!.nodes
+        /** 列表不能为空 */
+        if (!nodesList.isNullOrEmpty()) {
+            val addNodesList = ArrayList<NodeEntity>()
+            val addAnchorsList = ArrayList<AnchorEntity>()
+            /** 遍历列表 */
+            for (nodes in nodesList) {
+                /**  图 id 赋值给子节点*/
+                nodes.graphId = graph.graphId
+                /** 图形 id */
+                nodes.id = graph.id
+                nodes.state = 1
+                /** 子节点 id */
+                if (nodes.nodeId.isNullOrEmpty()) {
+                    /** id 赋值 */
+                    nodes.nodeId = UUID.randomUUID().toString().replace("-", "")
+                }
+                addNodesList.add(BeanUtil.copyProperties(nodes,NodeEntity::class.java))
+                val anchorList = nodes.anchorList
+                /** 列表不能为空 */
+                if (anchorList.isNullOrEmpty()) {
+                    continue
+                }
+                /** 遍历列表 */
+                for (anchor in anchorList) {
+                    /** 图 id 赋值 */
+                    anchor.graphId = graph.graphId
+                    /** 图编码 */
+                    anchor.id = graph.id
+                    /** 节点 id 赋值 */
+                    anchor.nodeId = nodes.nodeId
+                    anchor.state = 1
+                    if (anchor.anchorId.isNullOrEmpty()) {
+                        /** id赋值 */
+                        anchor.anchorId = UUID.randomUUID().toString().replace("-", "")
+                    }
+                    addAnchorsList.add(BeanUtil.copyProperties(anchor,AnchorEntity::class.java))
+                }
+            }
+            if (CollUtil.isNotEmpty(addNodesList)){
+                nodeService.saveBatch(CollUtil.newArrayList(addNodesList))
+            }
+            if (CollUtil.isNotEmpty(addAnchorsList)){
+                anchorService.saveBatch(CollUtil.newArrayList(addAnchorsList))
+            }
+        }
+
+        val markersList = graph.elements!!.markers
+        /** 列表不为空 */
+        if (!markersList.isNullOrEmpty()) {
+            val addMarkerList = ArrayList<MarkerEntity>()
+            /** 遍历列表 */
+            for (markers in markersList) {
+                /** 图 id */
+                markers.graphId = graph.graphId
+                /** 标识 id */
+                markers.id = graph.id
+                /** 草稿箱标志 */
+                markers.state = 1
+                /** id 为空赋值 */
+                if (markers.markerId.isNullOrEmpty()) {
+                    /** id赋值 */
+                    markers.markerId = UUID.randomUUID().toString().replace("-", "")
+                }
+                addMarkerList.add(BeanUtil.copyProperties(markers,MarkerEntity::class.java))
+            }
+            if (CollUtil.isNotEmpty(addMarkerList)){
+                markerService.saveBatch(CollUtil.newArrayList(addMarkerList))
+            }
+        }
+
+        val relationsList = graph.elements!!.relations
+        /** 列表不为空 */
+        if (!relationsList.isNullOrEmpty()) {
+            val addRelationList = ArrayList<RelationEntity>()
+            /** 遍历列表 */
+            for (relations in relationsList) {
+                /** 图 id */
+                relations.graphId = graph.graphId
+                /** 草稿箱标志 */
+                relations.state = 1
+                /** 图编码 */
+                relations.id = graph.id
+                /** 管线 id 为空 赋值 */
+                if (relations.relationId.isNullOrEmpty()) {
+                    /** id 赋值 */
+                    relations.relationId = UUID.randomUUID().toString().replace("-", "")
+                }
+                addRelationList.add(BeanUtil.copyProperties(relations,RelationEntity::class.java))
+            }
+            if (CollUtil.isNotEmpty(addRelationList)){
+                relationService.saveBatch(CollUtil.newArrayList(addRelationList))
+            }
+        }
+    }
+
+    /**
+     * 清除草稿箱以前数据
+     *
+     * @param  graph   图对象
+     */
+    private fun delOldData(graph: Graph) {
+        val graphWrapper= KtQueryWrapper(GraphEntity())
+        val nodeWrapper=KtQueryWrapper(NodeEntity())
+        val markerWrapper=KtQueryWrapper(MarkerEntity())
+        val relationWrapper=KtQueryWrapper(RelationEntity())
+        val anchorWrapper=KtQueryWrapper(AnchorEntity())
+        graphWrapper.eq(StrUtil.isNotBlank(graph.projectId),GraphEntity::projectId,graph.projectId!!)
+        graphWrapper.eq(StrUtil.isNotBlank(graph.id),GraphEntity::id,graph.id!!)
+        graphWrapper.eq(StrUtil.isNotBlank(graph.graphId),GraphEntity::graphId,graph.graphId)
+        remove(graphWrapper)
+        nodeWrapper.eq(StrUtil.isNotBlank(graph.id),NodeEntity::id,graph.id!!)
+        nodeWrapper.eq(StrUtil.isNotBlank(graph.graphId),NodeEntity::graphId,graph.graphId)
+        nodeService.remove(nodeWrapper)
+        markerWrapper.eq(StrUtil.isNotBlank(graph.id),MarkerEntity::id,graph.id!!)
+        markerWrapper.eq(StrUtil.isNotBlank(graph.graphId),MarkerEntity::graphId,graph.graphId)
+        markerService.remove(markerWrapper)
+        relationWrapper.eq(StrUtil.isNotBlank(graph.id),RelationEntity::id,graph.id!!)
+        relationWrapper.eq(StrUtil.isNotBlank(graph.graphId),RelationEntity::graphId,graph.graphId)
+        relationService.remove(relationWrapper)
+        anchorWrapper.eq(StrUtil.isNotBlank(graph.id),AnchorEntity::id,graph.id!!)
+        anchorWrapper.eq(StrUtil.isNotBlank(graph.graphId),AnchorEntity::graphId,graph.graphId)
+        anchorService.remove(anchorWrapper)
+    }
+
+
+}

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/MarkerPubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.MarkerPubEntity
+import com.persagy.labsl.mapper.MarkerPubMapper
+import com.persagy.labsl.service.MarkerPubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class MarkerPubServiceImpl : ServiceImpl<MarkerPubMapper?, MarkerPubEntity?>(), MarkerPubService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/MarkerServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.MarkerEntity
+import com.persagy.labsl.mapper.MarkerMapper
+import com.persagy.labsl.service.MarkerService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class MarkerServiceImpl : ServiceImpl<MarkerMapper?, MarkerEntity?>(), MarkerService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/NodePubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.NodePubEntity
+import com.persagy.labsl.mapper.NodePubMapper
+import com.persagy.labsl.service.NodePubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class NodePubServiceImpl : ServiceImpl<NodePubMapper?, NodePubEntity?>(), NodePubService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/NodeServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.NodeEntity
+import com.persagy.labsl.mapper.NodeMapper
+import com.persagy.labsl.service.NodeService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class NodeServiceImpl : ServiceImpl<NodeMapper?, NodeEntity?>(), NodeService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/RelationPubServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.RelationPubEntity
+import com.persagy.labsl.mapper.RelationPubMapper
+import com.persagy.labsl.service.RelationPubService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class RelationPubServiceImpl : ServiceImpl<RelationPubMapper?, RelationPubEntity?>(), RelationPubService

+ 13 - 0
labsl/src/main/kotlin/com/persagy/labsl/service/impl/RelationServiceImpl.kt

@@ -0,0 +1,13 @@
+package com.persagy.labsl.service.impl
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.persagy.labsl.domain.RelationEntity
+import com.persagy.labsl.mapper.RelationMapper
+import com.persagy.labsl.service.RelationService
+import org.springframework.stereotype.Service
+
+/**
+ *
+ */
+@Service
+open class RelationServiceImpl : ServiceImpl<RelationMapper?, RelationEntity?>(), RelationService

+ 0 - 1
labsl/src/main/kotlin/com/persagy/labsl/services/GraphService.kt

@@ -19,7 +19,6 @@ import com.persagy.service.models.responses.SCreateResponse
 import com.persagy.service.models.responses.SQueryResponse
 import com.persagy.service.utils.SSpringContextUtil
 import org.slf4j.LoggerFactory
-import org.springframework.stereotype.Service
 import org.springframework.transaction.annotation.Transactional
 import java.text.SimpleDateFormat
 import java.util.*

+ 21 - 1
labsl/src/main/resources/application.yml

@@ -45,6 +45,20 @@ spring:
     url:                                jdbc:mysql://192.168.100.91:9934/labsl?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
     username:                           root
     password:                           persagy@2021
+    dynamic:
+      datasource:
+        master:
+          password: ${spring.datasource.password}
+          username: ${spring.datasource.username}
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: ${spring.datasource.url}
+        second:
+          password: ${spring.second-datasource.password}
+          username: ${spring.second-datasource.username}
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: ${spring.second-datasource.url}
+      primary: master
+      strict: false
 
   second-datasource:
     name: labsl
@@ -86,6 +100,12 @@ springdoc:
 mybatis:
   typeAliasesPackage:                   cn.sagacloud.server.datacenter.entities
 
-
+#扫描mapper路径
+mybatis-plus:
+  mapper-locations: classpath:mapper/*.xml
+  configuration:  #配置日志
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl    #日志实现类
+    map-underscore-to-camel-case: true                       #驼峰转换
+  type-aliases-package: com.persagy.labsl.domain              #实体类型别名
 
 

+ 7 - 0
labsl/src/main/resources/mapper/AnchorMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.AnchorMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/AnchorPubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.AnchorPubMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/AttachObjectIdsMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.AttachObjectIdsMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/AttachObjectIdsPubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.AttachObjectIdsPubMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/GraphCategoryEquipMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.GraphCategoryEquipMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/GraphCategoryMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.GraphCategoryMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/GraphMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.GraphMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/GraphPubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.GraphPubMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/MarkerMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.MarkerMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/MarkerPubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.MarkerPubMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/NodeMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.NodeMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/NodePubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.NodePubMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/RelationMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.RelationMapper">
+
+</mapper>

+ 7 - 0
labsl/src/main/resources/mapper/RelationPubMapper.xml

@@ -0,0 +1,7 @@
+<?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.persagy.labsl.mapper.RelationPubMapper">
+
+</mapper>