Selaa lähdekoodia

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/digital-delivery

 Conflicts:
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramBuilder.java
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramDataLoader.java
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/line/LineLayoutManager.java
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/Diagram.java
	adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GeomUtil.java
zhaoyk 2 vuotta sitten
vanhempi
commit
b18c66f1a9
82 muutettua tiedostoa jossa 2124 lisäystä ja 2496 poistoa
  1. 13 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/config/CustomThreadPoolConfig.java
  2. 6 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/CommonController.java
  3. 32 9
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java
  4. 158 6
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DataStrategy.java
  5. 48 11
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java
  6. 4 2
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/ConnectPoint.java
  7. 14 7
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/AbstractComponent.java
  8. 24 12
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/Container.java
  9. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/PositionData.java
  10. 12 6
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Anchor.java
  11. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Legend.java
  12. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/AndFilter.java
  13. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/LogicFilter.java
  14. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/MatchFilter.java
  15. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/OrFilter.java
  16. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/ContainerRefPoint.java
  17. 14 7
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/DiagramTemplate.java
  18. 4 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/MainPipe.java
  19. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/virtual/PackNode.java
  20. 10 10
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GsonUtil.java
  21. 36 3
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/dao/DiagramMapper.java
  22. 390 363
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java
  23. 2 10
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/entity/ModelAdapter.java
  24. 8 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/DemoDiagramManager.java
  25. 5 3
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/Folder.java
  26. 3 4
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/LegendManager.java
  27. 373 358
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/TemplateManager.java
  28. 121 112
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/service/BdtpDataService.java
  29. 3 2
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/Pagination.java
  30. 7 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/ServiceUtil.java
  31. 1 1
      adm-business/adm-diagram/src/main/resources/db.init/schema.sql
  32. 6 3
      adm-business/adm-diagram/src/main/resources/mapper/Diagram.xml
  33. 1 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java
  34. 1 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java
  35. 4 11
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java
  36. 1 1
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java
  37. 2 2
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java
  38. 31 15
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java
  39. 17 7
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java
  40. 26 36
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java
  41. 9 8
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java
  42. 0 36
      adm-business/adm-server/pom.xml
  43. 0 60
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/client/OldAdmClient.java
  44. 0 36
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/common/AdmResult.java
  45. 9 11
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java
  46. 19 105
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java
  47. 4 20
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java
  48. 18 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ToolController.java
  49. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmCadMapper.java
  50. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmDefineProblemInfoMapper.java
  51. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmProblemMapper.java
  52. 7 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/BuildingData.java
  53. 32 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/ConfigData.java
  54. 5 5
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmCad.java
  55. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmDefineProblemInfo.java
  56. 2 2
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmProblem.java
  57. 0 26
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBase.java
  58. 0 19
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBuilding.java
  59. 0 98
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OEquip.java
  60. 0 51
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OFloor.java
  61. 0 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OProject.java
  62. 0 79
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OSpace.java
  63. 0 20
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OldAdmResult.java
  64. 4 4
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/CallException.java
  65. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmCadService.java
  66. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmDefineProblemInfoService.java
  67. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmProblemService.java
  68. 0 29
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IQueryFromOldAdm.java
  69. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncApp.java
  70. 0 16
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncOldAdm.java
  71. 1 18
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java
  72. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmCadServiceImpl.java
  73. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmDefineProblemInfoServiceImpl.java
  74. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmProblemServiceImpl.java
  75. 0 111
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/QueryFromOldAdmImpl.java
  76. 15 25
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java
  77. 0 569
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncOldAdmImpl.java
  78. 30 41
      adm-business/adm-server/src/main/resources/application-dev.yml
  79. 28 36
      adm-business/adm-server/src/main/resources/application-test.yml
  80. 163 0
      adm-business/adm-server/src/main/resources/db/init/data.sql
  81. 373 0
      adm-business/adm-server/src/main/resources/db/init/schema.sql
  82. 1 3
      docker/k8sfiles/adm-server-standard.yml

+ 13 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/config/CustomThreadPoolConfig.java

@@ -7,13 +7,25 @@ import java.util.concurrent.LinkedBlockingDeque;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+/**
+ * 自定义线程池
+ *
+ * @author liyang
+ * @date 2021-12-31
+ */
 @Configuration
 public class CustomThreadPoolConfig {
 
+    /**
+     * 发布自定义线程池
+     *
+     * @return 线程池
+     */
     @Bean("customThreadPool")
     public ThreadPoolExecutor executor() {
         return new ThreadPoolExecutor(4, 10,
                 2000, TimeUnit.MICROSECONDS,
-                new LinkedBlockingDeque<>(20));
+                new LinkedBlockingDeque<>(20),
+                r -> new Thread(r, "diagram_pool_" + r.hashCode()));
     }
 }

+ 6 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/CommonController.java

@@ -19,6 +19,11 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * 公共接口
+ * @author zhaoyk
+ * @date 2021-12-27
+ */
 @RestController
 @CrossOrigin
 public class CommonController {
@@ -27,7 +32,7 @@ public class CommonController {
 	private BdtpDataService bdtpDataService;
 
 	@Autowired
-	@Qualifier(DataStrategy.implQualifier)
+	@Qualifier(DataStrategy.IMPL_QUALIFIER)
 	private DataStrategy dataStrategy;
 
 	@GetMapping("equipTypes")

+ 32 - 9
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.diagram.core.ContentParser;
 import com.persagy.adm.diagram.core.DataStrategy;
 import com.persagy.adm.diagram.core.model.Diagram;
+import com.persagy.adm.diagram.core.model.DiagramNode;
 import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
 import com.persagy.adm.diagram.frame.BdtpRequest;
 import com.persagy.adm.diagram.manage.DemoDiagramManager;
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
@@ -59,7 +61,7 @@ public class DiagramController {
         String projectId = current.getProjectId();
 
         List<Diagram> diagramList = dataStrategy.getDiagrams(null, projectId,
-                diagram.getSystemId(), groupCode, diagram.getName());
+                diagram.getSystemId(), groupCode, diagram.getName(), diagram.getFlag());
 
         return ResultHelper.multi(diagramList);
     }
@@ -69,7 +71,6 @@ public class DiagramController {
      *
      * @param params    参数集合
      * @param projectId 项目id
-     * @param systemId  系统实例id
      * @param groupCode 集团code
      * @return 系统图信息
      */
@@ -77,12 +78,10 @@ public class DiagramController {
     @PostMapping("/newDiagram")
     public CommonResult<Diagram> newDiagram(@RequestBody Map<String, Object> params,
                                             @RequestParam String projectId,
-                                            @RequestParam(required = false) String systemId,
                                             @RequestParam String groupCode) {
         Diagram diagram = new Diagram();
         diagram.setGroupCode(groupCode);
         diagram.setProjectId(projectId);
-        diagram.setSystemId(systemId);
 
         Optional.ofNullable(params).ifPresent(map -> {
             Optional.ofNullable(map.get("id")).ifPresent(o -> diagram.setId(String.valueOf(o)));
@@ -93,6 +92,7 @@ public class DiagramController {
                 diagram.setType(String.valueOf(o));
                 diagram.setSystem(String.valueOf(o).substring(0, 4));
             });
+            Optional.ofNullable(map.get("systemId")).ifPresent(o -> diagram.setSystemId(String.valueOf(o)));
             Optional.ofNullable(map.get("name")).ifPresent(o -> diagram.setName(String.valueOf(o)));
             Optional.ofNullable(map.get("remark")).ifPresent(o -> diagram.setRemark(String.valueOf(o)));
             Optional.ofNullable(map.get("templateId")).ifPresent(o -> diagram.setTemplateId(String.valueOf(o)));
@@ -102,10 +102,9 @@ public class DiagramController {
             });
             Optional.ofNullable(map.get("lines")).ifPresent(lines ->
                     diagram.setLines(parser.parseContent(parser.toJson(lines), List.class)));
-            Optional.ofNullable(map.get("nodes")).ifPresent(nodes ->
-                    diagram.setNodes(parser.parseContent(parser.toJson(nodes), List.class)));
-            Optional.ofNullable(map.get("template")).ifPresent(s ->
-                    diagram.setTemplate(parser.parseContent(parser.toJson(s), DiagramTemplate.class)));
+            Optional.ofNullable(map.get("nodes")).ifPresent(nodes -> {
+                diagram.setNodes(Arrays.asList(parser.parseContent(parser.toJson(nodes), DiagramNode[].class)));
+            });
         });
 
         return ResultHelper.single(dataStrategy.saveDiagram(diagram));
@@ -132,7 +131,9 @@ public class DiagramController {
     @ApiOperation("根据系统图id获取系统图信息")
     @GetMapping("/getDiagram")
     public CommonResult<Diagram> getDiagram(String diagramId) {
-        return ResultHelper.single(dataStrategy.getDiagram(diagramId));
+        Diagram diagram = dataStrategy.getDiagram(diagramId);
+        diagramManager.buildDiagram(diagram, true);
+        return ResultHelper.single(diagram);
     }
 
     /**
@@ -217,4 +218,26 @@ public class DiagramController {
     public CommonResult<Diagram> loadData(@RequestBody Diagram diagram) {
         return ResultHelper.single(diagramManager.loadData(diagram.getId(), true));
     }
+
+    /**
+     * 系统图状态变更
+     *
+     * @return 是否成功
+     */
+    @ApiOperation("系统图状态变更")
+    @PostMapping("/update/state")
+    public CommonResult<Boolean> updateState(@RequestBody Map<String, String> params) {
+        return ResultHelper.single(dataStrategy.updateState(params.get("state"), params.get("id")));
+    }
+
+    /**
+     * 查看系统实例是否有发布状态的系统图
+     *
+     * @return 是否成功
+     */
+    @ApiOperation("查看系统实例是否有发布状态的系统图")
+    @PostMapping("/system/instance/diagram/list")
+    public CommonResult<Map<String, Boolean>> querySystemInstanceDiagramList() {
+        return ResultHelper.single(dataStrategy.querySystemInstanceDiagramList());
+    }
 }

+ 158 - 6
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DataStrategy.java

@@ -7,6 +7,7 @@ import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
 import com.persagy.adm.diagram.entity.DiagramType;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * IO策略接口
@@ -15,53 +16,188 @@ import java.util.List;
  */
 public interface DataStrategy {
 
-    String implQualifier = "dataStrategyImpl";
+    String IMPL_QUALIFIER = "dataStrategyImpl";
 
+    /**
+     * 获取或有系统类型
+     *
+     * @return
+     */
     List<DiagramType> getDiagramTypes();
 
-    //模板
+    /**
+     * 获取所有模板
+     *
+     * @return 列表
+     */
     List<DiagramTemplate> getTemplates();
 
+    /**
+     * 根据系统图类型获取所有模板
+     *
+     * @param diagramType 系统图类型
+     * @return 列表
+     */
     List<DiagramTemplate> getTemplates(String diagramType);
 
+    /**
+     * 保存模板
+     *
+     * @param template 模板信息
+     * @return 列表
+     */
     DiagramTemplate saveTemplate(DiagramTemplate template);
 
+    /**
+     * 删除模板
+     *
+     * @param templateId 模板id
+     * @return
+     */
     boolean deleteTemplate(String templateId);
 
+    /**
+     * 根据模板id获取信息
+     *
+     * @param templateId 模板id
+     * @return 模板信息
+     */
     DiagramTemplate getTemplate(String templateId);
 
 
-    //图例
+    /**
+     * 根据系统code获取图例列表
+     *
+     * @param systemCode 系统code
+     * @return 图例列表
+     */
     List<Legend> getLegends(String systemCode);
 
+    /**
+     * 保存图例
+     *
+     * @param legend     图例信息
+     * @param systemCode 系统code
+     * @return 图例信息
+     */
     Legend saveLegend(Legend legend, String systemCode);
 
+    /**
+     * 删除图例
+     *
+     * @param legendId   图例id
+     * @param systemCode 系统code
+     * @return 是否成功
+     */
     boolean deleteLegend(String legendId, String systemCode);
 
+    /**
+     * 根据图例id 系统code 获取图例信息
+     *
+     * @param legendId   图例id
+     * @param systemCode 系统code
+     * @return 图例信息
+     */
     Legend getLegend(String legendId, String systemCode);
 
+    /**
+     * 根据设备类型获取图例信息
+     *
+     * @param equipmentType 设备类型
+     * @return
+     */
     List<Legend> getLegendsForEquipment(String equipmentType);
 
 
-    //系统图
+    /**
+     * 根据项目id 系统实例id 集团code 获取系统图列表
+     *
+     * @param projectId 项目id
+     * @param systemId  系统实例id
+     * @param groupCode 集团code
+     * @return 列表数据
+     */
     List<Diagram> getDiagrams(String projectId, String systemId, String groupCode);
 
-    List<Diagram> getDiagrams(String diagramType, String projectId, String systemId, String groupCode, String name); //按系统图类型查询
+    /**
+     * 按系统图类型查询
+     *
+     * @param diagramType 系统图类型
+     * @param projectId   项目id
+     * @param systemId    系统实例id
+     * @param groupCode   集团code
+     * @param name        名称
+     * @param flag        标识
+     * @return 列表数据
+     */
+    List<Diagram> getDiagrams(String diagramType, String projectId, String systemId,
+                              String groupCode, String name, Boolean flag);
 
+    /**
+     * 保存系统图
+     *
+     * @param diagram 系统图信息
+     * @return 系统图信息
+     */
     Diagram saveDiagram(Diagram diagram);
 
+    /**
+     * 删除系统图
+     *
+     * @param diagramId 系统图id
+     * @return 是否成功
+     */
     boolean deleteDiagram(String diagramId);
 
+    /**
+     * 根据系统id获取系统图信息
+     *
+     * @param diagramId 系统图id
+     * @return 系统图数据
+     */
     Diagram getDiagram(String diagramId);
 
 
-    //系统图数据
+    /**
+     * 系统图数据
+     *
+     * @param equipmentTypes 设备类型列表
+     * @param projectId      项目id
+     * @param systemId       系统实例id
+     * @param groupCode      集团code
+     * @return 列表数据
+     */
     List<ObjectNode> loadObjectsByType(List<String> equipmentTypes, String projectId, String systemId, String groupCode);
 
+    /**
+     * 根据关联类型、节点id列表、项目id 集团code获取信息
+     *
+     * @param relationTypes 关联类型列表
+     * @param objectIds     节点id列表
+     * @param projectId     项目id
+     * @param groupCode     集团code
+     * @return 列表数据
+     */
     List<ObjectNode> loadRelationsByType(List<String[]> relationTypes, List<String> objectIds, String projectId, String groupCode);
 
+    /**
+     * 根据节点id列表、项目id、集团code获取列表数据
+     *
+     * @param objectIds 节点id列表
+     * @param projectId 项目id
+     * @param groupCode 集团code
+     * @return 列表数据
+     */
     List<ObjectNode> loadObjectsById(List<String> objectIds, String projectId, String groupCode);
 
+    /**
+     * 根据关联id列表 项目id 集团code获取关联数据
+     *
+     * @param relationIds 关联关系id列表
+     * @param projectId   项目id
+     * @param groupCode   集团code
+     * @return 列表数据
+     */
     List<ObjectNode> loadRelationsById(List<String> relationIds, String projectId, String groupCode);
 
     /**
@@ -87,4 +223,20 @@ public interface DataStrategy {
      * @return
      */
     List<ObjectNode> loadSystemTypeTemplate(Diagram diagram);
+
+    /**
+     * 更新系统图状态
+     *
+     * @param state 状态
+     * @param id
+     * @return
+     */
+    boolean updateState(String state, String id);
+
+    /**
+     * 获取系统实例下是否有系统图
+     *
+     * @return 例如: {"系统图实例id1":true,"系统图实例id2":false}
+     */
+    Map<String, Boolean> querySystemInstanceDiagramList();
 }

+ 48 - 11
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java

@@ -41,7 +41,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -262,7 +262,8 @@ public class DataStrategyImpl implements DataStrategy {
      */
     @Override
     public List<Diagram> getDiagrams(String projectId, String systemId, String groupCode) {
-        List<DiagramEntity> diagrams = diagramMapper.getDiagrams(null, projectId, systemId, groupCode, null);
+        List<DiagramEntity> diagrams = diagramMapper.getDiagrams(null, projectId,
+                systemId, groupCode, null, true);
         if (CollectionUtil.isNotEmpty(diagrams)) {
             return diagrams.stream().map(diagramEntity ->
                     modelAdapter.toDiagram(diagramEntity)).collect(Collectors.toList());
@@ -282,7 +283,7 @@ public class DataStrategyImpl implements DataStrategy {
      */
     @Override
     public List<Diagram> getDiagrams(String diagramType, String projectId,
-                                     String systemId, String groupCode, String name) {
+                                     String systemId, String groupCode, String name,Boolean flag) {
 
         Set<DiagramEntity> result = new HashSet<>();
         //所有系统实例
@@ -304,7 +305,7 @@ public class DataStrategyImpl implements DataStrategy {
         }
         //直接去系统图表根据名称模糊查询查出来的数据
         List<DiagramEntity> diagrams = diagramMapper.getDiagrams(diagramType,
-                projectId, systemId, groupCode, name);
+                projectId, systemId, groupCode, name, flag);
         //合并
         result.addAll(diagrams);
 
@@ -339,6 +340,7 @@ public class DataStrategyImpl implements DataStrategy {
             }
         }
         diagram.setId(IdUtil.simpleUUID());
+        diagram.setExtraProp("state", "Draft");
         diagramMapper.saveDiagram(modelAdapter.toDiagramEntity(diagram));
         return diagram;
     }
@@ -434,9 +436,9 @@ public class DataStrategyImpl implements DataStrategy {
     /**
      * 查询obj_from 和 objTo 的数据
      *
-     * @param projectId 项目id
-     * @param groupCode 集团code
-     * @param objectIds 对象id列表
+     * @param projectId  项目id
+     * @param groupCode  集团code
+     * @param objectIds  对象id列表
      * @param graphTypes 关系的图类型(同时处理图类型和边类型不太可行,优选图类型过滤)
      * @return
      */
@@ -445,16 +447,18 @@ public class DataStrategyImpl implements DataStrategy {
 
         //graph_code
         ArrayNode graphCode = objectMapper.createArrayNode();
-        if(graphTypes.size() > 0)
-            graphTypes.forEach(code -> graphCode.add(code));
+        if (graphTypes.size() > 0) {
+            graphTypes.forEach(graphCode::add);
+        }
 
         //obj_from
         CompletableFuture<List<ObjectRelation>> fromFuture = CompletableFuture.supplyAsync(() -> {
             QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper);
             ArrayNode objFrom = criteria.getCriteria().putArray(ObjectRelation.OBJ_FROM_HUM);
             Optional.ofNullable(objectIds).ifPresent(strings -> strings.forEach(objFrom::add));
-            if(graphCode.size() > 0)
+            if (graphCode.size() > 0) {
                 criteria.getCriteria().set(ObjectRelation.GRAPH_CODE_HUM, graphCode);
+            }
             return DigitalRelationFacade.query(groupCode, projectId, null, null, criteria);
         }, executor);
         //obj_to
@@ -462,8 +466,9 @@ public class DataStrategyImpl implements DataStrategy {
             QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper);
             ArrayNode objTo = criteria.getCriteria().putArray(ObjectRelation.OBJ_TO_HUM);
             Optional.ofNullable(objectIds).ifPresent(strings -> strings.forEach(objTo::add));
-            if(graphCode.size() > 0)
+            if (graphCode.size() > 0) {
                 criteria.getCriteria().set(ObjectRelation.GRAPH_CODE_HUM, graphCode);
+            }
             return DigitalRelationFacade.query(groupCode, projectId, null, null, criteria);
         }, executor);
 
@@ -650,4 +655,36 @@ public class DataStrategyImpl implements DataStrategy {
 
         return objectNodes;
     }
+
+    @Override
+    public boolean updateState(String state, String id) {
+        if (StrUtil.isBlank(state) || StrUtil.isBlank(id)) {
+            throw new BusinessException(ResponseCode.A0400.getCode(), "主键id或者状态参数为空");
+        }
+        DiagramEntity entity = new DiagramEntity();
+        entity.setId(id);
+        entity.setState(state);
+        diagramMapper.updateById(entity);
+        return true;
+    }
+
+    /**
+     * 获取系统实例下是否有系统图
+     *
+     * @return 例如: {"系统图实例id1":true,"系统图实例id2":false}
+     */
+    @Override
+    public Map<String, Boolean> querySystemInstanceDiagramList() {
+        BdtpRequest req = BdtpRequest.getCurrent();
+        String groupCode = req.getGroupCode();
+        String projectId = req.getProjectId();
+        HashMap<String, Boolean> result = new HashMap<>();
+        List<DiagramEntity> diagrams = diagramMapper.getDiagrams(null, projectId,
+                null, groupCode, null, false);
+        if (CollectionUtil.isNotEmpty(diagrams)) {
+            diagrams.stream().collect(Collectors.groupingBy(DiagramEntity::getSystemId))
+                    .forEach((s, diagramEntities) -> result.put(s, CollectionUtil.isNotEmpty(diagramEntities)));
+        }
+        return result;
+    }
 }

+ 4 - 2
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/ConnectPoint.java

@@ -52,8 +52,9 @@ public class ConnectPoint {
 	 * 如果hostObj为EquipmentNode类型,则返回
 	 */
 	public EquipmentNode getEquipmentNode(){
-		if(hostObj instanceof EquipmentNode)
+		if(hostObj instanceof EquipmentNode) {
 			return (EquipmentNode) hostObj;
+		}
 		return null;
 	}
 
@@ -61,8 +62,9 @@ public class ConnectPoint {
 	 * 如果hostObj为MainPipe类型,则返回
 	 */
 	public MainPipe getMainPipe(){
-		if(hostObj instanceof MainPipe)
+		if(hostObj instanceof MainPipe) {
 			return (MainPipe) hostObj;
+		}
 		return null;
 	}
 

+ 14 - 7
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/AbstractComponent.java

@@ -11,8 +11,10 @@ import java.util.Map;
  * @author zhaoyk
  */
 abstract public class AbstractComponent implements IComponent {
-
-	@Expose //使用gson保存文件
+	/**
+	 * 使用gson保存文件
+	 */
+	@Expose
 	protected String id;
 
 	@Expose
@@ -20,8 +22,10 @@ abstract public class AbstractComponent implements IComponent {
 
 	@Expose
 	protected String compType;
-
-	@JsonIgnore //使用jackson输出到web端
+	/**
+	 * 使用jackson输出到web端
+	 */
+	@JsonIgnore
 	protected IContainer parent;
 
 	@Expose
@@ -140,16 +144,18 @@ abstract public class AbstractComponent implements IComponent {
 	}
 
 	public void setProp(String name, Object value){
-		if (props == null)
+		if (props == null) {
 			props = new HashMap<>();
+		}
 		props.put(name, value);
 	}
 
 	public void removeProp(String name) {
 		if (props != null) {
 			props.remove(name);
-			if (props.size() == 0)
+			if (props.size() == 0) {
 				props = null;
+			}
 		}
 	}
 
@@ -165,8 +171,9 @@ abstract public class AbstractComponent implements IComponent {
 		IComponent c = this;
 		while (c != null){
 			XY pos = c.getLocation();
-			if(pos == null)
+			if(pos == null) {
 				return null;
+			}
 
 			p.x += pos.x;
 			p.y += pos.y;

+ 24 - 12
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/Container.java

@@ -68,6 +68,7 @@ public class Container extends AbstractComponent implements IContainer {
 		return layout;
 	}
 
+	@Override
 	public void setLayout(Layout layout) {
 		this.layout = layout;
 	}
@@ -82,22 +83,26 @@ public class Container extends AbstractComponent implements IContainer {
 		for(IComponent comp : getArrangedElements()){
 			if(comp.isHidden()) {
 				if(comp instanceof Container) {
-					comp.setLocation(new XY(p.x, p.y)); //给定一个位置,方便计算干管
+					//给定一个位置,方便计算干管
+					comp.setLocation(new XY(p.x, p.y));
 					((Container) comp).setSize(new XY(0, 0));
 				}
 				continue;
 			}
 
 			PositionData compPd = comp.getPosition();
-			if(compPd == null)
+			if(compPd == null) {
 				compPd = new PositionData();
+			}
 
 			if(row){
-				if(idx != 0)
+				if(idx != 0) {
 					p.y += layout.spaceV;
+				}
 			} else {
-				if(idx != 0)
+				if(idx != 0) {
 					p.x += layout.spaceH;
+				}
 			}
 
 			comp.setLocation(new XY(p.x + compPd.paddingLeft, p.y + compPd.paddingTop));
@@ -124,17 +129,20 @@ public class Container extends AbstractComponent implements IContainer {
 			size.y = layout.marginTop + childMax + layout.marginBottom;
 		}
 
-		if(size.y < position.minH)
+		if(size.y < position.minH) {
 			size.y = position.minH;
-		if(size.x < position.minW)
+		}
+		if(size.x < position.minW) {
 			size.x = position.minW;
+		}
 
 		//自由定位的组件
 		for(IComponent comp : getScatteredElements()) {
 			comp.layout();
 
-			if(comp.getPosition().getAbsolutePoint() != null)
+			if(comp.getPosition().getAbsolutePoint() != null) {
 				comp.setLocation(comp.getPosition().getAbsolutePoint());
+			}
 		}
 	}
 
@@ -148,8 +156,9 @@ public class Container extends AbstractComponent implements IContainer {
 		children.add(child);
 		child.setParent(this);
 
-		if(child.getPosition() == null)
+		if(child.getPosition() == null) {
 			child.setPosition(child.defaultPosition());
+		}
 	}
 
 	@Override
@@ -167,7 +176,7 @@ public class Container extends AbstractComponent implements IContainer {
 	}
 
 	public List<IComponent> getScatteredElements(){
-		return children.stream().filter(comp -> comp.isAbsolutePosition()).collect(Collectors.toList());
+		return children.stream().filter(IComponent::isAbsolutePosition).collect(Collectors.toList());
 	}
 
 	@Override
@@ -230,19 +239,22 @@ public class Container extends AbstractComponent implements IContainer {
 
 		for (IComponent comp : cs) {
 			addComp(comp);
-			if (comp instanceof Container)
+			if (comp instanceof Container) {
 				((Container) comp).initParent();
+			}
 		}
 	}
 
 	public IComponent findComponent(String componentId){
 		for(IComponent comp : children) {
-			if(comp.getId().equals(componentId))
+			if(comp.getId().equals(componentId)) {
 				return comp;
+			}
 			if(comp instanceof Container) {
 				IComponent rtn = ((Container) comp).findComponent(componentId);
-				if(rtn != null)
+				if(rtn != null) {
 					return rtn;
+				}
 			}
 		}
 		return null;

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/PositionData.java

@@ -45,8 +45,9 @@ public class PositionData {
 	public void setAbsolute(boolean absolute) {
 		this.absolute = absolute;
 
-		if(!absolute)
+		if(!absolute) {
 			absolutePoint = null;
+		}
 	}
 
 	public XY getAbsolutePoint() {

+ 12 - 6
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Anchor.java

@@ -74,8 +74,9 @@ public class Anchor {
 	}
 
 	public void addLine(Line line) {
-		if(lines == null)
+		if(lines == null) {
 			lines = new ArrayList<>();
+		}
 		lines.add(line);
 	}
 
@@ -159,23 +160,28 @@ public class Anchor {
 		int part = 6;
 		switch (c1){
 			case 'T':
-				if(c2 == 'L')
+				if(c2 == 'L') {
 					return new XY(legendLocation);
-				if(c2 == 'R')
+				}
+				if(c2 == 'R') {
 					return new XY(legendLocation.x + legendSize.x, legendLocation.y);
+				}
 				return new XY(legendLocation.x + legendSize.x / part * idx, legendLocation.y);
 			case 'B':
-				if(c2 == 'L')
+				if(c2 == 'L') {
 					return new XY(legendLocation.x, legendLocation.y + legendSize.y);
-				if(c2 == 'R')
+				}
+				if(c2 == 'R') {
 					return new XY(legendLocation.x + legendSize.x, legendLocation.y + legendSize.y);
+				}
 				return new XY(legendLocation.x + legendSize.x / part * idx, legendLocation.y + legendSize.y);
 			case 'L':
 				return new XY(legendLocation.x, legendLocation.y + legendSize.y / part * idx);
 			case 'R':
 				return new XY(legendLocation.x + legendSize.x, legendLocation.y + legendSize.y / part * idx);
+			default:
+				return null;
 		}
-		return null;
 	}
 
 }

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Legend.java

@@ -69,8 +69,9 @@ public class Legend {
 	public Anchor getAnchor(String code){
 		if(anchors != null){
 			for(Anchor anchor : anchors) {
-				if(anchor.getCode().equals(code))
+				if(anchor.getCode().equals(code)) {
 					return anchor;
+				}
 			}
 		}
 		return null;

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/AndFilter.java

@@ -13,8 +13,9 @@ public class AndFilter extends LogicFilter {
 	@Override
 	protected boolean judge(Object data) {
 		for(DataFilter item : items) {
-			if(!item.filter(data))
+			if(!item.filter(data)) {
 				return false;
+			}
 		}
 		return true;
 	}

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/LogicFilter.java

@@ -26,8 +26,9 @@ abstract public class LogicFilter extends DataFilter {
 	}
 
 	public void addItem(DataFilter item) {
-		if(items == null)
+		if(items == null) {
 			items = new ArrayList<>();
+		}
 		items.add(item);
 	}
 

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/MatchFilter.java

@@ -67,8 +67,9 @@ public class MatchFilter extends DataFilter {
 			String strData = data != null ? data.toString() : "";
 			String[] arr = value.split(";");
 			for(String s : arr) {
-				if(!strData.contains(s))
+				if(!strData.contains(s)) {
 					return false;
+				}
 			}
 			return true;
 		}

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/OrFilter.java

@@ -13,8 +13,9 @@ public class OrFilter extends LogicFilter {
 	@Override
 	protected boolean judge(Object data) {
 		for(DataFilter item : items) {
-			if(!item.filter(data))
+			if(!item.filter(data)) {
 				return true;
+			}
 		}
 		return false;
 	}

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/ContainerRefPoint.java

@@ -79,8 +79,9 @@ public class ContainerRefPoint {
 	public static ContainerRefPoint getRefPoint(Container container, String name, XY conLocation) {
 		List<ContainerRefPoint> list = getRefPoints(container, conLocation);
 		for(ContainerRefPoint p : list) {
-			if(p.getName().equalsIgnoreCase(name))
+			if(p.getName().equalsIgnoreCase(name)) {
 				return p;
+			}
 		}
 		return null;
 	}

+ 14 - 7
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/DiagramTemplate.java

@@ -143,8 +143,9 @@ public class DiagramTemplate {
 				if (comp instanceof Container) {
 					Container subCon = (Container)comp;
 					if(subCon.isAbsolutePosition()){
-						if(scatteredContainers == null)
+						if(scatteredContainers == null) {
 							scatteredContainers = new ArrayList<>();
+						}
 						scatteredContainers.add(subCon);
 
 						con.getChildren().remove(i);
@@ -169,17 +170,20 @@ public class DiagramTemplate {
 	}
 
 	public Container getContainerById(String containerId) {
-		if(frame.getId().equals(containerId))
+		if(frame.getId().equals(containerId)) {
 			return frame;
+		}
 
 		IComponent comp = frame.findComponent(containerId);
-		if(comp instanceof Container)
+		if(comp instanceof Container) {
 			return (Container)comp;
+		}
 
 		if (scatteredContainers != null) {
 			for(Container con : scatteredContainers){
-				if(con.getId().equals(containerId))
+				if(con.getId().equals(containerId)) {
 					return con;
+				}
 			}
 		}
 
@@ -189,8 +193,9 @@ public class DiagramTemplate {
 	public MainPipe getMainPipeById(String mainPipeId) {
 		if(mainPipes != null) {
 			for (MainPipe mainPipe : mainPipes) {
-				if (mainPipe.getId().equals(mainPipeId))
+				if (mainPipe.getId().equals(mainPipeId)) {
 					return mainPipe;
+				}
 			}
 		}
 		return null;
@@ -217,8 +222,9 @@ public class DiagramTemplate {
 		List<Container> list = new ArrayList<>();
 		getContainers(frame, list);
 
-		if(scatteredContainers != null)
+		if(scatteredContainers != null) {
 			list.addAll(scatteredContainers);
+		}
 
 		return list;
 	}
@@ -228,8 +234,9 @@ public class DiagramTemplate {
 
 		if(con.getChildren() != null) {
 			for(IComponent comp : con.getChildren()) {
-				if (comp instanceof Container)
+				if (comp instanceof Container) {
 					getContainers((Container) comp, list);
+				}
 			}
 		}
 	}

+ 4 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/MainPipe.java

@@ -50,18 +50,22 @@ public class MainPipe extends AbstractLine implements IEquipHolder {
 	 */
 	private List<List<XY>> locationPath;
 
+	@Override
 	public String getId() {
 		return id;
 	}
 
+	@Override
 	public void setId(String id) {
 		this.id = id;
 	}
 
+	@Override
 	public String getName() {
 		return name;
 	}
 
+	@Override
 	public void setName(String name) {
 		this.name = name;
 	}

+ 2 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/virtual/PackNode.java

@@ -35,8 +35,9 @@ public class PackNode extends EquipmentNode {
 	}
 
 	public void add(String equipClassCode) {
-		if(statInfo == null)
+		if(statInfo == null) {
 			statInfo = new HashMap<>();
+		}
 
 		Integer i = statInfo.get(equipClassCode);
 		statInfo.put(equipClassCode, i == null ? 1 : i + 1);

+ 10 - 10
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GsonUtil.java

@@ -52,17 +52,17 @@ public class GsonUtil {
 		public IComponent deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
 			Class<? extends IComponent> target = null;
 			String compType = jsonElement.getAsJsonObject().get("compType").getAsString();
-			if(Container.TYPE.equals(compType))
+			if(Container.TYPE.equals(compType)) {
 				target = Container.class;
-			else if(EquipmentNode.TYPE.equals(compType))
+			} else if(EquipmentNode.TYPE.equals(compType)) {
 				target = EquipmentNode.class;
-			else if(PackNode.TYPE.equals(compType))
+			} else if(PackNode.TYPE.equals(compType)) {
 				target = PackNode.class;
-			else if(Label.TYPE.equals(compType))
+			} else if(Label.TYPE.equals(compType)) {
 				target = Label.class;
-			else if(DataPanelNode.TYPE.equals(compType))
+			} else if(DataPanelNode.TYPE.equals(compType)) {
 				target = DataPanelNode.class;
-			else {
+			} else {
 				//TODO 其他类型
 			}
 			return gson.fromJson(jsonElement, target);
@@ -81,13 +81,13 @@ public class GsonUtil {
 		public DataFilter deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
 			Class<? extends DataFilter> target = null;
 			int fType = jsonElement.getAsJsonObject().get("type").getAsInt();
-			if(fType == DataFilter.TYPE_MATCH)
+			if(fType == DataFilter.TYPE_MATCH) {
 				target = MatchFilter.class;
-			else if(fType == AndFilter.TYPE_AND)
+			} else if(fType == AndFilter.TYPE_AND) {
 				target = AndFilter.class;
-			else if(fType == OrFilter.TYPE_OR)
+			} else if(fType == OrFilter.TYPE_OR) {
 				target = OrFilter.class;
-			else {
+			} else {
 				//TODO 其他类型
 			}
 			return gson.fromJson(jsonElement, target);

+ 36 - 3
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/dao/DiagramMapper.java

@@ -15,20 +15,53 @@ import java.util.List;
 public interface DiagramMapper extends BaseMapper<DiagramEntity> {
 
 
-    //按系统图类型查询
+    /**
+     * 按系统图类型查询
+     *
+     * @param diagramType 系统图类型
+     * @param projectId   项目id
+     * @param systemId    系统实例id
+     * @param groupCode   集团code
+     * @param name        名称
+     * @param flag        根据标识查出特定数据(true:查出所有数据,false:只查发布状态数据)
+     * @return 系统图列表
+     */
     List<DiagramEntity> getDiagrams(@Param("diagramType") String diagramType,
                                     @Param("projectId") String projectId,
                                     @Param("systemId") String systemId,
                                     @Param("groupCode") String groupCode,
-                                    @Param("name") String name);
+                                    @Param("name") String name,
+                                    @Param("flag") Boolean flag);
 
-    //按系统图类型查询
+    /**
+     * 根据系统实例id进行查询
+     *
+     * @param ids 系统实例id列表
+     * @return 系统图列表
+     */
     List<DiagramEntity> getDiagramsBySystemIds(@Param("systemIds") List<String> ids);
 
+    /**
+     * 系统图保存
+     *
+     * @param diagramEntity 系统图信息
+     */
     void saveDiagram(DiagramEntity diagramEntity);
 
+    /**
+     * 删除系统图
+     *
+     * @param diagramId 系统图id
+     * @return 是否成功
+     */
     boolean deleteByDiagramId(String diagramId);
 
+    /**
+     * 获取系统图信息
+     *
+     * @param diagramId 系统图id
+     * @return 系统图信息
+     */
     DiagramEntity getDiagram(String diagramId);
 
 }

+ 390 - 363
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java

@@ -4,12 +4,12 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.adm.diagram.entity.DiagramType;
 import com.persagy.adm.diagram.core.ContentParser;
 import com.persagy.adm.diagram.core.DataStrategy;
 import com.persagy.adm.diagram.core.model.Diagram;
 import com.persagy.adm.diagram.core.model.legend.Legend;
 import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
+import com.persagy.adm.diagram.entity.DiagramType;
 import com.persagy.adm.diagram.frame.BdtpRequest;
 import com.persagy.adm.diagram.service.BdtpDataService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,375 +20,402 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 测试开发使用的io策略实现类
+ *
  * @author zhaoyk
  */
 @Service
 @Qualifier("demo")
 public class DemoDataStrategy implements DataStrategy {
 
-	@Autowired
-	private ContentParser parser;
-
-	@Override
-	public List<DiagramType> getDiagramTypes() {
-		List<DiagramType> types = new ArrayList<>();
-
-		readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			DiagramType diagramType = new DiagramType();
-			diagramType.setMajor(majCode);
-			diagramType.setDSystem(sysCode);
-			diagramType.setCode(typeCode);
-			diagramType.setName(typeDir.getName());
-
-			types.add(diagramType);
-			return null;
-		});
-
-		return types;
-	}
-
-	/* 模板部分 */
-	private static final String DIR_TEMPLATE = "store/template/";
-
-	@Override
-	public List<DiagramTemplate> getTemplates() {
-		List<DiagramTemplate> rtn = new ArrayList<>();
-
-		readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			File[] files = typeDir.listFiles();
-			if(files != null) {
-				for (File f : files) {
-					try {
-						DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
-						rtn.add(template);
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-			}
-			return null;
-		});
-
-		return rtn;
-	}
-
-	private <T> T readFiles(Handler<T> handler){
-		File dir = new File(DIR_TEMPLATE);
-		File[] majList = dir.listFiles();
-		if(majList == null)
-			return null;
-
-		for(File fm : majList) {
-			String majCode = fm.getName().substring(0, 2);
-
-			File[] sysList = fm.listFiles();
-			if(sysList == null)
-				continue;
-
-			for(File fs : sysList) {
-				String sysCode = majCode + fs.getName().substring(0, 2);
-				File[] typeList = fs.listFiles();
-				if(typeList != null) {
-					for (File ft : typeList) {
-						String typeCode = sysCode + "_" + ft.getName();
-
-						T result = handler.handle(majCode, sysCode, typeCode, ft);
-						if(result != null)
-							return result;
-					}
-				}
-			}
-		}
-
-		return null;
-	}
-
-	interface Handler<T> {
-		T handle(String majCode, String sysCode, String typeCode, File typeDir);
-	}
-
-	@Override
-	public List<DiagramTemplate> getTemplates(String diagramType) {
-		List<DiagramTemplate> rtn = new ArrayList<>();
-
-		readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			if(diagramType.equals(typeCode)) {
-				File[] files = typeDir.listFiles();
-				if(files != null) {
-					for (File f : files) {
-						try {
-							DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
-							rtn.add(template);
-						} catch (Exception e) {
-							e.printStackTrace();
-						}
-					}
-				}
-			}
-			return null;
-		});
-
-		return rtn;
-	}
-
-	@Override
-	public DiagramTemplate saveTemplate(DiagramTemplate template) {
-		return readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			if(typeCode.equals(template.getDiagramType())) {
-				try {
-					String json = parser.toJson(template);
-					FileUtil.writeUtf8String(json, new File(typeDir, template.getName() + ".json"));
-					return parser.parseContent(json, DiagramTemplate.class);
-				} catch (Exception e) {
-					throw new RuntimeException(e);
-				}
-			}
-			return null;
-		});
-	}
-
-	@Override
-	public boolean deleteTemplate(String templateId) {
-		File del = readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			File[] files = typeDir.listFiles();
-			if(files != null) {
-				for (File f : files) {
-					try {
-						DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
-						if(template.getId().equals(templateId)) {
-							f.delete();
-							return f;
-						}
-					} catch (Exception e) {
-						throw new RuntimeException(e);
-					}
-				}
-			}
-			return null;
-		});
-		return del != null;
-	}
-
-	@Override
-	public DiagramTemplate getTemplate(String templateId) {
-		return readFiles((majCode, sysCode, typeCode, typeDir) -> {
-			File[] files = typeDir.listFiles();
-			if(files != null) {
-				for (File f : files) {
-					try {
-						DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
-						if(template.getId().equals(templateId))
-							return template;
-					} catch (Exception e) {
-						throw new RuntimeException(e);
-					}
-				}
-			}
-			return null;
-		});
-
-	}
-
-
-	/* 图例部分 */
-	private static final String DIR_LEGEND = "store/legend/";
-
-	@Override
-	public List<Legend> getLegends(String systemCode) {
-		File file = new File(DIR_LEGEND, systemCode + ".json");
-		if(!file.exists())
-			FileUtil.writeUtf8String("[]", file);
-
-		Legend[] legends = parser.parseContent(FileUtil.readUtf8String(file), Legend[].class);
-		ArrayList<Legend> list = new ArrayList<>();
-		Collections.addAll(list, legends);
-		return list;
-	}
-
-	@Override
-	public Legend saveLegend(Legend legend, String systemCode) {
-		List<Legend> list = getLegends(systemCode);
-
-		if(StrUtil.isBlank(legend.getId())) {
-			legend.setId(IdUtil.simpleUUID());
-			list.add(legend);
-		} else {
-			for (int i = 0; i < list.size(); i++) {
-				Legend l = list.get(i);
-				if (l.getId().equals(legend.getId())) {
-					list.set(i, legend);
-					break;
-				}
-			}
-		}
-
-		File file = new File(DIR_LEGEND, systemCode + ".json");
-		FileUtil.writeUtf8String(parser.toJson(list), file);
-
-		return legend;
-	}
-
-	@Override
-	public boolean deleteLegend(String legendId, String systemCode) {
-		List<Legend> list = getLegends(systemCode);
-
-		boolean flag = false;
-		for (int i = 0; i < list.size(); i++) {
-			Legend l = list.get(i);
-			if (l.getId().equals(legendId)) {
-				list.remove(l);
-				flag = true;
-				break;
-			}
-		}
-
-		File file = new File(DIR_LEGEND, systemCode + ".json");
-		FileUtil.writeUtf8String(parser.toJson(list), file);
-
-		return flag;
-	}
-
-	@Override
-	public Legend getLegend(String legendId, String systemCode) {
-		List<Legend> list = getLegends(systemCode);
-		for(Legend legend : list) {
-			if(legend.getId().equals(legendId))
-				return legend;
-		}
-		return null;
-	}
-
-	@Override
-	public List<Legend> getLegendsForEquipment(String equipmentType) {
-		String systemCode = equipmentType.substring(0, 4);
-
-		List<Legend> rtn = new ArrayList<>();
-		List<Legend> list = getLegends(systemCode);
-		for (Legend legend : list) {
-			if (legend.getEquipmentTypes() != null && legend.getEquipmentTypes().contains(equipmentType))
-				rtn.add(legend);
-		}
-
-		return rtn;
-	}
-
-
-	/* 系统图部分 */
-	private static final String DIR_DIAGRAM = "store/diagram/";
-
-	@Override
-	public List<Diagram> getDiagrams(String projectId, String systemId, String groupCode) {
-		return getDiagrams(null, projectId, systemId, groupCode,null);
-	}
-
-	@Override
-	public List<Diagram> getDiagrams(String diagramType, String projectId, String systemId, String groupCode,String name) {
-		ArrayList<Diagram> diagrams = new ArrayList<>();
-
-		File dir = new File(DIR_DIAGRAM);
-		File[] list = dir.listFiles();
-		if(list != null) {
-			for(File f : list) {
-				Diagram diagram = parser.parseContent(FileUtil.readUtf8String(f), Diagram.class);
-				if(projectId.equals(diagram.getProjectId())) {
-					if(StrUtil.isNotBlank(groupCode) && !groupCode.equals(diagram.getGroupCode()))
-						continue;
-					if(StrUtil.isNotBlank(diagramType) && !diagramType.equals(diagram.getType()))
-						continue;
-					if(StrUtil.isNotBlank(systemId) && !systemId.equals(diagram.getSystemId()))
-						continue;
-
-					diagrams.add(diagram);
-				}
-			}
-		}
-
-		return diagrams;
-	}
-
-	@Override
-	public Diagram saveDiagram(Diagram diagram) {
-		File file = new File(DIR_DIAGRAM, diagram.getId() + ".json");
-		FileUtil.writeUtf8String(parser.toJson(diagram), file);
-
-		return diagram;
-	}
-
-	@Override
-	public boolean deleteDiagram(String diagramId) {
-		File dir = new File(DIR_DIAGRAM);
-		File[] list = dir.listFiles();
-		if(list != null) {
-			for(File f : list) {
-				String fn = f.getName();
-				fn = fn.substring(0, fn.lastIndexOf('.'));
-				if(diagramId.equals(fn)) {
-					f.delete();
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public Diagram getDiagram(String diagramId) {
-		File file = new File(DIR_DIAGRAM, diagramId + ".json");
-		if(file.exists())
-			return parser.parseContent(FileUtil.readUtf8String(file), Diagram.class);
-		return null;
-	}
-
-
-	//系统图数据加载
-	@Autowired
-	private BdtpDataService dataService;
-
-	@Override
-	public List<ObjectNode> loadObjectsByType(List<String> equipmentTypes, String projectId, String systemId, String groupCode) {
-		BdtpRequest req = BdtpRequest.getCurrent();
-		req.setProjectId(projectId);
-		req.setGroupCode(groupCode);
-		return dataService.queryObjectsByType(req, equipmentTypes, systemId);
-	}
-
-	@Override
-	public List<ObjectNode> loadRelationsByType(List<String[]> relationTypes, List<String> objectIds, String projectId, String groupCode) {
-		BdtpRequest req = BdtpRequest.getCurrent();
-		req.setProjectId(projectId);
-		req.setGroupCode(groupCode);
-		return dataService.queryRelsByTypeAndObj(req, relationTypes, objectIds);
-	}
-
-	@Override
-	public List<ObjectNode> loadObjectsById(List<String> objectIds, String projectId, String groupCode) {
-		BdtpRequest req = BdtpRequest.getCurrent();
-		req.setProjectId(projectId);
-		req.setGroupCode(groupCode);
-		return dataService.queryObjectsById(req, objectIds);
-	}
-
-	@Override
-	public List<ObjectNode> loadRelationsById(List<String> relationIds, String projectId, String groupCode) {
-		//TODO
-		return null;
-	}
-
-	@Override
-	public List<ObjectNode> loadSystemInstance(String projectId, String groupCode) {
-		return null;
-	}
-
-	@Override
-	public List<ObjectNode> loadMajorSystemInstance() {
-		return null;
-	}
-
-	@Override
-	public List<ObjectNode> loadSystemTypeTemplate(Diagram diagram) {
-		return null;
-	}
+    @Autowired
+    private ContentParser parser;
+
+    @Override
+    public List<DiagramType> getDiagramTypes() {
+        List<DiagramType> types = new ArrayList<>();
+
+        readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            DiagramType diagramType = new DiagramType();
+            diagramType.setMajor(majCode);
+            diagramType.setDSystem(sysCode);
+            diagramType.setCode(typeCode);
+            diagramType.setName(typeDir.getName());
+
+            types.add(diagramType);
+            return null;
+        });
+
+        return types;
+    }
+
+    /* 模板部分 */
+    private static final String DIR_TEMPLATE = "store/template/";
+
+    @Override
+    public List<DiagramTemplate> getTemplates() {
+        List<DiagramTemplate> rtn = new ArrayList<>();
+
+        readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            File[] files = typeDir.listFiles();
+            if (files != null) {
+                for (File f : files) {
+                    try {
+                        DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
+                        rtn.add(template);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+            return null;
+        });
+
+        return rtn;
+    }
+
+    private <T> T readFiles(Handler<T> handler) {
+        File dir = new File(DIR_TEMPLATE);
+        File[] majList = dir.listFiles();
+        if (majList == null) {
+            return null;
+        }
+
+        for (File fm : majList) {
+            String majCode = fm.getName().substring(0, 2);
+
+            File[] sysList = fm.listFiles();
+            if (sysList == null) {
+                continue;
+            }
+
+            for (File fs : sysList) {
+                String sysCode = majCode + fs.getName().substring(0, 2);
+                File[] typeList = fs.listFiles();
+                if (typeList != null) {
+                    for (File ft : typeList) {
+                        String typeCode = sysCode + "_" + ft.getName();
+
+                        T result = handler.handle(majCode, sysCode, typeCode, ft);
+                        if (result != null) {
+                            return result;
+                        }
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+    interface Handler<T> {
+        T handle(String majCode, String sysCode, String typeCode, File typeDir);
+    }
+
+    @Override
+    public List<DiagramTemplate> getTemplates(String diagramType) {
+        List<DiagramTemplate> rtn = new ArrayList<>();
+
+        readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            if (diagramType.equals(typeCode)) {
+                File[] files = typeDir.listFiles();
+                if (files != null) {
+                    for (File f : files) {
+                        try {
+                            DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
+                            rtn.add(template);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+            return null;
+        });
+
+        return rtn;
+    }
+
+    @Override
+    public DiagramTemplate saveTemplate(DiagramTemplate template) {
+        return readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            if (typeCode.equals(template.getDiagramType())) {
+                try {
+                    String json = parser.toJson(template);
+                    FileUtil.writeUtf8String(json, new File(typeDir, template.getName() + ".json"));
+                    return parser.parseContent(json, DiagramTemplate.class);
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+            return null;
+        });
+    }
+
+    @Override
+    public boolean deleteTemplate(String templateId) {
+        File del = readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            File[] files = typeDir.listFiles();
+            if (files != null) {
+                for (File f : files) {
+                    try {
+                        DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
+                        if (template.getId().equals(templateId)) {
+                            f.delete();
+                            return f;
+                        }
+                    } catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
+            return null;
+        });
+        return del != null;
+    }
+
+    @Override
+    public DiagramTemplate getTemplate(String templateId) {
+        return readFiles((majCode, sysCode, typeCode, typeDir) -> {
+            File[] files = typeDir.listFiles();
+            if (files != null) {
+                for (File f : files) {
+                    try {
+                        DiagramTemplate template = parser.parseContent(FileUtil.readUtf8String(f), DiagramTemplate.class);
+                        if (template.getId().equals(templateId)) {
+                            return template;
+                        }
+                    } catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
+            return null;
+        });
+
+    }
+
+
+    /**
+     * 图例部分
+     */
+    private static final String DIR_LEGEND = "store/legend/";
+
+    @Override
+    public List<Legend> getLegends(String systemCode) {
+        File file = new File(DIR_LEGEND, systemCode + ".json");
+        if (!file.exists()) {
+            FileUtil.writeUtf8String("[]", file);
+        }
+
+        Legend[] legends = parser.parseContent(FileUtil.readUtf8String(file), Legend[].class);
+        ArrayList<Legend> list = new ArrayList<>();
+        Collections.addAll(list, legends);
+        return list;
+    }
+
+    @Override
+    public Legend saveLegend(Legend legend, String systemCode) {
+        List<Legend> list = getLegends(systemCode);
+
+        if (StrUtil.isBlank(legend.getId())) {
+            legend.setId(IdUtil.simpleUUID());
+            list.add(legend);
+        } else {
+            for (int i = 0; i < list.size(); i++) {
+                Legend l = list.get(i);
+                if (l.getId().equals(legend.getId())) {
+                    list.set(i, legend);
+                    break;
+                }
+            }
+        }
+
+        File file = new File(DIR_LEGEND, systemCode + ".json");
+        FileUtil.writeUtf8String(parser.toJson(list), file);
+
+        return legend;
+    }
+
+    @Override
+    public boolean deleteLegend(String legendId, String systemCode) {
+        List<Legend> list = getLegends(systemCode);
+
+        boolean flag = false;
+        for (int i = 0; i < list.size(); i++) {
+            Legend l = list.get(i);
+            if (l.getId().equals(legendId)) {
+                list.remove(l);
+                flag = true;
+                break;
+            }
+        }
+
+        File file = new File(DIR_LEGEND, systemCode + ".json");
+        FileUtil.writeUtf8String(parser.toJson(list), file);
+
+        return flag;
+    }
+
+    @Override
+    public Legend getLegend(String legendId, String systemCode) {
+        List<Legend> list = getLegends(systemCode);
+        for (Legend legend : list) {
+            if (legend.getId().equals(legendId)) {
+                return legend;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public List<Legend> getLegendsForEquipment(String equipmentType) {
+        String systemCode = equipmentType.substring(0, 4);
+
+        List<Legend> rtn = new ArrayList<>();
+        List<Legend> list = getLegends(systemCode);
+        for (Legend legend : list) {
+            if (legend.getEquipmentTypes() != null && legend.getEquipmentTypes().contains(equipmentType)) {
+                rtn.add(legend);
+            }
+        }
+
+        return rtn;
+    }
+
+
+    /**
+     * 系统图部分
+     */
+    private static final String DIR_DIAGRAM = "store/diagram/";
+
+    @Override
+    public List<Diagram> getDiagrams(String projectId, String systemId, String groupCode) {
+        return getDiagrams(null, projectId, systemId, groupCode, null, null);
+    }
+
+    @Override
+    public List<Diagram> getDiagrams(String diagramType, String projectId, String systemId, String groupCode, String name, Boolean flag) {
+        ArrayList<Diagram> diagrams = new ArrayList<>();
+
+        File dir = new File(DIR_DIAGRAM);
+        File[] list = dir.listFiles();
+        if (list != null) {
+            for (File f : list) {
+                Diagram diagram = parser.parseContent(FileUtil.readUtf8String(f), Diagram.class);
+                if (projectId.equals(diagram.getProjectId())) {
+                    if (StrUtil.isNotBlank(groupCode) && !groupCode.equals(diagram.getGroupCode())) {
+                        continue;
+                    }
+                    if (StrUtil.isNotBlank(diagramType) && !diagramType.equals(diagram.getType())) {
+                        continue;
+                    }
+                    if (StrUtil.isNotBlank(systemId) && !systemId.equals(diagram.getSystemId())) {
+                        continue;
+                    }
+
+                    diagrams.add(diagram);
+                }
+            }
+        }
+
+        return diagrams;
+    }
+
+    @Override
+    public Diagram saveDiagram(Diagram diagram) {
+        File file = new File(DIR_DIAGRAM, diagram.getId() + ".json");
+        FileUtil.writeUtf8String(parser.toJson(diagram), file);
+
+        return diagram;
+    }
+
+    @Override
+    public boolean deleteDiagram(String diagramId) {
+        File dir = new File(DIR_DIAGRAM);
+        File[] list = dir.listFiles();
+        if (list != null) {
+            for (File f : list) {
+                String fn = f.getName();
+                fn = fn.substring(0, fn.lastIndexOf('.'));
+                if (diagramId.equals(fn)) {
+                    f.delete();
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public Diagram getDiagram(String diagramId) {
+        File file = new File(DIR_DIAGRAM, diagramId + ".json");
+        if (file.exists()) {
+            return parser.parseContent(FileUtil.readUtf8String(file), Diagram.class);
+        }
+        return null;
+    }
+
+
+    //系统图数据加载
+    @Autowired
+    private BdtpDataService dataService;
+
+    @Override
+    public List<ObjectNode> loadObjectsByType(List<String> equipmentTypes, String projectId, String systemId, String groupCode) {
+        BdtpRequest req = BdtpRequest.getCurrent();
+        req.setProjectId(projectId);
+        req.setGroupCode(groupCode);
+        return dataService.queryObjectsByType(req, equipmentTypes, systemId);
+    }
+
+    @Override
+    public List<ObjectNode> loadRelationsByType(List<String[]> relationTypes, List<String> objectIds, String projectId, String groupCode) {
+        BdtpRequest req = BdtpRequest.getCurrent();
+        req.setProjectId(projectId);
+        req.setGroupCode(groupCode);
+        return dataService.queryRelsByTypeAndObj(req, relationTypes, objectIds);
+    }
+
+    @Override
+    public List<ObjectNode> loadObjectsById(List<String> objectIds, String projectId, String groupCode) {
+        BdtpRequest req = BdtpRequest.getCurrent();
+        req.setProjectId(projectId);
+        req.setGroupCode(groupCode);
+        return dataService.queryObjectsById(req, objectIds);
+    }
+
+    @Override
+    public List<ObjectNode> loadRelationsById(List<String> relationIds, String projectId, String groupCode) {
+        //TODO
+        return null;
+    }
+
+    @Override
+    public List<ObjectNode> loadSystemInstance(String projectId, String groupCode) {
+        return null;
+    }
+
+    @Override
+    public List<ObjectNode> loadMajorSystemInstance() {
+        return null;
+    }
+
+    @Override
+    public List<ObjectNode> loadSystemTypeTemplate(Diagram diagram) {
+        return null;
+    }
+
+    @Override
+    public boolean updateState(String state, String id) {
+        return false;
+    }
+
+    @Override
+    public Map<String, Boolean> querySystemInstanceDiagramList() {
+        return null;
+    }
 }

+ 2 - 10
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/entity/ModelAdapter.java

@@ -7,9 +7,6 @@ import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * 运行时模型-实体 类型转换适配器
  *
@@ -64,13 +61,7 @@ public class ModelAdapter {
     }
 
     public Diagram toDiagram(DiagramEntity diagramEntity) {
-        //Diagram diagram = parser.parseContent(diagramEntity.getDiagramContent(), Diagram.class);
-        Diagram diagram = new Diagram();
-        Map map = parser.parseContent(diagramEntity.getDiagramContent(), Map.class);
-        diagram.setLines(parser.parseContent(parser.toJson(map.get("lines")), List.class));
-        diagram.setNodes(parser.parseContent(parser.toJson(map.get("nodes")), List.class));
-        diagram.setTemplate(parser.parseContent(parser.toJson(map.get("template")), DiagramTemplate.class));
-
+        Diagram diagram = parser.parseContent(diagramEntity.getDiagramContent(), Diagram.class);
         diagram.setId(diagramEntity.getId());
         diagram.setName(diagramEntity.getName());
         diagram.setRemark(diagramEntity.getRemark());
@@ -80,6 +71,7 @@ public class ModelAdapter {
         diagram.setProjectId(diagramEntity.getProjectId());
         diagram.setSystemId(diagramEntity.getSystemId());
         diagram.setGroupCode(diagramEntity.getGroupCode());
+        diagram.setCreateTime(diagramEntity.getCreationTime());
         diagram.setExtraProp("state", diagramEntity.getState());
         return diagram;
     }

+ 8 - 5
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/DemoDiagramManager.java

@@ -31,7 +31,7 @@ public class DemoDiagramManager {
 	private ContentParser parser;
 
 	@Autowired
-	public DemoDiagramManager(@Qualifier(DataStrategy.implQualifier) DataStrategy dataStrategy) {
+	public DemoDiagramManager(@Qualifier(DataStrategy.IMPL_QUALIFIER) DataStrategy dataStrategy) {
 		this.dataStrategy = dataStrategy;
 	}
 
@@ -64,8 +64,9 @@ public class DemoDiagramManager {
 			ft.setType(Folder.TYPE_TYPE);
 
 			for(Diagram diagram : diagrams){
-				if(diagram.getType().equals(type.getCode()))
+				if(diagram.getType().equals(type.getCode())) {
 					ft.getChildren().add(diagram);
+				}
 			}
 		}
 
@@ -73,17 +74,19 @@ public class DemoDiagramManager {
 	}
 
 	private void loadTemplate(Diagram diagram){
-		if (diagram.getTemplateId() != null)
+		if (diagram.getTemplateId() != null) {
 			diagram.setTemplate(dataStrategy.getTemplate(diagram.getTemplateId()));
+		}
 	}
 
-	private void buildDiagram(Diagram diagram, boolean layout){
+	public void buildDiagram(Diagram diagram, boolean layout){
 		loadTemplate(diagram);
 		diagram.init();
 		new DiagramDataLoader(diagram, dataStrategy).initLoad();
 
-		if(layout)
+		if(layout) {
 			diagram.layout(new DiagramBuilder(diagram, dataStrategy));
+		}
 	}
 
 	/**

+ 5 - 3
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/Folder.java

@@ -45,10 +45,11 @@ public class Folder {
 			target.setId(code);
 			target.setType(type);
 
-			if(Folder.TYPE_MAJ.equals(type))
+			if(Folder.TYPE_MAJ.equals(type)) {
 				target.setName(getFolderName(code, dictInfoList));
-			else if(Folder.TYPE_SYS.equals(type))
+			} else if(Folder.TYPE_SYS.equals(type)) {
 				target.setName(getFolderName(code, dictInfoList));
+			}
 
 			folders.add(target);
 		}
@@ -59,8 +60,9 @@ public class Folder {
 		for(ObjectNode node : dictInfoList) {
 			if(node.get("code").asText().equals(code)) {
 				JsonNode nameNode = node.get("name");
-				if(nameNode == null)
+				if(nameNode == null) {
 					nameNode = node.get("label");
+				}
 				return nameNode.asText();
 			}
 		}

+ 3 - 4
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/LegendManager.java

@@ -14,7 +14,6 @@ import org.springframework.stereotype.Service;
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -31,7 +30,7 @@ public class LegendManager {
 	private ContentParser parser;
 
 	@Autowired
-	public LegendManager(@Qualifier(DataStrategy.implQualifier) DataStrategy dataStrategy) {
+	public LegendManager(@Qualifier(DataStrategy.IMPL_QUALIFIER) DataStrategy dataStrategy) {
 		this.dataStrategy = dataStrategy;
 	}
 
@@ -113,8 +112,8 @@ public class LegendManager {
 	@Autowired
 	private GsonUtil gsonUtil;
 	public boolean fixDiagramType(){
-		String DIR_LEGEND = "store/legend/";
-		File dir = new File(DIR_LEGEND);
+		String dirLegend = "store/legend/";
+		File dir = new File(dirLegend);
 		for(File file : dir.listFiles()) {
 			String fn = file.getName();
 			String sys = fn.substring(0, fn.lastIndexOf('.'));

+ 373 - 358
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/TemplateManager.java

@@ -28,384 +28,399 @@ import java.util.Map;
 
 /**
  * 模板编辑的相关操作
+ *
  * @author zhaoyk
  */
 @Service
 public class TemplateManager {
 
-	private final DataStrategy dataStrategy;
+    private final DataStrategy dataStrategy;
 
-	@Autowired
-	public TemplateManager(@Qualifier(DataStrategy.implQualifier) DataStrategy dataStrategy) {
-		this.dataStrategy = dataStrategy;
-	}
+    @Autowired
+    public TemplateManager(@Qualifier(DataStrategy.IMPL_QUALIFIER) DataStrategy dataStrategy) {
+        this.dataStrategy = dataStrategy;
+    }
 
-	@Autowired
-	private ContentParser contentParser;
+    @Autowired
+    private ContentParser contentParser;
 
-	@Autowired
-	private BdtpDataService bdtpDataService;
+    @Autowired
+    private BdtpDataService bdtpDataService;
 
-	/**
-	 * 查询系统图模板,树形结构
-	 */
-	public List<Folder> getTemplates(){
-		List<DiagramType> types = dataStrategy.getDiagramTypes();
+    /**
+     * 查询系统图模板,树形结构
+     */
+    public List<Folder> getTemplates() {
+        List<DiagramType> types = dataStrategy.getDiagramTypes();
 
-		List<DiagramTemplate> templates = dataStrategy.getTemplates();
-		for(DiagramTemplate template : templates) {
-			buildTemplate(template);
-		}
+        List<DiagramTemplate> templates = dataStrategy.getTemplates();
+        for (DiagramTemplate template : templates) {
+            buildTemplate(template);
+        }
 
-		BdtpRequest req = BdtpRequest.getCurrent();
+        BdtpRequest req = BdtpRequest.getCurrent();
 //		List<ObjectNode> maj = bdtpDataService.getMajorList(req);
 //		List<ObjectNode> sys = bdtpDataService.getSystemList(req);
-		//TODO debug
-		List<ObjectNode> maj = new ArrayList<>();
-		List<ObjectNode> sys = new ArrayList<>();
-
-		List<Folder> folders = new ArrayList<>();
-		for (DiagramType type : types) {
-			Folder fm = Folder.getFolder(type.getMajor(), Folder.TYPE_MAJ, folders, maj);
-			Folder fs = Folder.getFolder(type.getDSystem(), Folder.TYPE_SYS, (List)fm.getChildren(), sys);
-
-			Folder ft = new Folder();
-			fs.getChildren().add(ft);
-			ft.setName(type.getName());
-			ft.setId(type.getCode());
-			ft.setType(Folder.TYPE_TYPE);
-
-			for(DiagramTemplate template : templates){
-				if(template.getDiagramType().equals(type.getCode()))
+        //TODO debug
+        List<ObjectNode> maj = new ArrayList<>();
+        List<ObjectNode> sys = new ArrayList<>();
+
+        List<Folder> folders = new ArrayList<>();
+        for (DiagramType type : types) {
+            Folder fm = Folder.getFolder(type.getMajor(), Folder.TYPE_MAJ, folders, maj);
+            Folder fs = Folder.getFolder(type.getDSystem(), Folder.TYPE_SYS, (List) fm.getChildren(), sys);
+
+            Folder ft = new Folder();
+            fs.getChildren().add(ft);
+            ft.setName(type.getName());
+            ft.setId(type.getCode());
+            ft.setType(Folder.TYPE_TYPE);
+
+            for (DiagramTemplate template : templates) {
+                if (template.getDiagramType().equals(type.getCode())) {
 					ft.getChildren().add(template);
-			}
-		}
-
-		return folders;
-	}
-
-	/**
-	 * 查询某个系统图类型下的模板列表
-	 */
-	public List<DiagramTemplate> getTemplates(String diagramType) {
-		return dataStrategy.getTemplates(diagramType);
-	}
-
-	/**
-	 * 创建新的模板
-	 */
-	public DiagramTemplate createTemplate(String name, String type){
-		DiagramTemplate template = DiagramTemplate.defaultTemplate();
-
-		template.setName(name);
-		template.setDiagramType(type);
-		template.setId(IdUtil.simpleUUID());
-
-		template.setMainPipes(new ArrayList<>());
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 删除模板
-	 */
-	public boolean deleteTemplate(String id){
-		return dataStrategy.deleteTemplate(id);
-	}
-
-	@Autowired
-	private TemplateMapper templateMapper;
-	/**
-	 * 编辑模板的基本信息
-	 */
-	public boolean editTemplateInfo(String id, Map<String, String> infos) {
-		TemplateEntity entity = templateMapper.selectById(id);
-		if(entity != null){
-			if(infos.containsKey("name"))
+				}
+            }
+        }
+
+        return folders;
+    }
+
+    /**
+     * 查询某个系统图类型下的模板列表
+     */
+    public List<DiagramTemplate> getTemplates(String diagramType) {
+        return dataStrategy.getTemplates(diagramType);
+    }
+
+    /**
+     * 创建新的模板
+     */
+    public DiagramTemplate createTemplate(String name, String type) {
+        DiagramTemplate template = DiagramTemplate.defaultTemplate();
+
+        template.setName(name);
+        template.setDiagramType(type);
+        template.setId(IdUtil.simpleUUID());
+
+        template.setMainPipes(new ArrayList<>());
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 删除模板
+     */
+    public boolean deleteTemplate(String id) {
+        return dataStrategy.deleteTemplate(id);
+    }
+
+    @Autowired
+    private TemplateMapper templateMapper;
+
+    /**
+     * 编辑模板的基本信息
+     */
+    public boolean editTemplateInfo(String id, Map<String, String> infos) {
+        TemplateEntity entity = templateMapper.selectById(id);
+        if (entity != null) {
+            if (infos.containsKey("name")) {
 				entity.setName(infos.get("name"));
-			if(infos.containsKey("code"))
+			}
+            if (infos.containsKey("code")) {
 				entity.setCode(infos.get("code"));
-			if(infos.containsKey("remark"))
+			}
+            if (infos.containsKey("remark")) {
 				entity.setRemark(infos.get("remark"));
-			templateMapper.updateById(entity);
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * 保存模板
-	 */
-	public DiagramTemplate saveTemplate(DiagramTemplate template){
-		template = dataStrategy.saveTemplate(template);
-		buildTemplate(template);
-		return template;
-	}
-
-	private void buildTemplate(DiagramTemplate template){
-		template.init();
-		template.layout(new XY(0, 0));
-	}
-
-	/**
-	 * 添加容器
-	 */
-	public DiagramTemplate addCon(String newContainerId, String containerId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-
-		Container newCon = new Container();
-		newCon.setId(newContainerId);
-		newCon.setLayout(Layout.defaultLayout(Layout.ROW));
-
-		Container parent = template.getContainerById(containerId);
-		parent.addComp(newCon);
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 删除容器
-	 */
-	public DiagramTemplate delCon(String containerId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		Container con = template.getContainerById(containerId);
-		if(con.isAbsolutePosition())
+			}
+            templateMapper.updateById(entity);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 保存模板
+     */
+    public DiagramTemplate saveTemplate(DiagramTemplate template) {
+        template = dataStrategy.saveTemplate(template);
+        buildTemplate(template);
+        return template;
+    }
+
+    private void buildTemplate(DiagramTemplate template) {
+        template.init();
+        template.layout(new XY(0, 0));
+    }
+
+    /**
+     * 添加容器
+     */
+    public DiagramTemplate addCon(String newContainerId, String containerId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+
+        Container newCon = new Container();
+        newCon.setId(newContainerId);
+        newCon.setLayout(Layout.defaultLayout(Layout.ROW));
+
+        Container parent = template.getContainerById(containerId);
+        parent.addComp(newCon);
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 删除容器
+     */
+    public DiagramTemplate delCon(String containerId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        Container con = template.getContainerById(containerId);
+        if (con.isAbsolutePosition()) {
 			template.getScatteredContainers().remove(con);
-		else if(con.getParent() != null)
+		} else if (con.getParent() != null) {
 			con.getParent().removeComp(containerId);
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 移动容器
-	 */
-	public DiagramTemplate moveCon(String containerId, String templateId, int offset){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		Container con = template.getContainerById(containerId);
-		IContainer parent = con.getParent();
-		if(parent != null) {
-			List<IComponent> list = parent.getChildren();
-
-			int idx = list.indexOf(con);
-			idx += offset;
-
-			if(idx >=0 && idx < list.size()) {
-				list.remove(con);
-				list.add(idx, con);
-
-				return saveTemplate(template);
-			}
-		}
-
-		return null;
-	}
-
-	/**
-	 * 修改容器
-	 */
-	public DiagramTemplate modifyCon(EditRequest.TemplatePropsData propsData, String containerId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		Container con = template.getContainerById(containerId);
-
-		con.setId(propsData.getId());
-		con.setName(propsData.getName());
-		con.setRemark(propsData.getRemark());
-
-		con.getLayout().setLayout(propsData.getLayout());
-		con.getLayout().setMarginHeight(propsData.getMargin());
-		con.getLayout().setMarginWidth(propsData.getMargin());
-		con.getLayout().spaceH = con.getLayout().spaceV = propsData.getSpace();
-
-		con.getPosition().minH = propsData.getMinH();
-		con.getPosition().minW = propsData.getMinW();
-		con.getPosition().setAbsolute(propsData.isAbsolute());
-
-		con.setEquipmentTypes(CollUtil.isEmpty(propsData.getEquipTypes()) ? null : propsData.getEquipTypes());
-
-		con.setProps(propsData.getProps());
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 绘制新的干管
-	 */
-	public DiagramTemplate addMainPipe(List<List<XY>> lines, String templateId){
-		//合并同一条线上的多个点
-		List<List<XY>> fixed = new ArrayList<>();
-		for(List<XY> line : lines) {
-			List<XY> fixedLine = new ArrayList<>();
-			fixed.add(fixedLine);
-
-			XY p1 = null;
-			XY p2 = null;
-			for (XY point : line) {
-				if(p1 == null)
-					p1 = point;
-				else if(p2 == null)
-					p2 = point;
-				else {
-					if ((p1.x == p2.x && p2.x == point.x)
-							|| (p1.y == p2.y && p2.y == point.y)) {
-						fixedLine.remove(p2);
-					} else
-						p1 = p2;
-					p2 = point;
-				}
-				fixedLine.add(point);
-			}
-		}
-
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		buildTemplate(template);
-
-		List<ContainerRefPoint> allRefPoints = new ArrayList<>();
-
-		LinkedList<Container> cons = new LinkedList<>();
-		cons.add(template.getFrame());
-		while (cons.size() > 0) {
-			Container con = cons.removeFirst();
-
-			if(con.getParent() != null && !con.isAbsolutePosition()) //不使用frame和自由定位容器做定位
-				allRefPoints.addAll(ContainerRefPoint.getRefPoints(con, con.locationToRoot()));
-
-			for(IComponent comp : con.getChildren()){
-				if(comp instanceof Container)
-					cons.add((Container) comp);
-			}
-		}
-
-		MainPipe mainPipe = new MainPipe();
-		mainPipe.setId(IdUtil.simpleUUID()); //TODO
-
-		for(List<XY> line : fixed) {
-			List<MainPipePoint> ps = new ArrayList<>();
-			mainPipe.getPath().add(ps);
-
-			for (XY point : line) {
-				double min = Double.MAX_VALUE;
-				ContainerRefPoint targetRp = null;
-				for(ContainerRefPoint rp : allRefPoints) {
-					double d = distance(point, rp.getLocation());
-					if(d < min) {
-						min = d;
-						targetRp = rp;
-					}
-				}
-				MainPipePoint mp = new MainPipePoint();
-				mp.setContainerId(targetRp.getContainerId());
-				mp.setRefPointName(targetRp.getName());
-				mp.setOffset(new XY(point.x - targetRp.getLocation().x, point.y - targetRp.getLocation().y));
-				ps.add(mp);
-			}
-		}
-		if(template.getMainPipes() == null)
-			template.setMainPipes(new ArrayList<>());
-		template.getMainPipes().add(mainPipe);
-
-		return saveTemplate(template);
-	}
-
-	private double distance(XY p1, XY p2){
-		return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
-	}
-
-	/**
-	 * 删除干管
-	 */
-	public DiagramTemplate delMainPipe(String mainPipeId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-
-		if(template.getMainPipes() != null) {
-			for(MainPipe mainPipe : template.getMainPipes()) {
-				if(mainPipe.getId().equals(mainPipeId)) {
-					template.getMainPipes().remove(mainPipe);
-					break;
-				}
-			}
-		}
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 修改干管
-	 */
-	public DiagramTemplate modifyMainPipe(EditRequest.TemplatePropsData propsData, String mainPipeId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-
-		MainPipe mainPipe = template.getMainPipeById(mainPipeId);
-		if(mainPipe != null) {
-			mainPipe.setId(propsData.getId());
-			mainPipe.setName(propsData.getName());
-			mainPipe.setRemark(propsData.getRemark());
-			mainPipe.setPipeType(propsData.getPipeType());
-			mainPipe.setBindEquipment(propsData.isBindEquipment());
-			mainPipe.setEquipmentTypes(propsData.getEquipTypes());
-			mainPipe.setPassbyRels(propsData.getPassbyRels());
-			mainPipe.setConnectEquips(propsData.getConnectEquips());
 		}
 
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 修改设备数据过滤条件
-	 * filter可能是多种类型,通过Map转换
-	 */
-	public DiagramTemplate modifyFilter(Map<String, Object> filter, String compId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		DataFilter dataFilter;
-		if(filter != null)
-			dataFilter = contentParser.parseContent(contentParser.toJson(filter), DataFilter.class);
-		else
-			dataFilter = null;
-
-		Container con = template.getContainerById(compId);
-		if(con != null)
-			con.setDataFilter(dataFilter);
-		else {
-			MainPipe mainPipe = template.getMainPipeById(compId);
-			if(mainPipe != null)
-				mainPipe.setDataFilter(dataFilter);
-		}
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 修改设备打包配置
-	 */
-	public DiagramTemplate modifyPack(EquipPack pack, String containerId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		Container con = template.getContainerById(containerId);
-		con.setEquipPack(pack);
-
-		return saveTemplate(template);
-	}
-
-	/**
-	 * 修改容器的动态组配置
-	 */
-	public DiagramTemplate modifyDynGroup(DynGroup dynGroup, String containerId, String templateId){
-		DiagramTemplate template = dataStrategy.getTemplate(templateId);
-		template.init();
-
-		Container con = template.getContainerById(containerId);
-		con.setDynGroup(dynGroup);
-
-		return saveTemplate(template);
-	}
+        return saveTemplate(template);
+    }
+
+    /**
+     * 移动容器
+     */
+    public DiagramTemplate moveCon(String containerId, String templateId, int offset) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        Container con = template.getContainerById(containerId);
+        IContainer parent = con.getParent();
+        if (parent != null) {
+            List<IComponent> list = parent.getChildren();
+
+            int idx = list.indexOf(con);
+            idx += offset;
+
+            if (idx >= 0 && idx < list.size()) {
+                list.remove(con);
+                list.add(idx, con);
+
+                return saveTemplate(template);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 修改容器
+     */
+    public DiagramTemplate modifyCon(EditRequest.TemplatePropsData propsData, String containerId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        Container con = template.getContainerById(containerId);
+
+        con.setId(propsData.getId());
+        con.setName(propsData.getName());
+        con.setRemark(propsData.getRemark());
+
+        con.getLayout().setLayout(propsData.getLayout());
+        con.getLayout().setMarginHeight(propsData.getMargin());
+        con.getLayout().setMarginWidth(propsData.getMargin());
+        con.getLayout().spaceH = con.getLayout().spaceV = propsData.getSpace();
+
+        con.getPosition().minH = propsData.getMinH();
+        con.getPosition().minW = propsData.getMinW();
+        con.getPosition().setAbsolute(propsData.isAbsolute());
+
+        con.setEquipmentTypes(CollUtil.isEmpty(propsData.getEquipTypes()) ? null : propsData.getEquipTypes());
+
+        con.setProps(propsData.getProps());
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 绘制新的干管
+     */
+    public DiagramTemplate addMainPipe(List<List<XY>> lines, String templateId) {
+        //合并同一条线上的多个点
+        List<List<XY>> fixed = new ArrayList<>();
+        for (List<XY> line : lines) {
+            List<XY> fixedLine = new ArrayList<>();
+            fixed.add(fixedLine);
+
+            XY p1 = null;
+            XY p2 = null;
+            for (XY point : line) {
+                if (p1 == null) {
+                    p1 = point;
+                } else if (p2 == null) {
+                    p2 = point;
+                } else {
+                    boolean b = p1.x == p2.x && p2.x == point.x;
+                    boolean b1 = p1.y == p2.y && p2.y == point.y;
+                    if (b || b1) {
+                        fixedLine.remove(p2);
+                    } else {
+                        p1 = p2;
+                    }
+                    p2 = point;
+                }
+                fixedLine.add(point);
+            }
+        }
+
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        buildTemplate(template);
+
+        List<ContainerRefPoint> allRefPoints = new ArrayList<>();
+
+        LinkedList<Container> cons = new LinkedList<>();
+        cons.add(template.getFrame());
+        while (cons.size() > 0) {
+            Container con = cons.removeFirst();
+            //不使用frame和自由定位容器做定位
+            if (con.getParent() != null && !con.isAbsolutePosition()) {
+                allRefPoints.addAll(ContainerRefPoint.getRefPoints(con, con.locationToRoot()));
+            }
+
+            for (IComponent comp : con.getChildren()) {
+                if (comp instanceof Container) {
+                    cons.add((Container) comp);
+                }
+            }
+        }
+
+        MainPipe mainPipe = new MainPipe();
+        //TODO
+        mainPipe.setId(IdUtil.simpleUUID());
+
+        for (List<XY> line : fixed) {
+            List<MainPipePoint> ps = new ArrayList<>();
+            mainPipe.getPath().add(ps);
+
+            for (XY point : line) {
+                double min = Double.MAX_VALUE;
+                ContainerRefPoint targetRp = null;
+                for (ContainerRefPoint rp : allRefPoints) {
+                    double d = distance(point, rp.getLocation());
+                    if (d < min) {
+                        min = d;
+                        targetRp = rp;
+                    }
+                }
+                MainPipePoint mp = new MainPipePoint();
+                mp.setContainerId(targetRp.getContainerId());
+                mp.setRefPointName(targetRp.getName());
+                mp.setOffset(new XY(point.x - targetRp.getLocation().x, point.y - targetRp.getLocation().y));
+                ps.add(mp);
+            }
+        }
+        if (template.getMainPipes() == null) {
+            template.setMainPipes(new ArrayList<>());
+        }
+        template.getMainPipes().add(mainPipe);
+
+        return saveTemplate(template);
+    }
+
+    private double distance(XY p1, XY p2) {
+        return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
+    }
+
+    /**
+     * 删除干管
+     */
+    public DiagramTemplate delMainPipe(String mainPipeId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+
+        if (template.getMainPipes() != null) {
+            for (MainPipe mainPipe : template.getMainPipes()) {
+                if (mainPipe.getId().equals(mainPipeId)) {
+                    template.getMainPipes().remove(mainPipe);
+                    break;
+                }
+            }
+        }
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 修改干管
+     */
+    public DiagramTemplate modifyMainPipe(EditRequest.TemplatePropsData propsData, String mainPipeId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+
+        MainPipe mainPipe = template.getMainPipeById(mainPipeId);
+        if (mainPipe != null) {
+            mainPipe.setId(propsData.getId());
+            mainPipe.setName(propsData.getName());
+            mainPipe.setRemark(propsData.getRemark());
+            mainPipe.setPipeType(propsData.getPipeType());
+            mainPipe.setBindEquipment(propsData.isBindEquipment());
+            mainPipe.setEquipmentTypes(propsData.getEquipTypes());
+            mainPipe.setPassbyRels(propsData.getPassbyRels());
+            mainPipe.setConnectEquips(propsData.getConnectEquips());
+        }
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 修改设备数据过滤条件
+     * filter可能是多种类型,通过Map转换
+     */
+    public DiagramTemplate modifyFilter(Map<String, Object> filter, String compId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        DataFilter dataFilter;
+        if (filter != null) {
+            dataFilter = contentParser.parseContent(contentParser.toJson(filter), DataFilter.class);
+        } else {
+            dataFilter = null;
+        }
+
+        Container con = template.getContainerById(compId);
+        if (con != null) {
+            con.setDataFilter(dataFilter);
+        } else {
+            MainPipe mainPipe = template.getMainPipeById(compId);
+            if (mainPipe != null) {
+                mainPipe.setDataFilter(dataFilter);
+            }
+        }
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 修改设备打包配置
+     */
+    public DiagramTemplate modifyPack(EquipPack pack, String containerId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        Container con = template.getContainerById(containerId);
+        con.setEquipPack(pack);
+
+        return saveTemplate(template);
+    }
+
+    /**
+     * 修改容器的动态组配置
+     */
+    public DiagramTemplate modifyDynGroup(DynGroup dynGroup, String containerId, String templateId) {
+        DiagramTemplate template = dataStrategy.getTemplate(templateId);
+        template.init();
+
+        Container con = template.getContainerById(containerId);
+        con.setDynGroup(dynGroup);
+
+        return saveTemplate(template);
+    }
 
 }

+ 121 - 112
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/service/BdtpDataService.java

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.diagram.client.DicClient;
+import com.persagy.adm.diagram.constant.Constants;
 import com.persagy.adm.diagram.util.Pagination;
 import com.persagy.adm.diagram.util.ServiceUtil;
 import com.persagy.adm.diagram.client.RwdClient;
@@ -23,121 +24,129 @@ import java.util.Map;
 
 /**
  * bdtp数据服务调用服务封装
+ * @author zhaoyk
+ * @date 2021-12-27
  */
 @Service
 public class BdtpDataService {
 
-	@Autowired
-	private RwdClient rwdClient;
-
-	@Autowired
-	private DicClient dicClient;
-
-	@Autowired
-	private DigitalObjectClient objectClient;
-
-	@Autowired
-	private ObjectMapper objectMapper;
-
-	public List<ObjectNode> getMajorList(BdtpRequest req){
-		//查询专业定义
-		QueryCriteria majorCriteria = ServiceUtil.getQueryCriteria(objectMapper);
-		majorCriteria.getCriteria().put("type", "major");
-		return ServiceUtil.call (() -> dicClient.dataQuery(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), majorCriteria));
-	}
-
-	public List<ObjectNode> getSystemList(BdtpRequest req){
-		//查询系统定义
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "system");
-		return ServiceUtil.queryAllPage(() -> rwdClient.queryObjectType(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-	}
-
-	/**
-	 * 查询系统下的设备类型定义
-	 */
-	public List<ObjectNode> getEquipTypeList(BdtpRequest req, String system){
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "equipment");
-		if(StrUtil.isNotBlank(system))
-			criteria.getCriteria().put("systemCode", system);
-		return ServiceUtil.queryAllPage(() -> rwdClient.queryObjectType(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-	}
-
-	/**
-	 * 查询数据字典关系类型
-	 */
-	public List<Map<String, Object>> getRelTypeTree(BdtpRequest req){
-		List<RelationDefine> relList = ServiceUtil.call(() -> rwdClient.queryRelDef(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), new QueryCriteria()));
-		List<GraphDefine> graph = ServiceUtil.call (() -> rwdClient.queryGraphDef(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), new QueryCriteria()));
-
-		List<Map<String, Object>> rels = new ArrayList<>();
-		for(GraphDefine gd : graph){
-			HashMap<String, Object> m = new HashMap<>();
-			m.put("code", gd.getCode());
-			m.put("name", gd.getName());
-			m.put("type", "graph");
-			rels.add(m);
-
-			ArrayList<RelationDefine> chidren = new ArrayList<>();
-			m.put("children", chidren);
-			for(RelationDefine relDef : relList) {
-				if(relDef.getGraphCode().equals(gd.getCode()))
-					chidren.add(relDef);
-			}
-		}
-		return rels;
-	}
-
-	public List<ObjectNode> queryObjectsByType(BdtpRequest req, List<String> equipmentTypes, String systemId){
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "equipment");
-
-		ArrayNode types = criteria.getCriteria().putArray("classCode");
-		for(String code : equipmentTypes) {
-			types.add(code);
-		}
-
-		if(StrUtil.isNotBlank(systemId)){
-			//TODO 按系统实例进行过滤
-		}
-
-		List<ObjectNode> objs = ServiceUtil.queryAllPage(() -> objectClient.query(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-		if(objs == null)
-			objs = new ArrayList<>(0);
-		return objs;
-	}
-
-	public List<ObjectNode> queryObjectsById(BdtpRequest req, List<String> ids){
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "equipment");
-		ArrayNode arr = criteria.getCriteria().putArray("id");
-		for(String id : ids) {
-			arr.add(id);
-		}
-
-		List<ObjectNode> objs = ServiceUtil.queryAllPage(() -> objectClient.query(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-		if(objs == null)
-			objs = new ArrayList<>(0);
-		return objs;
-	}
-
-	public List<ObjectNode> queryRelsByTypeAndObj(BdtpRequest req, List<String[]> relTypes, List<String> objIds){
-		List<ObjectNode> rtn = new ArrayList<>();
-
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper);
-		ArrayNode arr = criteria.getCriteria().putArray("objFrom");
-		for(String id : objIds) {
-			arr.add(id);
-		}
-		List<ObjectNode> rels = ServiceUtil.queryAllPage(() -> rwdClient.queryRelation(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-		if(rels != null)
-			rtn.addAll(rels);
-
-		criteria.getCriteria().set("objTo", criteria.getCriteria().remove("objFrom"));
-		rels = ServiceUtil.queryAllPage(() -> rwdClient.queryRelation(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
-		if(rels != null)
-			rtn.addAll(rels);
-
-		//TODO relTypes参数处理
-
-		return rtn;
-	}
+    @Autowired
+    private RwdClient rwdClient;
+
+    @Autowired
+    private DicClient dicClient;
+
+    @Autowired
+    private DigitalObjectClient objectClient;
+
+    @Autowired
+    private ObjectMapper objectMapper;
+
+    public List<ObjectNode> getMajorList(BdtpRequest req) {
+        //查询专业定义
+        QueryCriteria majorCriteria = ServiceUtil.getQueryCriteria(objectMapper);
+        majorCriteria.getCriteria().put("type", "major");
+        return ServiceUtil.call(() -> dicClient.dataQuery(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), majorCriteria));
+    }
+
+    public List<ObjectNode> getSystemList(BdtpRequest req) {
+        //查询系统定义
+        QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, Constants.SYSTEM);
+        return ServiceUtil.queryAllPage(() -> rwdClient.queryObjectType(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+    }
+
+    /**
+     * 查询系统下的设备类型定义
+     */
+    public List<ObjectNode> getEquipTypeList(BdtpRequest req, String system) {
+        QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, Constants.EQUIPMENT);
+        if (StrUtil.isNotBlank(system)) {
+            criteria.getCriteria().put("systemCode", system);
+        }
+        return ServiceUtil.queryAllPage(() -> rwdClient.queryObjectType(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+    }
+
+    /**
+     * 查询数据字典关系类型
+     */
+    public List<Map<String, Object>> getRelTypeTree(BdtpRequest req) {
+        List<RelationDefine> relList = ServiceUtil.call(() -> rwdClient.queryRelDef(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), new QueryCriteria()));
+        List<GraphDefine> graph = ServiceUtil.call(() -> rwdClient.queryGraphDef(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), new QueryCriteria()));
+
+        List<Map<String, Object>> rels = new ArrayList<>();
+        for (GraphDefine gd : graph) {
+            HashMap<String, Object> m = new HashMap<>();
+            m.put("code", gd.getCode());
+            m.put("name", gd.getName());
+            m.put("type", "graph");
+            rels.add(m);
+
+            ArrayList<RelationDefine> children = new ArrayList<>();
+            m.put("children", children);
+            for (RelationDefine relDef : relList) {
+                if (relDef.getGraphCode().equals(gd.getCode())) {
+                    children.add(relDef);
+                }
+            }
+        }
+        return rels;
+    }
+
+    public List<ObjectNode> queryObjectsByType(BdtpRequest req, List<String> equipmentTypes, String systemId) {
+        QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "equipment");
+
+        ArrayNode types = criteria.getCriteria().putArray("classCode");
+        for (String code : equipmentTypes) {
+            types.add(code);
+        }
+
+        if (StrUtil.isNotBlank(systemId)) {
+            //TODO 按系统实例进行过滤
+        }
+
+        List<ObjectNode> objs = ServiceUtil.queryAllPage(() -> objectClient.query(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+        if (objs == null) {
+            objs = new ArrayList<>(0);
+        }
+        return objs;
+    }
+
+    public List<ObjectNode> queryObjectsById(BdtpRequest req, List<String> ids) {
+        QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, "equipment");
+        ArrayNode arr = criteria.getCriteria().putArray("id");
+        for (String id : ids) {
+            arr.add(id);
+        }
+
+        List<ObjectNode> objs = ServiceUtil.queryAllPage(() -> objectClient.query(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+        if (objs == null) {
+            objs = new ArrayList<>(0);
+        }
+        return objs;
+    }
+
+    public List<ObjectNode> queryRelsByTypeAndObj(BdtpRequest req, List<String[]> relTypes, List<String> objIds) {
+        List<ObjectNode> rtn = new ArrayList<>();
+
+        QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper);
+        ArrayNode arr = criteria.getCriteria().putArray("objFrom");
+        for (String id : objIds) {
+            arr.add(id);
+        }
+        List<ObjectNode> rels = ServiceUtil.queryAllPage(() -> rwdClient.queryRelation(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+        if (rels != null) {
+            rtn.addAll(rels);
+        }
+
+        criteria.getCriteria().set("objTo", criteria.getCriteria().remove("objFrom"));
+        rels = ServiceUtil.queryAllPage(() -> rwdClient.queryRelation(req.getGroupCode(), req.getProjectId(), req.getAppId(), req.getUserId(), criteria), criteria, new Pagination(500));
+        if (rels != null) {
+            rtn.addAll(rels);
+        }
+
+        //TODO relTypes参数处理
+
+        return rtn;
+    }
 
 }

+ 3 - 2
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/Pagination.java

@@ -22,10 +22,11 @@ public class Pagination {
 
 	public void next() {
 		pageNum++;
-		if ((pageNum - 1) * pageSize >= total)
+		if ((pageNum - 1) * pageSize >= total) {
 			hasNext = false;
-		else
+		} else {
 			hasNext = true;
+		}
 	}
 
 }

+ 7 - 5
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/ServiceUtil.java

@@ -22,9 +22,9 @@ public class ServiceUtil {
 		QueryCriteria queryCriteria = new QueryCriteria();
 
 		ObjectNode objectNode = objectMapper.createObjectNode();
-		if(objType.length  == 1)
+		if(objType.length  == 1) {
 			objectNode.put("objType", objType[0]);
-		else if(objType.length > 1) {
+		} else if(objType.length > 1) {
 			ArrayNode arrayNode = objectNode.putArray("objType");
 			for(String type : objType) {
 				arrayNode.add(type);
@@ -42,8 +42,9 @@ public class ServiceUtil {
 	private static <T> T call(Supplier<CommonResult<T>> action, Pagination pagination) {
 		CommonResult<T> result = action.get();
 		if(SUCCESS.equals(result.getResult())) {
-			if(pagination != null)
+			if(pagination != null) {
 				pagination.setTotal(result.getCount().intValue());
+			}
 			return result.getData();
 		}
 		throw new CallException(new CommonResult<>(result.getResult(), result.getMessage()));
@@ -54,10 +55,11 @@ public class ServiceUtil {
 		while (pagination.isHasNext()){
 			criteria.setPage((long)pagination.getPageNum());
 			criteria.setSize((long)pagination.getPageSize());
-			if(list == null)
+			if(list == null) {
 				list = ServiceUtil.call(action, pagination);
-			else
+			} else {
 				list.addAll(ServiceUtil.call(action, pagination));
+			}
 			pagination.next();
 		}
 		return list;

+ 1 - 1
adm-business/adm-diagram/src/main/resources/db.init/schema.sql

@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS `diagram` (
   `project_id` varchar(40) DEFAULT NULL COMMENT '项目id',
   `system_id` varchar(100) DEFAULT NULL COMMENT '系统id',
   `group_code` varchar(40) DEFAULT NULL COMMENT '集团编码',
-  `state` tinyint DEFAULT 1 NOT NULL COMMENT '系统图状态',
+  `state` varchar(40) DEFAULT NULL NOT NULL COMMENT '系统图状态',
   `diagram_content` json DEFAULT NULL COMMENT '系统图内容,json格式',
   `creator` varchar(32) DEFAULT NULL COMMENT '创建人',
   `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',

+ 6 - 3
adm-business/adm-diagram/src/main/resources/mapper/Diagram.xml

@@ -12,7 +12,7 @@
         <result column="project_id" property="projectId" jdbcType="VARCHAR"/>
         <result column="system_id" property="systemId" jdbcType="VARCHAR"/>
         <result column="group_code" property="groupCode" jdbcType="VARCHAR"/>
-        <result column="state" property="state" jdbcType="TINYINT"/>
+        <result column="state" property="state" jdbcType="VARCHAR"/>
         <result column="diagram_content" property="diagramContent" jdbcType="VARCHAR"/>
         <result column="creator" property="creator" jdbcType="VARCHAR"/>
         <result column="creation_time" property="creationTime" jdbcType="CHAR"/>
@@ -31,11 +31,11 @@
         INSERT INTO diagram
         (id,name,remark,type,bt_system,template_id,
         project_id,system_id,group_code,diagram_content,
-        creator,creation_time,modifier,modified_time)
+        creator,creation_time,modifier,modified_time,state)
         VALUES
         (#{id},#{name},#{remark},#{type},#{btSystem},#{templateId},
         #{projectId},#{systemId},#{groupCode},#{diagramContent},
-        #{creator}, #{creationTime},#{modifier},#{modifiedTime})
+        #{creator}, #{creationTime},#{modifier},#{modifiedTime},#{state})
     </insert>
 
     <delete id="deleteByDiagramId">
@@ -70,6 +70,9 @@
         <if test="null != name and name.length > 0">
             AND name LIKE CONCAT('%',#{name},'%')
         </if>
+        <if test="null != flag and (flag == false) ">
+            AND state = 'Publish'
+        </if>
     </select>
 
     <select id="getDiagramsBySystemIds" resultMap="diagramBaseMap">

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java

@@ -1,7 +1,7 @@
 package com.persagy.proxy.dictionary.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.request.AdmCreateRequest;

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AbstractAdmDictBaseServiceImpl.java

@@ -11,7 +11,7 @@ import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.utils.JsonHelper;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;

+ 4 - 11
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -6,11 +6,9 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.define.entity.ObjectInfoCollect;
-import com.persagy.proxy.adm.constant.AdmCommonConstant;
+import com.persagy.dmp.delivery.entity.ObjectInfoCollect;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
-import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmDictQueryCriteria;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -19,14 +17,9 @@ import com.persagy.proxy.dictionary.model.*;
 import com.persagy.proxy.dictionary.service.IAdmDictService;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import com.persagy.proxy.object.model.*;
-import com.persagy.proxy.object.service.IAdmEquipmentService;
-import com.persagy.proxy.object.service.IAdmShaftService;
-import com.persagy.proxy.object.service.IAdmSpaceService;
-import com.persagy.proxy.object.service.IAdmSystemService;
 import lombok.EqualsAndHashCode;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -307,7 +300,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             infoCollect.setDefineInfoId(funcIdGather.getId());
             infoCollect.setClassCode(funcIdGather.getClassCode());
             infoCollect.setCode(funcIdGather.getCode());
-            infoCollect.setVisiable(funcIdGather.getVisible());
+            infoCollect.setIsDelivery(funcIdGather.getVisible());
             infoCollect.setKeyWord(funcIdGather.getKeyWord());
             list.add((T) infoCollect);
         }
@@ -457,7 +450,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             if(CollUtil.isNotEmpty(objectInfoCollectMap)){
                 ObjectInfoCollect collect = objectInfoCollectMap.get(id);
                 if(collect != null){
-                    visiable = collect.getVisiable();
+                    visiable = collect.getIsDelivery();
                     admObjectInfo.setKeyWord(collect.getKeyWord());
                 }
             }
@@ -497,7 +490,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
             if(CollUtil.isNotEmpty(objectInfoCollectMap)){
                 ObjectInfoCollect collect = objectInfoCollectMap.get(id);
                 if(collect!=null){
-                    visiable = collect.getVisiable();
+                    visiable = collect.getIsDelivery();
                     admObjectInfo.setKeyWord(collect.getKeyWord());
                 }
             }

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -74,7 +74,7 @@ public class DataMigrationController {
         try {
 
             if (migrationInfo == null || StrUtil.isBlank(migrationInfo.getTargetUrl())) {
-                throw new BusinessException(ResponseCode.A0402.getCode(), ResponseCode.A0402.getDesc());
+                throw new BusinessException(ResponseCode.A0402.toString());
             }
             InstanceUrlParam context = AdmContextUtil.toDmpContext();
             //确定集团编码 和 项目id

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java

@@ -156,7 +156,7 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append("'").append(infoDefine.getCategory()).append("',");
             sqls.append("'").append(infoDefine.getFirstTag()).append("',");
             if (infoDefine.getSecondTag() == null) {
-                infoDefine.getSecondTag();
+                sqls.append(infoDefine.getSecondTag()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getSecondTag()).append("',");
             }
@@ -196,7 +196,7 @@ public class DefineInfoMigration extends MigrationAbstractServiceImpl<ObjectInfo
             sqls.append(infoDefine.getShowOrder()).append(",");
 
             if (infoDefine.getVersion() == null) {
-                infoDefine.getVersion();
+                sqls.append(infoDefine.getVersion()).append(",");
             } else {
                 sqls.append("'").append(infoDefine.getVersion()).append("',");
             }

+ 31 - 15
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationAbstractServiceImpl.java

@@ -242,6 +242,9 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
                         || fieldKey.equals(AuditableEntity.DO_PROP_MODIFIEDTIME)
                         || fieldKey.equals(AuditableEntity.PROP_MODIFIER)
                         || fieldKey.equals(BaseEntity.PROP_TS)
+                        || fieldKey.equals("createApp")
+                        || fieldKey.equals("updateApp")
+                        || fieldKey.equals(BaseEntity.PROP_TS)
                         || fieldKey.equals("dataSource")
                 ){
                     continue;
@@ -295,7 +298,7 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         }else{
             int count= vos.size() / MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
             for(int k = 0; k< count + 1 ;k++){
-                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT - 1;
+                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
                 if(end > vos.size()){
                     end = vos.size();
                 }
@@ -349,11 +352,6 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
         if(CollUtil.isEmpty(difference)){
             return null;
         }
-        /*difference.forEach(set1 -> System.out.println(set1));
-        System.out.println("-------------------------------------------------------------------------");
-        Sets.SetView<String> difference2 = Sets.difference(toSets, formSets);
-        difference2.forEach(set2 -> System.out.println(set2));*/
-
         Set<String> diff = difference.stream().map(entity -> StrUtil.subBefore(entity, MigrationConstant.SPLITER_UNION, true)).collect(Collectors.toSet());
         Map<String, Object> results = getValueForMapByKeys(diff, from);
         return results;
@@ -385,22 +383,40 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
             syncData.setTableName(tableName);
             syncData.setTargetId("error");
             syncData.setError(msg);
-            syncData.setSign(1);
+            syncData.setSign(3);//异常
             syncDataList.add(syncData);
         }
         return syncDataList;
     }
 
+    /**
+     * 调用中台接口,保存迁移日志
+     * 日志量 > MigrationConstant.BATCH_SUBMIT_DATA_COUNT 使用分页插入
+     *
+     * @param context
+     * @param syncDataList
+     * @return
+     */
     @Override
     public List<SyncData> addSynLog(InstanceUrlParam context, List<SyncData> syncDataList) {
         if(CollUtil.isEmpty(syncDataList)){
             return Collections.emptyList();
         }
+        //List<SyncData> syncDatasResult = new ArrayList<>(syncDataList.size());
         // 调用中台新增
-        List<SyncData> syncDatas = DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncDataList);
-
-        if(CollUtil.isEmpty(syncDatas)) {
-            throw new RuntimeException("调用中台更新迁移日志出错");
+        if(syncDataList.size() - MigrationConstant.BATCH_SUBMIT_DATA_COUNT < 0){
+            DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncDataList);
+        }else{
+            int count= syncDataList.size() / MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
+            for(int k = 0; k < count + 1 ;k++){
+                int end = (k+1)  * MigrationConstant.BATCH_SUBMIT_DATA_COUNT;
+                if(end > syncDataList.size()){
+                    end = syncDataList.size();
+                }
+                List syncData = syncDataList.subList(k * MigrationConstant.BATCH_SUBMIT_DATA_COUNT, end);
+                //syncDatasResult.addAll(DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncData));
+                DigitalMigrateLogFacade.create(context.getGroupCode(),context.getProjectId(),context.getAppId(), context.getUserId(), syncData);
+            }
         }
         return syncDataList;
     }
@@ -432,12 +448,12 @@ public class MigrationAbstractServiceImpl<T> implements IMigrationAbstractServic
                 }
                 return DataMigrationResponse.success(JsonNodeUtils.toEntity(arrayNode, clazz, null));
             }else {
-                log.error(commonResult.getMessage());
-                return DataMigrationResponse.error(commonResult.getMessage());
+                log.error(StrUtil.format("获取中台数据失败{}",commonResult.getMessage()));
+                return DataMigrationResponse.error(StrUtil.format("获取中台数据失败{}",commonResult.getMessage()));
             }
         }catch (Exception e){
-            log.error(e.getMessage());
-            return DataMigrationResponse.error(e.getMessage());
+            log.error(StrUtil.format("获取中台数据异常{}",e.getMessage()));
+            return DataMigrationResponse.error(StrUtil.format("获取中台数据异常{}",e.getMessage()));
         }
 
     }

+ 17 - 7
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectDigitalMigration.java

@@ -84,9 +84,9 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             log.info("######################### dt_object "+objType.getCode()+"同步开始 #########################");
 
             QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
-            List<SyncData> syncDataList = startMigrateForLog(context,migrationInfo,queryCriteria);
+            startMigrateForLog(context,migrationInfo,queryCriteria);
 
-            log.info("######################### dt_object "+objType.getCode()+"同步结束 共计:"+syncDataList.size()+"条 #########################");
+            log.info("######################### dt_object "+objType.getCode()+"同步结束 #########################");
         }
         long end = System.currentTimeMillis();
         log.info("######################### dt_object 数据迁移已结束 时间:"+(end-start)+" #########################");
@@ -190,7 +190,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
      * 迁移数据,记录日志
      *
      */
-    private List<SyncData> startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, QueryCriteria queryCriteria) {
+    private void startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, QueryCriteria queryCriteria) {
         List<SyncData> syncDataList = new ArrayList<>();
         List<ObjectNode> admData = getAdmData(context,queryCriteria);
 
@@ -202,10 +202,17 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             log.error(" ######################### dt_object adm已交付:"+ ResponseCode.C0320.getDesc() +" 同步结束 #########################");
         }
 
+        //因获取的数据均有主键 使用更新
         String insertUrl = requestUrl(context, migrationInfo, MigrationType.CREATE.getCode());
         if(CollUtil.isEmpty(projObjectNodeList)){
+            //调用中台验证待新增的数据
+            List<ObjectDigital> digitalList = validateInfoCode(admData, context);
+            //处理并保存日志
+            syncDataList.addAll(processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.CREATE.getCode()));
+
             DataMigrationResponse dataMigrationResponse = insertBatch(admData, ObjectDigital.class, insertUrl);
-            syncDataList = processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode());
+            syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
+
         }
         Map<String,Object> projectMap = toEntityMap(projObjectNodeList, ObjectDigital.class);
         Map<String,Object> admMap = toEntityMap(admData, ObjectDigital.class);
@@ -220,6 +227,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
 
             //插入数据
             DataMigrationResponse dataMigrationResponse = insertBatch(insertData, ObjectDigital.class, insertUrl);
+            //处理并保存日志
             syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
         }
 
@@ -233,6 +241,7 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
             List<String> successIds = (List<String>) dataMigrationResponse.getData();
             List<ObjectNode> delObjs = toListByIds(successIds, projObjectNodeList);
             dataMigrationResponse.setData(delObjs);
+            //处理并保存日志
             syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
         }
 
@@ -246,16 +255,18 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
                 List<ObjectNode> updateData = toList(compareData, admData);
                 //调用中台验证待更新的数据
                 List<ObjectDigital> digitalList = validateInfoCode(updateData, context);
-                //将验证结果放到日志
+                //将验证结果放到日志并保存
                 syncDataList.addAll(processDataForLog(DataMigrationResponse.success(digitalList), MigrationType.UPDATE.getCode()));
 
                 //更新
                 String updateUrl = requestUrl(context, migrationInfo, MigrationType.UPDATE.getCode());
                 DataMigrationResponse dataMigrationResponse = updateBatch(updateData, ObjectDigital.class, updateUrl);
+                //处理并保存日志
                 syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
             }
         }
-       return super.addSynLog(context, syncDataList);
+        //处理并保存日志
+        super.addSynLog(context, syncDataList);
     }
 
     /**
@@ -271,7 +282,6 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
         List<ObjectNode> objectNodeList = JsonNodeUtils.toListNode(projectData, null, null);
 
         if(CollUtil.isEmpty(admData)){
-            log.error(" ######################### dt_object adm已交付:"+ ResponseCode.C0320.getDesc() +" 同步结束 #########################");
             return Collections.emptyList();
         }
 

+ 26 - 36
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java

@@ -101,36 +101,18 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         log.info("######################### dt_relation 同步开始 #########################");
         long start = System.currentTimeMillis();
         ExecutorService service = getExcecutor();
-        List<SyncData> syncDataList = new ArrayList<>();
-        List<Future<List<SyncData>>> list = new ArrayList<>();
 
         for (MiGrationRelCode miGrationRelCode: MiGrationRelCode.values()){
             log.info("######################### dt_relation "+miGrationRelCode.getCode()+"数据迁移开始 #########################");
 
-            Future<List<SyncData>> future = service.submit(new Callable<List<SyncData>>(){
+            service.submit(new Runnable() {
                 @Override
-                public List<SyncData> call() throws Exception {
-                    return startMigrateForLog(context, migrationInfo, miGrationRelCode.getCode());
+                public void run() {
+                    startMigrateForLog(context, migrationInfo, miGrationRelCode.getCode());
                 }
             });
-            list.add(future);
         }
         service.shutdown();
-        for (Future<List<SyncData>> future : list) {
-            try {
-                List<SyncData> syncDatas = future.get();
-                if(CollUtil.isNotEmpty(syncDatas)){
-                    syncDataList.addAll(syncDatas);
-                }
-
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-                log.error("######################### dt_relation 数据迁移失败"+e.getMessage());
-            } catch (ExecutionException e) {
-                e.printStackTrace();
-                log.error("######################### dt_relation 数据迁移失败"+e.getMessage());
-            }
-        }
         long end = System.currentTimeMillis();
         log.info("######################### dt_relation 同步结束 "+(end-start)+"#########################");
         return AdmResponse.success();
@@ -146,15 +128,6 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
     public String migrateForSql(InstanceUrlParam context) {
         StringBuffer sqls = new StringBuffer(" \n -- 数据迁移  dt_relation ------ \n");
         //获取已经采集的数据
-        /* StringBuffer sqls_temp = new StringBuffer();
-        for (MiGrationRelCode miGrationRelCode: MiGrationRelCode.values()){
-            QueryCriteria queryCriteria = getQueryCriteria(miGrationRelCode.getCode());
-            List<ObjectRelation> admData = getAdmData(context,queryCriteria);
-            if(CollUtil.isEmpty(admData)){
-                continue;
-            }
-        }*/
-
         String sqls_temp = "";
         ExecutorService service = getExcecutor();
         List<Future<StringBuffer>> futureList = new ArrayList<>();
@@ -233,14 +206,26 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
                 sqls.append("'").append(relation.getGraphId()).append("',");
             }
             sqls.append("'").append(relation.getGraphCode()).append("',");
-            sqls.append("'").append(relation.getRelCode()).append("',");;
+            sqls.append("'").append(relation.getRelCode()).append("',");
+
             if (relation.getRelValue() == null) {
                 sqls.append(relation.getRelValue()).append(",");
             } else {
                 sqls.append("'").append(relation.getRelValue()).append("',");
             }
-            sqls.append("'").append(relation.getObjFrom()).append("',");
-            sqls.append("'").append(relation.getObjTo()).append("',");
+
+            if (relation.getObjFrom() == null) {
+                sqls.append(relation.getObjFrom()).append(",");
+            } else {
+                sqls.append("'").append(relation.getObjFrom()).append("',");
+            }
+
+            if (relation.getObjTo() == null) {
+                sqls.append(relation.getObjTo()).append(",");
+            } else {
+                sqls.append("'").append(relation.getObjTo()).append("',");
+            }
+
             if (relation.getCreateApp() == null) {
                 sqls.append(relation.getCreateApp()).append(",");
             } else {
@@ -333,9 +318,9 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         return dataMigrationExcels;
     }
 
-    private List<SyncData> startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, String code){
-        QueryCriteria queryCriteria = getQueryCriteria(code);
+    private void startMigrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo, String code){
         List<SyncData> syncDataList = new ArrayList<>();
+        QueryCriteria queryCriteria = getQueryCriteria(code);
         List<ObjectRelation> admRelations = getAdmData(context, queryCriteria);
 
         String queryUrl = requestUrl(context, migrationInfo, MigrationType.QUERY.getCode());
@@ -348,6 +333,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         if(CollUtil.isEmpty(projectRelations)){
             DataMigrationResponse dataMigrationResponse = insertBatch(admRelations, ObjectRelation.class, insertUrl);
             syncDataList = processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode());
+
         }
         List<ObjectNode> objectNodeListPro = JsonNodeUtils.toListNode(projectRelations, null, null);
         Map<String,Object> projectDefineMap = toEntityMap(objectNodeListPro, ObjectRelation.class);
@@ -359,6 +345,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
         if(!CollUtil.isEmpty(doSubtractFromInsert)){
             List<ObjectRelation> insertData = toList(doSubtractFromInsert, admRelations);
             DataMigrationResponse dataMigrationResponse = insertBatch(insertData, ObjectRelation.class, insertUrl);
+            //处理并保存日志
             syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.CREATE.getCode()));
         }
 
@@ -369,6 +356,7 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
             String delUrl = requestUrl(context, migrationInfo, MigrationType.DELETE.getCode());
             //处理删除的数据
             DataMigrationResponse dataMigrationResponse = deleteBatch(deleteIds, delUrl);
+            //处理并保存日志
             syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.DELETE.getCode()));
         }
 
@@ -381,10 +369,12 @@ public class ObjectRelationMigration extends MigrationAbstractServiceImpl<Object
                 List<ObjectRelation> updateData = toList(compareData, admRelations);
                 String updateUrl = requestUrl(context, migrationInfo, MigrationType.UPDATE.getCode());
                 DataMigrationResponse dataMigrationResponse = updateBatch(updateData, ObjectRelation.class, updateUrl);
+                //处理并保存日志
                 syncDataList.addAll(processDataForLog(dataMigrationResponse, MigrationType.UPDATE.getCode()));
             }
         }
-        return super.addSynLog(context, syncDataList);
+        //处理并保存日志
+        super.addSynLog(context,syncDataList);
     }
 
 

+ 9 - 8
adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -18,6 +18,7 @@ import com.persagy.proxy.adm.request.*;
 import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
+import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.RelationDTO;
 import com.persagy.proxy.object.model.AdmBuilding;
 import com.persagy.proxy.object.model.AdmFloor;
@@ -200,11 +201,6 @@ public class AdmSpaceController {
         AdmQueryCriteria criteriaFloor = new AdmQueryCriteria();
         criteriaFloor.setName(AdmFloor.OBJ_TYPE);
 
-        AdmQueryCriteria criteriaSpace = new AdmQueryCriteria();
-        criteriaSpace.setName("spaceList");
-        criteriaSpace.setFilters("state = 1");
-
-        criteriaFloor.setCascade(CollUtil.newArrayList(criteriaSpace));
         criteriaFloor.setOrders("floorSequenceID desc");
         request.setCascade(CollUtil.newArrayList(criteriaFloor));
         AdmResponse response = buildingService.doQueryBuildingFloor(AdmContextUtil.toDmpContext(), request);
@@ -213,9 +209,14 @@ public class AdmSpaceController {
             if(CollUtil.isNotEmpty(building.getFloor())){
                 List<AdmFloor> floors = building.getFloor();
                 floors.forEach(floor -> {
-                    if(CollUtil.isNotEmpty(floor.getSpaceList())){
-                        floor.setCount(floor.getSpaceList().size());
-                        floor.setSpaceList(null);
+                    AdmQueryCriteria criteriaSpace = new AdmQueryCriteria();
+                    criteriaSpace.setName(AdmSpace.OBJ_TYPE);
+                    criteriaSpace.setFilters("state = 1");
+                    criteriaSpace.addFilters("floorId = '" + floor.getId()+"'");
+                    criteriaSpace.setOnlyCount(true);
+                    AdmResponse admResponseSpace = service.query(criteriaSpace);
+                    if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getCount() > 0){
+                        floor.setCount(admResponseSpace.getCount().intValue());
                     }else{
                         floor.setCount(0);
                     }

+ 0 - 36
adm-business/adm-server/pom.xml

@@ -44,40 +44,4 @@
             <version>1.16.1</version>
         </dependency>
     </dependencies>
-
-
-<!--    <build>-->
-<!--        <plugins>-->
-<!--            <plugin>-->
-<!--                <groupId>org.mybatis.generator</groupId>-->
-<!--                <artifactId>mybatis-generator-maven-plugin</artifactId>-->
-<!--                <version>1.3.2</version>-->
-<!--                <configuration>-->
-<!--                    <configurationFile>src/main/resources/mybatis-generator/generatorConfig.xml</configurationFile>-->
-<!--                    <verbose>true</verbose>-->
-<!--                    <overwrite>true</overwrite>-->
-<!--                </configuration>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <id>Generate MyBatis Artifacts</id>-->
-<!--                        <goals>-->
-<!--                            <goal>generate</goal>-->
-<!--                        </goals>-->
-<!--                    </execution>-->
-<!--                </executions>-->
-<!--                <dependencies>-->
-<!--                    <dependency>-->
-<!--                        <groupId>mysql</groupId>-->
-<!--                        <artifactId>mysql-connector-java</artifactId>-->
-<!--                        <version>8.0.15</version>-->
-<!--                    </dependency>-->
-<!--                    <dependency>-->
-<!--                        <groupId>org.mybatis.generator</groupId>-->
-<!--                        <artifactId>mybatis-generator-core</artifactId>-->
-<!--                        <version>1.3.2</version>-->
-<!--                    </dependency>-->
-<!--                </dependencies>-->
-<!--            </plugin>-->
-<!--        </plugins>-->
-<!--    </build>-->
 </project>

+ 0 - 60
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/client/OldAdmClient.java

@@ -1,60 +0,0 @@
-package com.persagy.adm.server.custom.client;
-
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.dmp.basic.config.DigitalFeignConfig;
-import feign.Response;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-@FeignClient(name = "amd-old", configuration = DigitalFeignConfig.class,
-		url = "${persagy.adm.oldPlatformUrl}")
-public interface OldAdmClient {
-
-	@PostMapping("/persagy-sso-server/users/login")
-	Map<String, Object> login(
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/project/query")
-	OldAdmResult<List<OProject>> queryProject(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/building/query")
-	OldAdmResult<List<OBuilding>> queryBuilding(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/zone/query")
-	OldAdmResult<List<OSpace>> querySpace(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/equip/query")
-	OldAdmResult<List<OEquip>> queryEquip(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@GetMapping(value = "/image-service/common/file_get",consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
-	Response getFloorMap(@RequestParam String key, @RequestParam String systemId);
-
-}

+ 0 - 36
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/common/AdmResult.java

@@ -1,36 +0,0 @@
-package com.persagy.adm.server.custom.common;
-
-import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.model.response.CommonResult;
-import lombok.Data;
-
-@Data
-public class AdmResult<T> {
-
-	private String code;
-
-	private String message;
-
-	private T data;
-
-	public AdmResult(String code, String message) {
-		this(code, message, null);
-	}
-
-	public AdmResult(String code, String message, T data) {
-		this.code = code;
-		this.message = message;
-		this.data = data;
-	}
-
-	public AdmResult(CommonResult<T> commonResult) {
-		this.code = commonResult.getResult();
-		this.message = commonResult.getMessage();
-		this.data = commonResult.getData();
-	}
-
-	public static <T> AdmResult<T> success(T data){
-		return new AdmResult<>(ResponseCode.A00000.getCode(), null, data);
-	}
-
-}

+ 9 - 11
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java

@@ -3,11 +3,11 @@ package com.persagy.adm.server.custom.controller;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.persagy.adm.server.custom.common.AdmResult;
-import com.persagy.adm.server.custom.dao.AdmFileMapper;
-import com.persagy.adm.server.custom.entity.AdmCad;
 import com.persagy.adm.server.custom.entity.CadFileQueryParam;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.service.IAdmCadService;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -25,31 +25,29 @@ public class AdmFileController {
 
     @Autowired
     IAdmCadService iAdmCadService;
-    @Autowired
-    AdmFileMapper admFileMapper;
 
     /**
      * CAD文件查询接口
      */
 
     @PostMapping("/queryCadFiles")
-    public AdmResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
+    public CommonResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
         Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
                 .eq(StringUtils.isNotBlank(queryParam.getProjectId()), AdmCad::getProjectId, queryParam.getProjectId())
                 .eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
                 .eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
                 .eq(StringUtils.isNotBlank(queryParam.getFileKey()),AdmCad::getFileKey,queryParam.getFileKey())
                 .eq(StringUtils.isNotBlank(queryParam.getMajorCode()),AdmCad::getMajorCode,queryParam.getMajorCode());
-        return AdmResult.success(iAdmCadService.list(eq));
+        return ResultHelper.multi(iAdmCadService.list(eq));
     }
 
     /**
      * 保存CAD文件信息
      */
     @PostMapping("/saveCadFileInfo")
-    public AdmResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
+    public CommonResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
         iAdmCadService.saveOrUpdateBatch(admFiles);
-        return AdmResult.success(null);
+        return ResultHelper.success();
     }
 
     /**
@@ -57,8 +55,8 @@ public class AdmFileController {
      * @param id 文件信息表主键ID
      */
     @PostMapping("/delete")
-    public AdmResult<Void> delete(@RequestParam("id") String id){
+    public CommonResult<Void> delete(@RequestParam("id") String id){
         iAdmCadService.removeById(id);
-        return AdmResult.success(null);
+        return ResultHelper.success();
     }
 }

+ 19 - 105
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java

@@ -1,41 +1,32 @@
 package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.StrUtil;
-import com.persagy.adm.server.custom.client.ImageServiceClient;
-import com.persagy.adm.server.custom.client.OldAdmClient;
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.datatx.DataTxHandler;
+import com.persagy.adm.server.custom.entity.ConfigData;
 import com.persagy.adm.server.custom.entity.Dict;
 import com.persagy.adm.server.custom.entity.DownLoadData;
 import com.persagy.adm.server.custom.entity.UploadRtn;
 import com.persagy.adm.server.custom.service.ISyncApp;
 import com.persagy.adm.server.custom.service.ServiceUtil;
-import feign.Response;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * APP离线数据服务
+ */
 @RestController
 @RequestMapping("/adm")
 public class AppController {
 
 	@Autowired
-	private ImageServiceClient imageServiceClient;
-
-	@Autowired
-	private OldAdmClient admClient;
-
-	@Autowired
 	@Qualifier(ServiceUtil.SYNC_APP_IMPL)
 	private ISyncApp syncApp;
 
@@ -43,119 +34,42 @@ public class AppController {
 	private DataTxHandler dataTxHandler;
 
 	@RequestMapping("/clientId")
-	public AdmResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
+	public CommonResult<Map<String, Object>> clientId(@RequestBody AdmRequest req){
 		HashMap<String, Object> rtn = new HashMap<>();
 		rtn.put("clientId", syncApp.getClientId(req.getUserId()));
-		return AdmResult.success(rtn);
+		return ResultHelper.single(rtn);
 	}
 
 	@RequestMapping("/dict")
-	public AdmResult<Dict> dict(@RequestBody AdmRequest req){
-		return AdmResult.success(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<Dict> dict(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadDict(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/config")
-	public AdmResult<Map<String, Object>> config(@RequestBody AdmRequest req){
-		return AdmResult.success(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<ConfigData> config(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/frame")
-	public AdmResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
-//		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-//
-//		List<ObjectNode> prjList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), getQueryCriteria("project", objectMapper)));
-//
-//		//建筑和楼层,暂时从dbtp获取
-//		List<ObjectNode> bdList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), getQueryCriteria("building", objectMapper)));
-//
-//		QueryCriteria flCriteria = getQueryCriteria("floor", objectMapper);
-//		flCriteria.getCriteria().putObject("relationTo").put("graphCode", "ArchSubset").put("relCode", "Bd2Fl");
-//		List<ObjectNode> flList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), flCriteria));
-//
-//		QueryCriteria relCriteria = getQueryCriteria(null, objectMapper);
-//		relCriteria.getCriteria().put("graphCode", "ArchSubset").put("relCode", "Bd2Fl");
-//		List<ObjectRelation> relList = ServiceUtil.call(() -> relationClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), relCriteria));
-//
-//		//为楼层数据设置buildingId
-//		for(ObjectNode n : flList){
-//			String flId = n.get("id").asText();
-//			for(ObjectRelation r : relList){
-//				if(r.getObjTo().equals(flId)){
-//					n.put("buildingId", r.getObjFrom());
-//					relList.remove(r);
-//					break;
-//				}
-//			}
-//		}
-//
-//		HashMap<String, Object> data = new HashMap<>();
-//		data.put("projects", prjList);
-//		data.put("buildings", bdList);
-//		data.put("floors", flList);
-//		return AdmResult.success(data);
-
-		return AdmResult.success(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
+	public CommonResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
+		return ResultHelper.single(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/download")
-	public AdmResult<DownLoadData> download(@RequestBody AdmRequest req){
+	public CommonResult<DownLoadData> download(@RequestBody AdmRequest req){
 		DownLoadData data;
 		if(StrUtil.isNotBlank(req.getBuildingId())) {
-			if(ServiceUtil.SYNC_APP_IMPL.equals("syncAppImpl")) //临时兼容
-				data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
-			else
-				data = syncApp.downloadBuildingData(req.getProjectId(), req.getBuildingId(), req.getUploadFlag(), req.getLastDownloadTime());
+			data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
 		} else
 			data = syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
-		return AdmResult.success(data);
+		return ResultHelper.single(data);
 	}
 
-//	@RequestMapping("/downloadFl")
-//	public AdmResult<Map<String, Object>> downloadFl(@RequestBody AdmRequest req){
-//		return AdmResult.success(syncApp.downloadFloorData(req.getProjectId(), req.getFloorId(), req.getUploadFlag(), req.getLastDownloadTime()));
-//	}
-
-	@RequestMapping("/downloadMap")
-	public void downloadMap(HttpServletRequest request, HttpServletResponse response, @RequestParam String key){
-		InputStream inputStream = null;
-		try {
-			Response serviceResponse;
-			if(ServiceUtil.SYNC_APP_IMPL.equals("syncAppImpl")) //临时兼容
-				serviceResponse = imageServiceClient.fileGet(key, "revit");
-			else
-				serviceResponse = admClient.getFloorMap(key, "revit");
-
-			Response.Body body = serviceResponse.body();
-
-			inputStream = body.asInputStream();
-			BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
-			Object o = serviceResponse.headers().get("Content-Disposition");
-			String contentDisposition = o != null ? o.toString().replace("[","").replace("]","") : "attachment;filename=map.jsonz";
-			response.setHeader("Content-Disposition", contentDisposition);
-			BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(response.getOutputStream());
-			int length = 0;
-			byte[] temp = new byte[1024 * 10];
-			while ((length = bufferedInputStream.read(temp)) != -1) {
-				bufferedOutputStream.write(temp, 0, length);
-			}
-			bufferedOutputStream.flush();
-			bufferedOutputStream.close();
-			bufferedInputStream.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
 
 	@RequestMapping("/upload")
-	public AdmResult<UploadRtn> upload(HttpServletRequest request){
+	public CommonResult<UploadRtn> upload(HttpServletRequest request){
 		AdmRequest admRequest = dataTxHandler.handleRequest(request);
-		return AdmResult.success(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
-	}
-
-	@PostMapping("/uploadFile")
-	public AdmResult uploadFile(){
-		//TODO
-		return null;
+		return ResultHelper.single(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
 	}
 
 }

+ 4 - 20
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java

@@ -1,9 +1,9 @@
 package com.persagy.adm.server.custom.controller;
 
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
-import com.persagy.adm.server.custom.service.ISyncOldAdm;
 import com.persagy.adm.server.custom.service.ISyncSpace;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -16,28 +16,12 @@ import java.util.Map;
 @RestController
 @RequestMapping("/manage")
 public class ManageController {
-
-	@Autowired
-	private ISyncOldAdm syncOldAdm;
-
 	@Autowired
 	private ISyncSpace syncSpace;
-
-	@RequestMapping("/syncOldAdm")
-	public AdmResult<Object> syncOldAdm(@RequestBody AdmRequest req){
-		String groupCode = req.getGroupCode();
-		String projectId = req.getProjectId();
-
-		Map<String, Object> syncResult = syncOldAdm.syncData(groupCode, projectId);
-		syncOldAdm.handleJobSpace(projectId);
-		syncOldAdm.uploadFloorMap(groupCode, projectId);
-		return AdmResult.success(syncResult);
-	}
-
 	@RequestMapping("/syncSpace")
-	public AdmResult<Object> syncSpace(@RequestBody AdmRequest req){
+	public CommonResult<Object> syncSpace(@RequestBody AdmRequest req){
 		Map<String, Object> syncResult = syncSpace.sync(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getFloorId(), "GeneralZone");
-		return AdmResult.success(syncResult);
+		return ResultHelper.single(syncResult);
 	}
 
 }

+ 18 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ToolController.java

@@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.server.custom.client.RwdClient;
 import com.persagy.adm.server.custom.common.AdmConst;
 import com.persagy.adm.server.custom.common.AdmRequest;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.dao.*;
 import com.persagy.adm.server.custom.entity.Dict;
 import com.persagy.adm.server.custom.entity.InfoDef;
@@ -23,6 +22,8 @@ import com.persagy.adm.server.custom.service.ServiceUtil;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ResponseCode;
 import com.persagy.dmp.common.exception.BusinessException;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.common.utils.ResultHelper;
 import com.persagy.dmp.define.entity.GraphDefine;
 import com.persagy.dmp.define.entity.RelationDefine;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,12 +55,12 @@ public class ToolController {
 	private AdmM2dEquipMapper m2dEquipMapper;
 
 	@GetMapping("/hello")
-	public AdmResult<Integer> hello(){
-		return AdmResult.success(configService.queryCommonConfig(null).size());
+	public CommonResult<Integer> hello(){
+		return ResultHelper.single(configService.queryCommonConfig(null).size());
 	}
 
 	@RequestMapping("/dict")
-	public AdmResult<Dict> dict(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
+	public CommonResult<Dict> dict(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
 		Dict map = syncApp.queryDict(req.getGroupCode(), req.getProjectId(), req.getUserId(), !"infos".equals(module), false);
 
 		List<Map<String, Object>> majorList = map.getMajor();
@@ -119,7 +120,7 @@ public class ToolController {
 			map.setRelation(rels);
 		}
 
-		return AdmResult.success(map);
+		return ResultHelper.single(map);
 	}
 
 	private <T> void distinct(List<T> list){
@@ -154,7 +155,7 @@ public class ToolController {
 	}
 
 	@RequestMapping("/cfgs")
-	public AdmResult<Object> cfgs(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
+	public CommonResult<Object> cfgs(@RequestBody AdmRequest req, @RequestParam(required = false) String module){
 		String projectId = req.getProjectId();
 		HashMap<String, Object> data = new HashMap<>();
 
@@ -172,11 +173,11 @@ public class ToolController {
 			data.put("containerConfig", containerConfig);
 		}
 
-		return AdmResult.success(data);
+		return ResultHelper.single(data);
 	}
 
 	@RequestMapping("/typeInfos")
-	public AdmResult<Object> typeInfos(@RequestBody AdmRequest req, @RequestParam String typeCode){
+	public CommonResult<Object> typeInfos(@RequestBody AdmRequest req, @RequestParam String typeCode){
 		QueryCriteria criteria = new QueryCriteria();
 		ObjectNode node = objectMapper.createObjectNode();
 		node.put("classCode", typeCode);
@@ -192,7 +193,7 @@ public class ToolController {
 			buildInfosTree(roots, infoDef);
 		}
 
-		return AdmResult.success(roots);
+		return ResultHelper.single(roots);
 	}
 
 	private void buildInfosTree(List<Object> roots, InfoDef infoDef){
@@ -234,7 +235,7 @@ public class ToolController {
 	private AdmContainerConfigMapper containerConfigMapper;
 
 	@PostMapping("/updateCfgItem")
-	public AdmResult<Object> updateCfgItem(@RequestBody Map<String, Object> content) {
+	public CommonResult<Object> updateCfgItem(@RequestBody Map<String, Object> content) {
 		String type = (String) content.get("type");
 		Map<String, Object> itemMap = (Map<String, Object>) content.get("item");
 		String delId = (String) content.get("delId");
@@ -253,7 +254,7 @@ public class ToolController {
 			doUpdateItem(delId, itemMap, create, AdmContainerConfig.class, containerConfigMapper);
 		}
 
-		return AdmResult.success(newId);
+		return ResultHelper.single(newId);
 	}
 	
 	private <T extends BaseAdmEntity> void doUpdateItem(String delId, Map<String, Object> itemMap, boolean create, Class<T> cls, BaseMapper<T> mapper){
@@ -282,7 +283,7 @@ public class ToolController {
 	private AdmInfosConfigMapper infosConfigMapper;
 
 	@PostMapping("/updateInfos")
-	public AdmResult<Object> updateInfos(@RequestBody AdmInfosConfig cfg) {
+	public CommonResult<Object> updateInfos(@RequestBody AdmInfosConfig cfg) {
 		String newId = null;
 		if(StrUtil.isBlank(cfg.getId())){
 			newId = IdUtil.fastSimpleUUID();
@@ -302,11 +303,11 @@ public class ToolController {
 		else
 			infosConfigMapper.updateById(cfg);
 
-		return AdmResult.success(newId);
+		return ResultHelper.single(newId);
 	}
 
 	@PostMapping("/updateM2d")
-	public AdmResult<Object> updateM2d(@RequestBody Map<String, Object> cfg){
+	public CommonResult<Object> updateM2d(@RequestBody Map<String, Object> cfg){
 		String code = (String) cfg.get("code");
 		boolean m2d = (Boolean)cfg.get("m2d");
 		AdmM2dEquip item = m2dEquipMapper.selectOne(new QueryWrapper<AdmM2dEquip>().eq("class_code", code));
@@ -321,11 +322,11 @@ public class ToolController {
 			if(item != null)
 				m2dEquipMapper.deleteById(item.getId());
 		}
-		return AdmResult.success(null);
+		return ResultHelper.success();
 	}
 
 	@PostMapping("/bdAndFls")
-	public AdmResult<List<ObjectNode>> bdAndFls(@RequestBody AdmRequest req){
+	public CommonResult<List<ObjectNode>> bdAndFls(@RequestBody AdmRequest req){
 		Map<String, Object> data = syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId());
 		List<ObjectNode> bdAndFls = (List<ObjectNode>)data.get("buildingsAndFloors");
 
@@ -355,7 +356,7 @@ public class ToolController {
 			}
 		}
 
-		return AdmResult.success(bds);
+		return ResultHelper.single(bds);
 	}
 
 }

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmCadMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmDefineProblemInfoMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmProblemMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 7 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/BuildingData.java

@@ -31,6 +31,13 @@ public class BuildingData extends DownLoadData {
 	// 核查问题数据
 	private List<AdmProblem> problems;
 
+	/**
+	 * ADM图纸
+	 */
+	private List<AdmCad> admCads;
+
+
+
 	/** 待废弃 */
 	private String timestamp;
 

+ 32 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/ConfigData.java

@@ -0,0 +1,32 @@
+package com.persagy.adm.server.custom.entity;
+
+import com.persagy.adm.server.custom.entity.db.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 配置数据
+ */
+@Data
+@Builder
+public class ConfigData {
+    //配置数据查询
+    private List<AdmM2dEquip> m2dTypes;
+    private List<AdmInfosConfig> infosConfig;
+    private List<AdmRelsConfig> relConfig;
+    private List<AdmPipeConfig> pipeConfig;
+    private List<AdmConfig> config;
+    private List<AdmComponent> component;
+    private List<AdmContainerConfig> containerConfig;
+    /**
+     * 问题类型
+     */
+    private List<AdmDefineProblemType> admDefineProblemTypes;
+    /**
+     * 问题类型对应信息点定义
+     */
+    private List<AdmDefineProblemInfo> admDefineProblemInfos;
+
+}

+ 5 - 5
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmCad.java

@@ -1,12 +1,12 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-
-import com.persagy.adm.server.custom.entity.db.BaseAdmDataEntity;
+import com.persagy.dmp.common.model.entity.AuditableEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
+
 /**
  * <p>
  * CAD图纸信息表
@@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
-public class AdmCad extends BaseAdmDataEntity implements Serializable {
+public class AdmCad extends AuditableEntity<AdmCad> implements Serializable {
 
     /**
      * 存储系统的key

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmDefineProblemInfo.java

@@ -1,4 +1,4 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmProblem.java

@@ -1,4 +1,4 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
@@ -47,7 +47,7 @@ public class AdmProblem extends BaseAdmDataEntity implements Serializable {
      * 1 空间 2对象
      */
     @TableField("check_type")
-    private String checkType;
+    private Integer checkType;
 
     /**
      * 问题对象类型

+ 0 - 26
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBase.java

@@ -1,26 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-import java.util.Map;
-
-@Data
-abstract public class OBase {
-
-	private String id;
-
-	private String name;
-
-	private String localId;
-
-	private String localName;
-
-	private String objectType;
-
-	private Map<String, Object> infos;
-
-	private String createTime;
-
-	private String lastUpdate;
-
-}

+ 0 - 19
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBuilding.java

@@ -1,19 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class OBuilding extends OBase {
-
-	/** 项目ID */
-	private String projectId;
-	/** 平台默认二维码 */
-	private String defaultQRCode;
-	/** 建筑二维码图片 */
-	private String buildQRCode;
-
-	private List<OFloor> floor;
-
-}

+ 0 - 98
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OEquip.java

@@ -1,98 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import com.fasterxml.jackson.annotation.JsonAlias;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class OEquip extends OBase {
-
-	/** 二维码内容 */
-	private String defaultQRCode;
-	/** 设计图纸中编码 */
-	private String cadId;
-	/** RFID标识 */
-	private String rfId;
-
-
-	/** BIM模型中编码 */
-	private String bimId;
-	/** BIM构建编码 */
-	private String bimTypeId;
-	/** BIM模型中坐标 */
-	private String bimLocation;
-	/** 坐标对象数据 */
-	@JsonProperty("location")
-	@JsonAlias("locationJson")
-	private Map<String, Double> location;
-	/** 现场发现人员 */
-	private String findPeople;
-
-	/** 项目ID */
-	private String projectId;
-	/** 设备类型code */
-	private String classCode;
-	/** 设备所在建筑ID */
-	private String buildingId;
-	/** 设备所在楼层id */
-	private String floorId;
-	/** 设备关联的资产id */
-	private String propertyId;
-
-	/** 参见 EquipmentProSy **/
-	/** 品牌型号id */
-	private String dpManufacturerId;
-
-	/** 供应商信息id */
-	private String dpSupplierId;
-
-	/** 维修商信息id */
-	private String dpMaintainerId;
-
-	/** 保险公司信息id */
-	private String dpInsurerId;
-
-	/** 设备型号id */
-	private String dpSpecificationId;
-
-	/** 品牌id */
-	private String dpBrandId;
-
-	/** Revit族 */
-	private String bimFamilyName;
-	/** Revit族类型 */
-	private String bimFamilySymbol;
-	/** 设备序号 */
-	private Double equipSerial;
-
-	/** 部件关联设备的id */
-	private String parentId;
-	/** 系统id集合 */
-	private List<String> systemList;
-	/** 项目自定义类型 */
-	private String customCategory;
-	/** 任务状态 */
-	private Integer taskState;
-	/** 模型id */
-	private String modelId;
-	/** 贴码状态 */
-	private Integer codeType;
-	/** 备注 */
-	private String note;
-
-	/** 客户端id */
-	private String appId;
-	/** 方案id */
-	private String schemeId;
-
-	/** 系统编码 */
-	private String systemCode;
-	/** 系统名称 */
-	private String systemName;
-	/** 二维码图片 */
-	private String qrcodePic;
-
-}

+ 0 - 51
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OFloor.java

@@ -1,51 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import lombok.Data;
-
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class OFloor extends OBase {
-
-	/** 平台默认二维码 */
-	private String defaultQRCode;
-	/** 项目ID */
-	private String projectId;
-	/** 建筑ID */
-	private String buildingId;
-	/** 坐标 */
-	private String bimLocation;
-	/** BIM模型中编码 */
-	private String bimId;
-	/** BIMID前缀 */
-	private String bimIdPre;
-	/** 楼层顺序号 */
-	private Integer floorSequenceID;
-	/** 楼层常驻人数 */
-	private Integer permanentPeopleNum;
-	/** 楼层编码 */
-	private String floorIdentity;
-
-	/** 模型文件id */
-	private String modelId;
-
-	/** 楼层选定区域轮廓线 */
-	private List<ObjectNode> outline;
-
-	/** 数量 */
-	private String count;
-
-	/** 自定义信息点 */
-	private Map<String, Object> properties;
-
-	/** 二维码图片 */
-	private String qrcodePic;
-
-	public String getFloorMap(){
-		Map<String, Object> infos = getInfos();
-		return infos != null ? (String) infos.get("floorMap") : null;
-	}
-
-}

+ 0 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OProject.java

@@ -1,17 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-@Data
-public class OProject extends OBase {
-
-	/** 项目介绍 */
-	private String introduction;
-	/** 集团编码 */
-	private String groupCode;
-	/** 商业层数 */
-	private String businessFloorNum;
-	/** 办公层数 */
-	private String officeFloorNum;
-
-}

+ 0 - 79
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OSpace.java

@@ -1,79 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import cn.hutool.core.map.CaseInsensitiveMap;
-import lombok.Data;
-
-import java.util.ArrayList;
-
-@Data
-public class OSpace extends OBase {
-
-	/** 项目ID */
-	private String projectId;
-	/** 建筑ID */
-	private String buildingId;
-	/** 楼层ID */
-	private String floorId;
-	/** 平台二维码 */
-	private String defaultQRCode;
-	/** BIM模型中编码 */
-	private String bimId;
-
-	/** 楼层选定区域轮廓线 */
-	private ArrayList<ArrayList<ArrayList<CaseInsensitiveMap>>> outline;
-	/** 轮廓线2 未使用*/
-	private ArrayList<ArrayList<ArrayList<CaseInsensitiveMap>>> outline2;
-//	/** 图片 */
-//	private ArrayList<AdmTaskPic> pic;
-	/** 空间是否受影响 */
-	private String state;
-	/** 空间常驻人数 */
-	private Integer permanentPeopleNum;
-
-	/** 井深 */
-	private Float depth;
-	/** 面宽 */
-	private Float width;
-	/** 建筑面积 */
-	private Float buildArea;
-	/** 使用面积 */
-	private Float netArea;
-	/** 高 */
-	private Float height;
-	/** 备注文字 */
-	private String intro;
-	/** 设计供冷功率 */
-	private Float ratedCoolingp;
-	/** 设计供热功率 */
-	private Float ratedHeatingp;
-	/** 空调形式 */
-	private String acType;
-	/** 空间朝向 */
-	private String zoneOrientation;
-	/** 空间功能区类型 */
-	private String roomFuncType;
-
-	/** 空间序号 */
-	private Float roomSerial;
-	/** 项目空间功能区类型 */
-	private String projRoomFuncType;
-	/** 设计照明功率 */
-	private Float ratedLightp;
-	/** 内外区分类 */
-	private String zoneType;
-	/** 租赁业态类型 */
-	private Integer tenantType;
-	/** 所属租户 */
-	private String tenant;
-	/** 配电容量 */
-	private Float elecCap;
-	/** 污染等级 */
-	private String pollutionDegree;
-
-	/** 对象类型code */
-	private String classCode;
-
-	/** 二维码图片 */
-	private String qrcodePic;
-
-}

+ 0 - 20
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OldAdmResult.java

@@ -1,20 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-@Data
-public class OldAdmResult<T> {
-
-	private String result;
-
-	private String Message;
-
-	private T content;
-
-	private int pageNumber;
-
-	private int pageSize;
-
-	private int total;
-
-}

+ 4 - 4
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/CallException.java

@@ -1,17 +1,17 @@
 package com.persagy.adm.server.custom.service;
 
 
-import com.persagy.adm.server.custom.common.AdmResult;
+import com.persagy.dmp.common.model.response.CommonResult;
 
 public class CallException extends RuntimeException {
 
-	private AdmResult<Object> errorResult;
+	private CommonResult<Object> errorResult;
 
-	public CallException(AdmResult<Object> errorResult) {
+	public CallException(CommonResult<Object> errorResult) {
 		this.errorResult = errorResult;
 	}
 
-	public  AdmResult<Object> getErrorResult() {
+	public  CommonResult<Object> getErrorResult() {
 		return errorResult;
 	}
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmCadService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmDefineProblemInfoService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmProblemService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 0 - 29
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IQueryFromOldAdm.java

@@ -1,29 +0,0 @@
-package com.persagy.adm.server.custom.service;
-
-import com.persagy.adm.server.custom.entity.oldadm.OBuilding;
-import com.persagy.adm.server.custom.entity.oldadm.OEquip;
-import com.persagy.adm.server.custom.entity.oldadm.OProject;
-import com.persagy.adm.server.custom.entity.oldadm.OSpace;
-
-import java.util.List;
-
-/**
- * 从老adm查询数据
- */
-public interface IQueryFromOldAdm {
-
-	/**
-	 * 登录系统
-	 * @return token
-	 */
-	String login();
-
-	List<OProject> queryProject(String token, String groupCode, String projectId);
-
-	List<OBuilding> queryBdAnFl(String token, String groupCode, String projectId);
-
-	List<OSpace> querySpace(String token, String groupCode, String projectId);
-
-	List<OEquip> queryEquip(String token, String groupCode, String projectId);
-
-}

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncApp.java

@@ -15,7 +15,7 @@ public interface ISyncApp {
 
 	Dict downloadDict(String groupCode, String projectId, String userId);
 
-	Map<String, Object> downloadConfig(String groupCode, String projectId, String userId);
+	ConfigData downloadConfig(String groupCode, String projectId, String userId);
 
 	Map<String, Object> downloadFrameData(String groupCode, String projectId, String userId);
 

+ 0 - 16
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncOldAdm.java

@@ -1,16 +0,0 @@
-package com.persagy.adm.server.custom.service;
-
-import java.util.Map;
-
-/**
- * 从老adm同步正向交付数据和建筑楼层等初始化数据
- */
-public interface ISyncOldAdm {
-
-	Map<String, Object> syncData(String groupCode, String projectId);
-
-	void handleJobSpace(String projectId);
-
-	void uploadFloorMap(String groupCode, String projectId);
-
-}

+ 1 - 18
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java

@@ -3,9 +3,7 @@ package com.persagy.adm.server.custom.service;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.entity.Pagination;
-import com.persagy.adm.server.custom.entity.oldadm.OldAdmResult;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
 
@@ -46,7 +44,7 @@ public class ServiceUtil {
 				pagination.setTotal(result.getCount().intValue());
 			return result.getData();
 		}
-		throw new CallException(new AdmResult<>(result.getResult(), result.getMessage()));
+		throw new CallException(new CommonResult<>(result.getResult(), result.getMessage()));
 	}
 
 	public static <T> List<T> queryAllPage(Supplier<CommonResult<List<T>>> action, QueryCriteria criteria, Pagination pagination){
@@ -63,19 +61,4 @@ public class ServiceUtil {
 		return list;
 	}
 
-
-	public static <T> T callOldAdm(Supplier<OldAdmResult<T>> action, Pagination pagination) {
-		OldAdmResult<T> result = action.get();
-		if(SUCCESS.equals(result.getResult())) {
-			if(pagination != null)
-				pagination.setTotal(result.getTotal());
-			return result.getContent();
-		}
-		throw new CallException(new AdmResult<>(result.getResult(), result.getMessage()));
-	}
-
-	public static <T> T callOldAdm(Supplier<OldAdmResult<T>> action) {
-		return callOldAdm(action, null);
-	}
-
 }

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmCadServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.dao.AdmCadMapper;
 import com.persagy.adm.server.custom.service.IAdmCadService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmDefineProblemInfoServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.persagy.adm.server.custom.dao.AdmDefineProblemInfoMapper;
 import com.persagy.adm.server.custom.service.IAdmDefineProblemInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmProblemServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.persagy.adm.server.custom.dao.AdmProblemMapper;
 import com.persagy.adm.server.custom.service.IAdmProblemService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 0 - 111
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/QueryFromOldAdmImpl.java

@@ -1,111 +0,0 @@
-package com.persagy.adm.server.custom.service.impl;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.persagy.adm.server.custom.client.OldAdmClient;
-import com.persagy.adm.server.custom.entity.db.AdmM2dEquip;
-import com.persagy.adm.server.custom.entity.Pagination;
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.adm.server.custom.service.IConfigService;
-import com.persagy.adm.server.custom.service.IQueryFromOldAdm;
-import com.persagy.adm.server.custom.service.ServiceUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.function.Supplier;
-
-@Service
-public class QueryFromOldAdmImpl implements IQueryFromOldAdm {
-
-	private static String user = "bdtp";
-
-	private static String password = "123456";
-
-	private static String appId = "adm";
-
-	@Autowired
-	private OldAdmClient admClient;
-
-	@Autowired
-	private IConfigService configService;
-
-	@Autowired
-	private ObjectMapper objectMapper;
-
-	@Override
-	public String login() {
-		HashMap<String, Object> params = new HashMap<>();
-		params.put("name", user);
-		params.put("password", password);
-		Map<String, Object> longinInfo = admClient.login(params);
-		if("Success".equals(longinInfo.get("code"))){
-			Map data = (Map)longinInfo.get("data");
-			return (String) data.get("token");
-		}
-		return null;
-	}
-
-	@Override
-	public List<OProject> queryProject(String token, String groupCode, String projectId) {
-		return ServiceUtil.callOldAdm(() -> admClient.queryProject(groupCode, projectId, appId, user, token, new HashMap<>()));
-	}
-
-	@Override
-	public List<OBuilding> queryBdAnFl(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		HashMap<String, Object> cascade = new HashMap<>();
-		cascade.put("name", "floor");
-		cascade.put("orders", "floorSequenceID asc");
-		params.put("cascade", Arrays.asList(cascade));
-		return ServiceUtil.callOldAdm(() -> admClient.queryBuilding(groupCode, projectId, appId, user, token, params));
-	}
-
-	@Override
-	public List<OSpace> querySpace(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		params.put("zoneTypeList", Arrays.asList("GeneralZone", "OtherZone"));
-		//params.put("zoneType", "GeneralZone");
-
-		Pagination pagination = new Pagination(1000);
-		return queryAllPage(() -> admClient.querySpace(groupCode, projectId, appId, user, token, params), params, pagination);
-	}
-
-	private <T> List<T> queryAllPage(Supplier<OldAdmResult<List<T>>> action, Map<String,Object> params, Pagination pagination){
-		List<T> list = null;
-		while (pagination.isHasNext()){
-			params.put("pageNumber", pagination.getPageNum());
-			params.put("pageSize", pagination.getPageSize());
-			if(list == null)
-				list = ServiceUtil.callOldAdm(action, pagination);
-			else
-				list.addAll(ServiceUtil.callOldAdm(action, pagination));
-			pagination.next();
-		}
-		return list;
-	}
-
-	@Override
-	public List<OEquip> queryEquip(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		Pagination pagination = new Pagination(1000);
-
-		//TODO 暂时仅同步正向交付的设备,按设备类过滤
-		List<AdmM2dEquip> equips = configService.queryM2dEquip(projectId);
-		List<String> classCodeList = new ArrayList<>(equips.size());
-		for (AdmM2dEquip equip : equips) {
-			classCodeList.add(equip.getClassCode());
-		}
-		if (classCodeList.size() > 0) {
-			try {
-				String filter = "classCode in " + objectMapper.writeValueAsString(classCodeList);
-				params.put("filters", filter);
-			} catch (IOException e) {
-
-			}
-		}
-
-		return queryAllPage(() -> admClient.queryEquip(groupCode, projectId, appId, user, token, params), params, pagination);
-	}
-
-}

+ 15 - 25
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java

@@ -19,11 +19,8 @@ import com.persagy.adm.server.custom.dao.*;
 import com.persagy.adm.server.custom.datatx.ObjectMapper4Tx;
 import com.persagy.adm.server.custom.entity.*;
 import com.persagy.adm.server.custom.entity.db.*;
-import com.persagy.adm.server.custom.entity.db.AdmDefineProblemType;
 import com.persagy.adm.server.custom.service.*;
 import com.persagy.adm.server.custom.util.DataExtrasUtil;
-import com.persagy.adm.server.custom.dao.AdmDefineProblemInfoMapper;
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.define.entity.RelationDefine;
@@ -165,7 +162,7 @@ public class SyncAppImpl implements ISyncApp {
 	}
 
 	@Override
-	public Map<String, Object> downloadConfig(String groupCode, String projectId, String userId) {
+	public ConfigData downloadConfig(String groupCode, String projectId, String userId) {
 		//配置数据查询
 		List<AdmM2dEquip> m2dTypes = configService.queryM2dEquip(projectId);
 		List<AdmInfosConfig> infosConfig = configService.queryInfosConfig(projectId);
@@ -176,39 +173,27 @@ public class SyncAppImpl implements ISyncApp {
 		List<AdmContainerConfig> containerConfig = configService.queryContainerConfig(projectId);
 		// 下载问题类型
 		List<AdmDefineProblemType> admDefineProblemTypes = configService.queryDefineProblemTypes();
-		// 下载ADM图纸
-		List<AdmCad> admFiles = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId));
 		// 下载问题类型对应信息点定义
 		List<AdmDefineProblemInfo> admDefineProblemInfos = admDefineProblemInfoMapper.selectList(null);
 
-		HashMap<String, Object> data = new HashMap<>();
-		data.put("m2dTypes", m2dTypes);
-		data.put("infosConfig", infosConfig);
-		data.put("relConfig", relConfig);
-		data.put("pipeConfig", pipeConfig);
-		data.put("config", config);
-		data.put("component", component);
-		data.put("containerConfig", containerConfig);
-		data.put("problemTypeConfig",admDefineProblemTypes);
-		data.put("admFiles",admFiles);
-		data.put("admDefineProblemInfos",admDefineProblemInfos);
-
-		return data;
+		return ConfigData.builder().m2dTypes(m2dTypes)
+				.infosConfig(infosConfig)
+				.relConfig(relConfig)
+				.pipeConfig(pipeConfig)
+				.config(config)
+				.component(component)
+				.containerConfig(containerConfig)
+				.admDefineProblemTypes(admDefineProblemTypes)
+				.admDefineProblemInfos(admDefineProblemInfos).build();
 	}
 
 	@Override
 	public Map<String, Object> downloadFrameData(String groupCode, String projectId, String userId) {
-		//TODO 项目修改为从运维平台查询
-		QueryCriteria criteria = ServiceUtil.getQueryCriteria(objectMapper, AdmConst.OBJ_TYPE_PROJECT);
-		List<ObjectNode> prjList = ServiceUtil.call(() -> objectClient.query(groupCode, null, AdmConst.APP_ID, userId, criteria));
-		packInfos(prjList);
-
 		QueryCriteria criteria2 = ServiceUtil.getQueryCriteria(objectMapper, AdmConst.OBJ_TYPE_BUILDING, AdmConst.OBJ_TYPE_FLOOR);
 		List<ObjectNode> bdAndFl = ServiceUtil.call(() -> objectClient.query(groupCode, projectId, AdmConst.APP_ID, userId, criteria2));
 		packInfos(bdAndFl);
 
 		HashMap<String, Object> data = new HashMap<>();
-		data.put("projects", prjList);
 		data.put("buildingsAndFloors", bdAndFl);
 
 		return data;
@@ -281,6 +266,9 @@ public class SyncAppImpl implements ISyncApp {
 		// 问题相关数据
 		List<AdmProblem> problems = problemMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<>(),projectId,buildingId,operator,admDownloadTs));
 
+		// 下载ADM图纸
+		List<AdmCad> admCads = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId).eq(AdmCad::getBuildingId,buildingId));
+
 		List<AdmFile> file = fileMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmFile>(), projectId, buildingId, operator, admDownloadTs));
 		List<AdmQrCode> qrCode = qrCodeMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmQrCode>(), projectId, buildingId, operator, admDownloadTs));
 		List<AdmServeArea> serveArea = serveAreaMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmServeArea>(), projectId, buildingId, operator, admDownloadTs));
@@ -300,6 +288,8 @@ public class SyncAppImpl implements ISyncApp {
 		data.buildDownloadTs();
 		// 核查问题数据
 		data.setProblems(problems);
+		// CAD图纸数据
+		data.setAdmCads(admCads);
 		return data;
 	}
 

+ 0 - 569
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncOldAdmImpl.java

@@ -1,569 +0,0 @@
-package com.persagy.adm.server.custom.service.impl;
-
-import cn.hutool.core.date.DatePattern;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.ArrayUtil;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.adm.server.custom.client.OldAdmClient;
-import com.persagy.adm.server.custom.common.AdmConst;
-import com.persagy.adm.server.custom.common.AdmResult;
-import com.persagy.adm.server.custom.dao.AdmJobSpaceMapper;
-import com.persagy.adm.server.custom.dao.AdmObjectMapper;
-import com.persagy.adm.server.custom.entity.db.AdmJobSpace;
-import com.persagy.adm.server.custom.entity.db.AdmObject;
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.adm.server.custom.service.CallException;
-import com.persagy.adm.server.custom.service.IAdmObjectService;
-import com.persagy.adm.server.custom.service.IQueryFromOldAdm;
-import com.persagy.adm.server.custom.service.ISyncOldAdm;
-import com.persagy.adm.server.custom.util.GeomUtil;
-import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.constant.ValidEnum;
-import com.persagy.dmp.common.exception.BusinessException;
-import com.persagy.dmp.common.helper.SpringHelper;
-//import com.persagy.dmp.file.client.FileClientFacade;
-//import com.persagy.dmp.file.model.FileInfo;
-//import com.persagy.dmp.file.model.FileInfoCreator;
-//import com.persagy.dmp.storage.utils.FileStorageHelper;
-import org.locationtech.jts.geom.Polygon;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Service
-public class SyncOldAdmImpl implements ISyncOldAdm {
-
-	@Autowired
-	private IQueryFromOldAdm queryOldAdm;
-
-	@Autowired
-	private IAdmObjectService objectService;
-
-	@Autowired
-	private AdmObjectMapper objectMapper;
-
-	@Autowired
-	private AdmJobSpaceMapper jobSpaceMapper;
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public Map<String, Object> syncData(String groupCode, String projectId) {
-		String token = queryOldAdm.login();
-		if(StrUtil.isNotBlank(token)){
-			List<OBuilding> bdList = queryOldAdm.queryBdAnFl(token, groupCode, projectId);
-
-			List<OSpace> spList = queryOldAdm.querySpace(token, groupCode, projectId);
-			spList = spList.stream().filter(space -> GeomUtil.checkPolygon(space.getOutline())).collect(Collectors.toList());
-
-			List<OEquip> eqList  = queryOldAdm.queryEquip(token, groupCode, projectId);
-
-			List<AdmObject> bdObjs = new ArrayList<>(bdList.size());
-			List<AdmObject> flObjs = new ArrayList<>();
-			List<AdmObject> spObjs = new ArrayList<>(spList.size());
-			List<AdmObject> eqObjs = new ArrayList<>(eqList.size());
-
-			transEntities(bdObjs, bdList, (bdObj, oBd) -> {
-				setBdData(bdObj, (OBuilding) oBd);
-				if(((OBuilding) oBd).getFloor() != null)
-					transEntities(flObjs, ((OBuilding) oBd).getFloor(), (flObj, oFl) -> setFlData(flObj, (OFloor) oFl));
-			});
-
-			transEntities(spObjs, spList, (spObj, oSp) -> setSpData(spObj, (OSpace) oSp));
-			transEntities(eqObjs, eqList, (eqObj, oEq) -> setEqData(eqObj, (OEquip) oEq));
-
-			Map<String, String> floorIdMap = new HashMap<>();
-			List<AdmObject> dbBds = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_BUILDING);
-			List<AdmObject> dbFls = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_FLOOR);
-			List<AdmObject> dbSps = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_SPACE);
-			List<AdmObject> dbEqs = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_EQUIPMENT);
-
-			List<AdmObject>[] operations = new List[]{new ArrayList<>(), new ArrayList<>()};
-
-			syncObjs(bdObjs, dbBds, operations, 1, floorIdMap);
-			syncObjs(flObjs, dbFls, operations, 2, floorIdMap);
-			syncObjs(spObjs, dbSps, operations, 3, floorIdMap);
-			syncObjs(eqObjs, dbEqs, operations, 4, floorIdMap);
-
-			objectService.insert(operations[0]);
-			objectService.update(operations[1]);
-
-			/*uploadFloorMap(flObjs, groupCode, projectId);*/
-			HashMap<String, Object> rtn = new HashMap<>();
-			rtn.put(AdmConst.OBJ_TYPE_BUILDING, bdObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_FLOOR, flObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_SPACE, spObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_EQUIPMENT, eqObjs.size());
-
-			return rtn;
-		}
-		throw new CallException(new AdmResult(ResponseCode.A0220.getCode(), "ADM platform: " + ResponseCode.A0220.getDesc()));
-	}
-
-	//TODO 设备同步时,按正逆向规则过滤
-	private void syncObjs(List<AdmObject> objs, List<AdmObject> dbItems, List<AdmObject>[] operations, int objMark, Map<String, String> floorIdMap){
-		HashMap<String, AdmObject> dbMap = new HashMap<>();
-		for (AdmObject dbItem : dbItems){
-			dbMap.put(getFixedIdForSync(dbItem, objMark), dbItem);
-		}
-
-		String timestamp =  DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
-
-		for(AdmObject obj : objs) {
-			AdmObject dbItem = dbMap.remove(getFixedIdForSync(obj, objMark));
-			if(dbItem == null) {
-				obj.setCreator(AdmConst.CREATOR_SYNC);
-				obj.setModifiedTime(timestamp); //保留从老adm同步过来的createTime,设置updateTime
-				obj.setD2mState(ValidEnum.TRUE.getType());
-				obj.setDeliveryState(ValidEnum.FALSE.getType());
-
-				if(objMark == 3 || objMark == 4) { //新增空间|设备
-					if(floorIdMap.size() > 0){
-						String fixedFloorId = floorIdMap.get(obj.getFloorId());
-						if(fixedFloorId != null)
-							obj.setFloorId(fixedFloorId);
-					}
-				}
-
-				operations[0].add(obj); //add
-			} else {
-				AdmObject updateItem = mergeObj(obj, dbItem, timestamp, objMark);
-				if(updateItem != null)
-					operations[1].add(updateItem); //modify
-
-				if(objMark == 2 && !obj.getId().equals(dbItem.getId())) {
-					floorIdMap.put(obj.getId(), dbItem.getId());
-				}
-			}
-		}
-
-		if (dbMap.size() > 0) { //remove
-			for(AdmObject obj : dbMap.values()){
-				obj.setValid(ValidEnum.FALSE.getType());
-				obj.setModifiedTime(timestamp);
-				obj.setModifier(AdmConst.CREATOR_SYNC);
-				//obj.setUploadFlag(null);
-				operations[1].add(obj);
-			}
-		}
-	}
-
-	/**
-	 * 同步数据时固定的id,优先取bimId,没有bimId取数据id
-	 */
-	private String getFixedIdForSync(AdmObject obj, int objMark){
-		String bimId = null;
-		JsonNode node = obj.getInfo("bimId");
-		if(node != null)
-			bimId = node.asText();
-
-		if(StrUtil.isNotBlank(bimId))
-			return bimId;
-
-		if(objMark == 1) //建筑
-			return obj.getLocalId();
-		else if(objMark == 2) //楼层
-			return obj.getBuildingId() + ":" + obj.getLocalId();
-
-		return obj.getId();
-	}
-
-	private AdmObject mergeObj(AdmObject obj, AdmObject dbItem, String timestamp, int objMark){
-		if(objNotChange(obj, dbItem))
-			return null;
-
-		//合并属性和信息点
-//		if(objMark == 3) {//space
-//
-//		} else if(objMark == 4) {//equipment
-//
-//		}
-		if (obj.getInfos() != null) {
-			if (dbItem.getInfos() == null)
-				dbItem.setInfos(obj.getInfos());
-			else
-				dbItem.getInfos().setAll(obj.getInfos());
-		}
-
-		dbItem.setModifiedTime(timestamp);
-		dbItem.setModifier(AdmConst.CREATOR_SYNC);
-		//dbItem.setUploadFlag(null);
-		dbItem.setD2mState(ValidEnum.TRUE.getType());
-		dbItem.setDeliveryState(ValidEnum.FALSE.getType());
-
-		return dbItem;
-	}
-
-	private boolean objNotChange(AdmObject obj, AdmObject dbItem){
-		//TODO 数据无变化判断
-		return false;
-	}
-
-	private <T extends OBase> void transEntities(List<AdmObject> targetList, List<T> list, SetDataAction setDataAction){
-		if(list != null && list.size() > 0) {
-			for(T item : list) {
-				AdmObject obj = buildAdmObject(item);
-				setDataAction.setData(obj, item);
-				targetList.add(obj);
-			}
-		}
-	}
-
-	private AdmObject buildAdmObject(OBase base){
-		AdmObject obj = new AdmObject();
-		obj.setId(base.getId());
-		obj.setLocalId(base.getLocalId());
-		obj.setName(base.getName());
-		obj.setLocalName(base.getLocalName());
-		obj.setObjType(base.getObjectType());
-
-		if (base.getInfos() != null)
-			obj.setInfos(mapToNode(base.getInfos()));
-
-		if(base.getCreateTime() != null) //同步数据中没有createTime时,设置为当前时间
-			obj.setCreationTime(DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN));
-
-		obj.setValid(ValidEnum.TRUE.getType());
-
-		return obj;
-	}
-
-	private void setBdData(AdmObject obj, OBuilding bd){
-		obj.setProjectId(bd.getProjectId());
-		obj.setClassCode(bd.getObjectType());
-		//obj.setBuildingId(bd.getId());
-
-		if(bd.getDefaultQRCode() != null)
-			getInfos(obj).put("defaultQRCode", bd.getDefaultQRCode());
-		if(bd.getBuildQRCode() != null)
-			getInfos(obj).put("buildQRCode", bd.getBuildQRCode());
-	}
-
-	private void setFlData(AdmObject obj, OFloor fl){
-		obj.setProjectId(fl.getProjectId());
-		obj.setBuildingId(fl.getBuildingId());
-		//obj.setFloorId(fl.getId());
-		obj.setClassCode(fl.getObjectType());
-
-		setInfos(obj, fl, "projectId", "buildingId", "floorId");
-	}
-
-	private void setSpData(AdmObject obj, OSpace sp) {
-		obj.setProjectId(sp.getProjectId());
-		obj.setBuildingId(sp.getBuildingId());
-		obj.setFloorId(sp.getFloorId());
-		obj.setClassCode(sp.getClassCode());
-		obj.setObjType(AdmConst.OBJ_TYPE_SPACE);
-
-		setInfos(obj, sp, "projectId", "buildingId", "floorId", "classCode");
-	}
-
-	private void setEqData(AdmObject obj, OEquip eq) {
-		obj.setProjectId(eq.getProjectId());
-		obj.setBuildingId(eq.getBuildingId());
-		obj.setFloorId(eq.getFloorId());
-		obj.setClassCode(eq.getClassCode());
-
-		setInfos(obj, eq, "projectId", "buildingId", "floorId", "propertyId", "classCode");
-	}
-
-	private void setInfos(AdmObject obj, OBase oEntity, String... ignoreFields){
-		Field[] fields = oEntity.getClass().getDeclaredFields();
-		for (Field field : fields) {
-			if(ignoreFields.length == 0 || !ArrayUtil.contains(ignoreFields, field.getName())) {
-				Object val = ReflectUtil.getFieldValue(oEntity, field);
-				if(val != null) {
-					ObjectNode infos = getInfos(obj);
-					if(val instanceof String)
-						infos.put(field.getName(), (String)val);
-					else if(val instanceof Integer)
-						infos.put(field.getName(), (Integer)val);
-					else if(val instanceof Float)
-						infos.put(field.getName(), (Float)val);
-					else if(val instanceof Double)
-						infos.put(field.getName(), (Double)val);
-					else if(val instanceof List)
-						infos.putArray(field.getName()).addAll(listToNode((List)val));
-					else if(val instanceof Map)
-						infos.putObject(field.getName()).setAll(mapToNode((Map)val));
-				}
-			}
-		}
-	}
-
-	private ObjectNode getInfos(AdmObject obj) {
-		ObjectNode objectNode = obj.getInfos();
-		if(objectNode == null){
-			ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-			objectNode = objectMapper.createObjectNode();
-			obj.setInfos(objectNode);
-		}
-		return objectNode;
-	}
-
-	private ObjectNode mapToNode(Map<String, Object> map){
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-		try {
-			String json = objectMapper.writeValueAsString(map);
-			return objectMapper.readValue(json, ObjectNode.class);
-		} catch (IOException e) {
-			throw new BusinessException(ResponseCode.A0427.getCode(), ResponseCode.A0427.getDesc());
-		}
-	}
-
-	private ArrayNode listToNode(List<Object> list){
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-		try {
-			String json = objectMapper.writeValueAsString(list);
-			return objectMapper.readValue(json, ArrayNode.class);
-		} catch (IOException e) {
-			throw new BusinessException(ResponseCode.A0427.getCode(), ResponseCode.A0427.getDesc());
-		}
-	}
-
-	interface SetDataAction {
-		void setData(AdmObject obj, OBase oldAdmEntity);
-	}
-
-	/**
-	 * 创建/合并任务空间数据
-	 */
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void handleJobSpace(String projectId){
-		QueryWrapper<AdmObject> queryWrapper = new QueryWrapper<>();
-		queryWrapper.eq("project_id", projectId).eq("obj_type", AdmConst.OBJ_TYPE_SPACE).eq("valid", ValidEnum.TRUE.getType()).orderByAsc("floor_id");
-		List<AdmObject> spaceList = objectMapper.selectList(queryWrapper);
-
-		QueryWrapper<AdmJobSpace> wrapper = new QueryWrapper<>();
-		wrapper.eq("project_id", projectId).eq("valid", ValidEnum.TRUE.getType());
-		List<AdmJobSpace> jobSpaceList = jobSpaceMapper.selectList(wrapper);
-
-		//空间按层分组,优先使用OtherZone,缺省GeneralZone
-		LinkedHashMap<String, List<AdmObject>> map = new LinkedHashMap<>();
-		String floorId = null;
-		List<AdmObject> generalList = null;
-		List<AdmObject> otherList = null;
-		for(AdmObject sp : spaceList){
-			if(floorId == null || !floorId.equals(sp.getFloorId())) {
-				if(floorId != null)
-					map.put(floorId, otherList.size() > 0 ? otherList : generalList);
-
-				floorId = sp.getFloorId();
-				generalList = new ArrayList<>();
-				otherList = new ArrayList<>();
-			}
-
-			String zone = sp.getClassCode();
-			if("GeneralZone".equals(zone))
-				generalList.add(sp);
-			else if("OtherZone".equals(zone))
-				otherList.add(sp);
-		}
-		if(floorId != null)
-			map.put(floorId, otherList.size() > 0 ? otherList : generalList);
-
-		List<AdmJobSpace> toCreate = new ArrayList<>();
-		List<AdmJobSpace> toModify = new ArrayList<>();
-
-		String time = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
-
-		//按楼层进行空间匹配操作
-		for (Map.Entry<String, List<AdmObject>> entry : map.entrySet()) {
-			floorId = entry.getKey();
-
-			HashMap<String, AdmJobSpace> jobMap = new HashMap<>();
-			for (int i = 0; i < jobSpaceList.size(); i++) {
-				AdmJobSpace jobSpace = jobSpaceList.get(i);
-				if(jobSpace.getFloorId().equals(floorId)){
-					jobMap.put(jobSpace.getSpaceId(), jobSpace);
-
-					jobSpaceList.remove(i);
-					i--;
-				}
-			}
-
-			List<AdmObject> sps = entry.getValue();
-			for(AdmObject sp : sps){
-				ArrayNode spOutline = (ArrayNode) sp.getInfo("outline");
-				AdmJobSpace job = jobMap.remove(sp.getId());
-				if(job != null) {
-					//id匹配,轮廓变化的空间,重置任务状态
-					if(!outlineMatch(job.getOutline(), spOutline)){
-						job.setArchState(AdmConst.JOB_STATE_PROCESSING);
-						job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
-						job.setOutline(spOutline);
-						toModify.add(job);
-					} // else id和轮廓都匹配,不做处理
-				} else {
-					//id未匹配,轮廓完全一致的任务空间,重新设置spaceId
-					job = matchByOutline(jobMap, sp);
-					if(job != null) {
-						job.setSpaceId(sp.getId());
-						toModify.add(job);
-					}
-				}
-
-				if (job == null) {
-					job = new AdmJobSpace();
-					job.setId(IdUtil.fastSimpleUUID());
-					job.setSpaceId(sp.getId());
-					job.setOutline((ArrayNode) sp.getInfo("outline"));
-					job.setArchState(AdmConst.JOB_STATE_PROCESSING);
-					job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
-					job.setProjectId(projectId);
-					job.setBuildingId(sp.getBuildingId());
-					job.setFloorId(sp.getFloorId());
-					job.setCreationTime(time);
-					job.setCreator(AdmConst.CREATOR_SYNC);
-					job.setValid(ValidEnum.TRUE.getType());
-
-					toCreate.add(job);
-				}
-			}
-
-			//楼层中未找到匹配关系的任务空间
-			for(AdmJobSpace job : jobMap.values()){
-				job.setValid(ValidEnum.FALSE.getType());
-				toModify.add(job);
-			}
-		}
-
-		//项目下未找到匹配关系的任务空间
-		for(AdmJobSpace job : jobSpaceList){
-			job.setValid(ValidEnum.FALSE.getType());
-			toModify.add(job);
-		}
-
-		for(AdmJobSpace job : toCreate) {
-			jobSpaceMapper.insert(job);
-		}
-		for(AdmJobSpace job : toModify) {
-			job.setModifiedTime(time);
-			job.setModifier(AdmConst.CREATOR_SYNC);
-			//job.setUploadFlag(null);
-			jobSpaceMapper.updateById(job);
-		}
-	}
-
-	private AdmJobSpace matchByOutline(HashMap<String, AdmJobSpace> jobMap, AdmObject space){
-		if(jobMap.size() == 0)
-			return null;
-
-		ArrayNode o1 = (ArrayNode) space.getInfo("outline");
-		if(!isValidOutline(o1))
-			return null;
-
-		Polygon[] ps = GeomUtil.getPolygon(o1);
-		Map.Entry<String, AdmJobSpace> target = null;
-		for(Map.Entry<String, AdmJobSpace> entry : jobMap.entrySet()){
-			ArrayNode o2 = entry.getValue().getOutline();
-			if(isValidOutline(o2) && polygonsMatch(ps, GeomUtil.getPolygon(o2))){
-				target = entry;
-				break;
-			}
-		}
-		if(target != null){
-			jobMap.remove(target.getKey());
-			return target.getValue();
-		}
-		return null;
-	}
-
-	/**
-	 * 判断空间轮廓是否变化
-	 * TODO 区分覆盖等情况
-	 */
-	private boolean outlineMatch(ArrayNode o1, ArrayNode o2){
-		return polygonsMatch(GeomUtil.getPolygon(o1), GeomUtil.getPolygon(o2));
-	}
-
-
-	/**
-	 * 轮廓匹配判断
-	 * TODO 暂不考虑顺序
-	 */
-	private boolean polygonsMatch(Polygon[] ps1, Polygon[] ps2){
-		if (ps1.length == ps2.length) {
-			for (int i = 0; i < ps2.length; i++) {
-				if (!ps1[i].equalsExact(ps2[i]))
-					return false;
-			}
-			return true;
-		}
-		return false;
-	}
-
-	private boolean isValidOutline(ArrayNode outline) {
-		if(outline != null && outline.size() > 0 && outline.get(0).isArray()) {
-			ArrayNode o1 = (ArrayNode) outline.get(0);
-			if (o1.size() > 0 && o1.get(0).isArray()) {
-				ArrayNode o2 = (ArrayNode) o1.get(0);
-				return o2.size() >= 3;
-			}
-		}
-		return false;
-	}
-
-	@Autowired
-	private OldAdmClient oldAdmClient;
-
-	/**
-	 *	把地图文件从image-service转存到文件服务
-	 */
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void uploadFloorMap(String groupCode, String projectId) {
-		/* 不使用
-		List<AdmObject> floors = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_FLOOR);
-		List<AdmObject> modifiedFloors = new ArrayList<>();
-		for(AdmObject floor : floors) {
-			ObjectNode infos = floor.getInfos();
-			if(infos != null) {
-				JsonNode mapNode = infos.get("floorMap");
-				JsonNode mapIdNode = infos.get("floorMapId");
-				if(mapNode != null){
-					String map = mapNode.asText();
-					String mapId = mapIdNode != null ? mapIdNode.asText() : null;
-					if(mapId != null) {
-						FileInfo fileInfo = FileClientFacade.load(mapId);
-						if(fileInfo != null && fileInfo.getFileName().equals(map))
-							continue; //文件无变化
-
-						//删除之前的地图文件
-						FileStorageHelper.deleteFile(mapId);
-					}
-
-					try {
-						Response serviceResponse = oldAdmClient.getFloorMap(map, "revit");
-						Response.Body body = serviceResponse.body();
-
-						InputStream inputStream = body.asInputStream();
-						FileInfo fileInfo = FileInfoCreator.of(groupCode, projectId, AdmConst.APP_ID, map);
-						String fileId = FileStorageHelper.uploadFile(fileInfo, inputStream);
-
-						infos.put("floorMapId", fileId);
-						modifiedFloors.add(floor);
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-			}
-		}
-
-		objectService.update(modifiedFloors);
-		*/
-	}
-
-}

+ 30 - 41
adm-business/adm-server/src/main/resources/application-dev.yml

@@ -1,42 +1,31 @@
-server:
-  port: 8876
-spring:
-  datasource:
-    dynamic:
-      datasource:
-        master:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          username: root
-          password: persagy@2021
-          url: jdbc:mysql://192.168.100.91:9934/adm-server?allowMultiQueries=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
+#server:
+#  port: 8876
+#spring:
+#  datasource:
+#    dynamic:
+#      datasource:
+#        master:
+#          driver-class-name: com.mysql.cj.jdbc.Driver
 #          username: root
-#          password: Bdtp@1qaz@WSX
-#          url: jdbc:mysql://cd-cdb-nboe1rje.sql.tencentcdb.com:61955/adm-poc?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
-  rabbitmq:
-    host: 192.168.100.93
-    port: 9936
-    username: pbsage
-    password: pbsage123
-    virtualHost: /test
-persagy:
-  common:
-    file:
-      storage: 0
-      url: http://192.168.100.102:31335/
-      accessKey: persagy
-      secretKey: persagy@2021
-    token:
-      enabled: false
-  adm:
-    oldPlatformUrl: http://39.102.40.239
-  bdtp:
-    rwd:
-      service: http://develop.ysbdtp.com/dmp-rwd
-    file:
-      service: http://develop.ysbdtp.com/dmp-file
-    dic:
-      service: http://develop.ysbdtp.com/dmp-dic
-mybatis-plus:
-  type-handlers-package: com.persagy.**.typehandler
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#          password: persagy@2021
+#          url: jdbc:mysql://192.168.100.91:9934/adm-server?allowMultiQueries=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
+#  rabbitmq:
+#    host: 192.168.100.93
+#    port: 9936
+#    username: pbsage
+#    password: pbsage123
+#    virtualHost: /test
+#persagy:
+#  adm:
+#    oldPlatformUrl: http://39.102.40.239
+#  bdtp:
+#    rwd:
+#      service: http://develop.ysbdtp.com/dmp-rwd
+#    file:
+#      service: http://develop.ysbdtp.com/dmp-file
+#    dic:
+#      service: http://develop.ysbdtp.com/dmp-dic
+#mybatis-plus:
+#  type-handlers-package: com.persagy.**.typehandler
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

+ 28 - 36
adm-business/adm-server/src/main/resources/application-test.yml

@@ -1,37 +1,29 @@
-server:
-  port: 8876
-spring:
-  datasource:
-    dynamic:
-      datasource:
-        master:
-          driver-class-name: com.mysql.cj.jdbc.Driver
-          username: root
-          password: Bdtp@1qaz@WSX
-          url: jdbc:mysql://10.0.0.5:3306/adm-poc?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
-  rabbitmq:
-    host: 82.156.204.212
-    port: 9936
-    username: admin
-    password: bdtp123456
-    virtualHost: /test
-persagy:
-  common:
+#server:
+#  port: 8876
+#spring:
+#  datasource:
+#    dynamic:
+#      datasource:
+#        master:
+#          driver-class-name: com.mysql.cj.jdbc.Driver
+#          username: root
+#          password: Bdtp@1qaz@WSX
+#          url: jdbc:mysql://10.0.0.5:3306/adm-poc?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
+#  rabbitmq:
+#    host: 82.156.204.212
+#    port: 9936
+#    username: admin
+#    password: bdtp123456
+#    virtualHost: /test
+#persagy:
+#  adm:
+#    oldPlatformUrl: http://39.102.40.239
+#  bdtp:
+#    rwd:
+#      service: http://82.157.151.123/dmp-rwd
 #    file:
-#      storage: 0
-#      url: http://192.168.100.102:31335/
-#      accessKey: persagy
-#      secretKey: persagy@2021
-    token:
-      enabled: false
-  adm:
-    oldPlatformUrl: http://39.102.40.239
-  bdtp:
-    rwd:
-      service: http://82.157.151.123/dmp-rwd
-    file:
-      service: http://82.157.151.123/dmp-file
-    dic:
-      service: http://82.157.151.123/dmp-dic
-mybatis-plus:
-  type-handlers-package: com.persagy.**.typehandler
+#      service: http://82.157.151.123/dmp-file
+#    dic:
+#      service: http://82.157.151.123/dmp-dic
+#mybatis-plus:
+#  type-handlers-package: com.persagy.**.typehandler

+ 163 - 0
adm-business/adm-server/src/main/resources/db/init/data.sql

@@ -0,0 +1,163 @@
+SHOW TABLES;
+
+truncate table `adm_define_problem_type`;
+#墙
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSWL', '墙', 'CFCSWL_LESS', '墙体缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSWL', '墙', 'CFCSWL_MORE', '墙体多余');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSWL', '墙', 'CFCSWL_MATERIAL_ERROR', '墙体材质错误');
+
+#楼板(地面)
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSFL', '楼板(地面)', 'CFCSFL_LESS', '楼板缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSFL', '楼板(地面)', 'CFCSFL_HOLE_LESS', '板洞缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSFL', '楼板(地面)', 'CFCSFL_ELEVATION_ERROR', '楼板标高错误');
+
+#柱
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSCL', '柱', 'CFCSCL_LESS', '柱缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSCL', '柱', 'CFCSCL_MORE', '柱多余');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSCL', '柱', 'CFCSCL_SECTION_SHAPE_ERROR', '柱截面形状错误');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFCSCL', '柱', 'CFCSCL_SIZE_ERROR', '柱尺寸错误');
+
+#物业空间
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'GeneralZone', '物业空间', 'GeneralZone_OUTLINE_ERROR', '重新绘制物业空间');
+
+#门
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEDR', '门', 'CFBEDR_LESS', '门缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEDR', '门', 'CFBEDR_MORE', '门多余');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEDR', '门', 'CFBEDR_PROPERTY_ERROR', '门属性错误');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEDR', '门', 'CFBEDR_POSITION_ERROR', '门位置错误');
+
+#窗
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEWN', '窗', 'CFBEWN_LESS', '窗缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEWN', '窗', 'CFBEWN_MORE', '窗多余');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEWN', '窗', 'CFBEWN_PROPERTY_ERROR', '窗属性错误');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFBEWN', '窗', 'CFBEWN_POSITION_ERROR', '窗位置错误');
+
+#停车位
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFPKPS', '停车位', 'CFPKPS_LESS', '停车位缺少');
+INSERT INTO `adm_define_problem_type`(`id`, `obj_type_code`, `obj_type_name`, `problem_type_code`, `problem_type_name`) VALUES (UUID(), 'CFPKPS', '停车位', 'CFPKPS_MORE', '停车位多余');
+
+#问题信息项记录点
+truncate table `adm_define_problem_info`;
+#墙体缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '墙体路由', 'CFCSWL_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'wallHeight', '墙体高度', 'CFCSWL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'materialType', '材质', 'CFCSWL_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "钢筋混凝土结构"}, {"code": "2", "name": "砌体结构"}, {"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'wallThick', '墙厚', 'CFCSWL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSWL_LESS', NULL, 'STRING', 0, NULL);
+
+#墙体多余
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '墙体路由', 'CFCSWL_MORE', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSWL_MORE', NULL, 'STRING', 0, NULL);
+
+#墙体材质错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '墙体路由', 'CFCSWL_MATERIAL_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'materialType', '材质', 'CFCSWL_MATERIAL_ERROR', NULL, 'ENUM', 0, '[{"code": "1", "name": "钢筋混凝土结构"}, {"code": "2", "name": "砌体结构"}, {"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'wallThick', '墙厚', 'CFCSWL_MATERIAL_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSWL_MATERIAL_ERROR', NULL, 'STRING', 0, NULL);
+
+#楼板缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '板轮廓', 'CFCSFL_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'height', '板高度(距本层标高的相对高度)', 'CFCSFL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSFL_LESS', NULL, 'STRING', 0, NULL);
+
+#板洞缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '洞口轮廓', 'CFCSFL_HOLE_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSFL_HOLE_LESS', NULL, 'STRING', 0, NULL);
+
+#楼板标高错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '板轮廓', 'CFCSFL_ELEVATION_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'height', '正确的板标高(距本层标高的相对高度)', 'CFCSFL_ELEVATION_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSFL_ELEVATION_ERROR', NULL, 'STRING', 0, NULL);
+
+#柱缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '标记缺少柱点', 'CFCSCL_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'crossShapeType', '柱样式', 'CFCSCL_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "方柱"}, {"code": "2", "name": "圆柱"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossLength', '长', 'CFCSCL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossWidth', '宽', 'CFCSCL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'circularCrossDiameter', '直径', 'CFCSCL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'columnLength', '柱高度', 'CFCSCL_LESS', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSCL_LESS', NULL, 'STRING', 0, NULL);
+
+#柱多余
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记多余柱点', 'CFCSCL_MORE', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSCL_MORE', NULL, 'STRING', 0, NULL);
+
+#柱截面形状错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记错误柱子', 'CFCSCL_SECTION_SHAPE_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'crossShapeType', '正确的截面形状', 'CFCSCL_SECTION_SHAPE_ERROR', NULL, 'ENUM', 0, '[{"code": "1", "name": "方柱"}, {"code": "2", "name": "圆柱"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossLength', '长', 'CFCSCL_SECTION_SHAPE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossWidth', '宽', 'CFCSCL_SECTION_SHAPE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'circularCrossDiameter', '直径', 'CFCSCL_SECTION_SHAPE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSCL_SECTION_SHAPE_ERROR', NULL, 'STRING', 0, NULL);
+
+#柱尺寸错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记错误柱子', 'CFCSCL_SIZE_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossLength', '长', 'CFCSCL_SIZE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'rectangleCrossWidth', '宽', 'CFCSCL_SIZE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'circularCrossDiameter', '直径', 'CFCSCL_SIZE_ERROR', 'mm', 'DOUBLE', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFCSCL_SIZE_ERROR', NULL, 'STRING', 0, NULL);
+
+#重新绘制物业空间
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '标记物业空间', 'GeneralZone_OUTLINE_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'RoomLocalName', '正确的空间名称', 'GeneralZone_OUTLINE_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'GeneralZone_OUTLINE_ERROR', NULL, 'STRING', 0, NULL);
+
+#门缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '标记缺少门位置', 'CFBEDR_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'equipmentType', '设备类', 'CFBEDR_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "门"}, {"code": "2", "name": "防火门"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'materialType', '门材质', 'CFBEDR_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "玻璃"}, {"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'openType', '开启方式', 'CFBEDR_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "卷帘门"},{"code": "2", "name": "平开门"}, {"code": "3", "name": "弹簧门"},{"code": "4", "name": "折叠门"},{"code": "5", "name": "推拉门"},{"code": "6", "name": "旋转门"},{"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'doorLeafType', '门扇类型', 'CFBEDR_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "单开"},{"code": "2", "name": "双开"},{"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'doorWidth ', '宽', 'CFBEDR_LESS', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'doorHeight ', '高', 'CFBEDR_LESS', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEDR_LESS', NULL, 'STRING', 0, NULL);
+
+#门多余
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记多余门位置', 'CFBEDR_MORE', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEDR_MORE', NULL, 'STRING', 0, NULL);
+
+#门属性错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记错误门', 'CFBEDR_PROPERTY_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'equipmentType', '正确的设备类', 'CFBEDR_PROPERTY_ERROR', NULL, 'ENUM', 0, '[{"code": "0", "name": "保持"},{"code": "1", "name": "门"}, {"code": "2", "name": "防火门"},{"code": "3", "name": "防火卷帘"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'materialType', '门材质', 'CFBEDR_PROPERTY_ERROR', NULL, 'ENUM', 0, '[{"code": "0", "name": "保持"},{"code": "1", "name": "玻璃"},{"code": "2", "name": "常规"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'openType', '开启方式', 'CFBEDR_PROPERTY_ERROR', NULL, 'ENUM', 0, '[{"code": "1", "name": "卷帘门"},{"code": "2", "name": "平开门"}, {"code": "3", "name": "弹簧门"},{"code": "4", "name": "折叠门"},{"code": "5", "name": "推拉门"},{"code": "6", "name": "旋转门"},{"code": "99", "name": "其他"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'doorWidth ', '宽', 'CFBEDR_PROPERTY_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'doorHeight ', '高', 'CFBEDR_PROPERTY_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEDR_PROPERTY_ERROR', NULL, 'STRING', 0, NULL);
+
+# 门位置错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'moveDirection', '移动方向', 'CFBEDR_POSITION_ERROR', NULL, 'ENUM', 0, '[{"code": "1", "name": "左"},{"code": "2", "name": "右"}, {"code": "3", "name": "上"},{"code": "4", "name": "下"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'moveDistance ', '移动距离', 'CFBEDR_POSITION_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEDR_POSITION_ERROR', NULL, 'STRING', 0, NULL);
+
+#窗缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '标记缺少窗位置', 'CFBEWN_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'equipmentType', '正确的设备类', 'CFBEWN_LESS', NULL, 'ENUM', 0, '[{"code": "1", "name": "窗"},{"code": "2", "name": "防火窗"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'windowWidth', '宽', 'CFBEWN_LESS', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'windowHeight ', '高', 'CFBEWN_LESS', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEWN_LESS', NULL, 'STRING', 0, NULL);
+
+#窗多余
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记多余窗位置', 'CFBEWN_MORE', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEWN_MORE', NULL, 'STRING', 0, NULL);
+
+#窗属性错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记错误窗', 'CFBEWN_PROPERTY_ERROR', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'equipmentType', '正确的设备类', 'CFBEWN_PROPERTY_ERROR', NULL, 'ENUM', 0, '[{"code": "0", "name": "窗"},{"code": "1", "name": "窗"},{"code": "2", "name": "防火窗"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'windowType', '正确的窗样式', 'CFBEWN_PROPERTY_ERROR', NULL, 'ENUM', 0, '[{"code": "0", "name": "保持"},{"code": "1", "name": "平开(推拉)窗"},{"code": "2", "name": "飘窗"},{"code": "3", "name": "百叶窗"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'windowWidth', '宽', 'CFBEWN_PROPERTY_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'windowHeight ', '高', 'CFBEWN_PROPERTY_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEWN_PROPERTY_ERROR', NULL, 'STRING', 0, NULL);
+
+#窗位置错误
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'moveDirection', '移动方向', 'CFBEWN_POSITION_ERROR', NULL, 'ENUM', 0, '[{"code": "1", "name": "左"},{"code": "2", "name": "右"}, {"code": "3", "name": "上"},{"code": "4", "name": "下"}]');
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'moveDistance ', '移动距离', 'CFBEWN_POSITION_ERROR', 'mm', 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFBEWN_POSITION_ERROR', NULL, 'STRING', 0, NULL);
+
+#停车位缺少
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'coordinate', '标记车位位置', 'CFPKPS_LESS', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFPKPS_LESS', NULL, 'STRING', 0, NULL);
+
+#停车位多余
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'objectId', '标记车位', 'CFPKPS_MORE', NULL, 'STRING', 0, NULL);
+INSERT INTO `adm_define_problem_info`(`id`, `code`, `name`, `problem_type_code`, `unit`, `data_type`, `is_multiple`, `data_source`) VALUES (UUID(), 'senceImg', '拍摄照片', 'CFPKPS_MORE', NULL, 'STRING', 0, NULL);

+ 373 - 0
adm-business/adm-server/src/main/resources/db/init/schema.sql

@@ -0,0 +1,373 @@
+CREATE TABLE IF NOT EXISTS `adm_cad`  (
+  `id` varchar(100) NOT NULL COMMENT '主键',
+  `file_key` varchar(255) NOT NULL COMMENT '存储系统的key',
+  `file_name` varchar(255) NOT NULL COMMENT '文件名称',
+  `major_code` varchar(255) NOT NULL COMMENT '所属专业编码 土建精装-CF|空调-AC|给排水-WS|消防-FF',
+  `major_name` varchar(255) NOT NULL COMMENT '所属专业名称',
+  `check_status` tinyint(1) NOT NULL COMMENT '核查状态 0-未完成 1-已完成',
+  `floor_id` varchar(255) NOT NULL COMMENT '楼层ID',
+  `building_id` varchar(255) NOT NULL COMMENT '建筑ID',
+  `project_id` varchar(255) NOT NULL COMMENT '项目ID',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `idx_combination`(`floor_id`, `building_id`, `project_id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = 'CAD图纸信息表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_client_flag`  (
+  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '自增id',
+  `user_id` varchar(40) NOT NULL COMMENT '用户id',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 181 DEFAULT CHARSET=utf8mb4 COMMENT = 'app客户端标记' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_component`  (
+  `id` varchar(40) NOT NULL,
+  `comp_code` varchar(100) NOT NULL COMMENT '构件编码',
+  `comp_name` varchar(100) NULL DEFAULT NULL COMMENT '构件名称',
+  `system_code` varchar(40) NOT NULL,
+  `class_code` varchar(40) NOT NULL,
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '构件库' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_config`  (
+  `id` varchar(40) NOT NULL,
+  `name` varchar(50) NOT NULL COMMENT '配置项名称',
+  `code` varchar(20) NOT NULL COMMENT '配置项代码',
+  `data` json NOT NULL COMMENT '配置项的具体内容',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '配置信息(空间任务状态(建筑结构,设备),问题状态,文件业务类型...)' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_container_config`  (
+  `id` varchar(40) NOT NULL,
+  `container_code` varchar(100) NOT NULL COMMENT '容器设备类型代码',
+  `widget_code` varchar(100) NOT NULL COMMENT '容器设备内部支持的无模型设备类型代码',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '容器设备-无模型设备配置' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_define_problem_info`  (
+  `id` varchar(40) NOT NULL,
+  `code` varchar(100) NOT NULL COMMENT '信息点编码,同类型下唯一,标准驼峰格式',
+  `name` varchar(200) NULL DEFAULT NULL COMMENT '信息点名称',
+  `problem_type_code` varchar(40) NULL DEFAULT NULL COMMENT '问题类型编码',
+  `unit` varchar(40) NULL DEFAULT NULL COMMENT '单位',
+  `data_type` varchar(40) NULL DEFAULT NULL COMMENT '数据类型',
+  `is_multiple` int(0) NULL DEFAULT NULL COMMENT '是否复数',
+  `data_source` json NULL COMMENT '数据源取值范围/枚举值清单等,根据dataType有不同的内容',
+  `remark` text NULL COMMENT '备注',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NOT NULL DEFAULT 1 COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '乐观锁',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '核查问题信息点定义表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_define_problem_type`  (
+  `id` varchar(64) NOT NULL COMMENT '主键',
+  `obj_type_code` varchar(64) NOT NULL COMMENT '对象类型编码',
+  `obj_type_name` varchar(64) NOT NULL COMMENT '对象类型名称',
+  `problem_type_code` varchar(64) NOT NULL COMMENT '问题类型编码',
+  `problem_type_name` varchar(64) NOT NULL COMMENT '问题类型名称',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(1) NULL DEFAULT 1 COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '对象类型与问题类型定义表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_file`  (
+  `id` varchar(40) NOT NULL,
+  `file_type` varchar(20) NULL DEFAULT NULL COMMENT '文件类型(photo|video|file|...)',
+  `biz_type` varchar(20) NOT NULL COMMENT '业务类型(object:对象附件|problem_arch:空间问题附件|problem_equip:设备问题附件)',
+  `file_path` varchar(100) NOT NULL COMMENT '文件存储路径(id)',
+  `client_path` varchar(100) NULL DEFAULT NULL COMMENT 'app端文件存储路径',
+  `ref_obj_id` varchar(100) NOT NULL COMMENT '关联的对象id',
+  `ref_info_code` varchar(40) NULL DEFAULT NULL COMMENT '关联的对象信息点code',
+  `remark` varchar(200) NULL DEFAULT NULL COMMENT '描述',
+  `order_num` tinyint(0) NULL DEFAULT NULL COMMENT '文件附件(照片)的排序序号',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `floor_id` varchar(60) NULL DEFAULT NULL COMMENT '楼层id',
+  `building_id` varchar(60) NULL DEFAULT NULL COMMENT '建筑id',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `file_id` varchar(40) NULL DEFAULT NULL COMMENT '文件服务中的存储id',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '文件附件' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_infos_config`  (
+  `id` varchar(40) NOT NULL,
+  `obj_type` varchar(40) NOT NULL COMMENT '对象类型(space|equipment)',
+  `name` varchar(50) NULL DEFAULT NULL COMMENT '对象类型名称',
+  `class_code` varchar(40) NOT NULL COMMENT '对象class_code',
+  `major_code` varchar(40) NULL DEFAULT NULL COMMENT '专业代码(类型为设备时)',
+  `system_code` varchar(40) NULL DEFAULT NULL COMMENT '系统代码(类型为设备时)',
+  `infos` json NOT NULL COMMENT '对象类型的信息详情点配置',
+  `flag` varchar(20) NULL DEFAULT NULL COMMENT '批量导入标记',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '对象详情点配置' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_job_space`  (
+  `id` varchar(40) NOT NULL,
+  `work_id` varchar(40) NULL DEFAULT NULL COMMENT '交付工作流程id',
+  `space_id` varchar(100) NOT NULL COMMENT '空间id',
+  `bim_id` varchar(100) NULL DEFAULT NULL COMMENT 'revit模型id',
+  `outline` json NULL COMMENT '空间边界,模型更新空间变化时,用来做匹配计算',
+  `space_type` varchar(20) NULL DEFAULT NULL COMMENT '任务空间类型(base|sub)',
+  `parent_space_id` varchar(100) NULL DEFAULT NULL COMMENT '父级空间id(空间类型为sub时)',
+  `arch_state` tinyint(0) NULL DEFAULT 0 COMMENT '建筑结构核查任务状态(0:待核查;1:核查中;2:核查完毕)',
+  `equip_state` tinyint(0) NULL DEFAULT 0 COMMENT '设备勘测任务状态(0:待勘测;1:勘测中;2:勘测完毕)',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NULL DEFAULT NULL COMMENT '建筑id',
+  `floor_id` varchar(60) NOT NULL COMMENT '楼层id',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '任务空间表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_m2d_equip`  (
+  `id` varchar(40) NOT NULL,
+  `name` varchar(50) NULL DEFAULT NULL COMMENT '范围定义名称',
+  `major_code` varchar(40) NULL DEFAULT NULL COMMENT '专业代码',
+  `system_code` varchar(40) NULL DEFAULT NULL COMMENT '系统代码',
+  `class_code` varchar(40) NULL DEFAULT NULL COMMENT '设备类代码',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '正向建模的设备类型范围' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_message_p`  (
+  `id` varchar(40) NOT NULL COMMENT '消息id',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `trigger_type` varchar(20) NOT NULL COMMENT '触发类型',
+  `sender` varchar(40) NOT NULL COMMENT '发送者',
+  `content` json NOT NULL COMMENT '消息内容',
+  `status` varchar(10) NOT NULL COMMENT '消息状态(processing|finished|error)',
+  `send_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '消息发送时间',
+  `return_content` json NULL COMMENT '消息响应的返回内容',
+  `return_time` timestamp(0) NULL DEFAULT NULL COMMENT '接收到消息响应的时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '消息表(生产者)' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_pipe`  (
+  `id` varchar(100) NOT NULL,
+  `floor_id` varchar(60) NULL DEFAULT NULL COMMENT '楼层id',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `obj_from` varchar(100) NULL DEFAULT NULL COMMENT '管道的from端对象',
+  `type_from` varchar(20) NULL DEFAULT NULL COMMENT 'from端对象类型(equipment:设备;pipe:管道)',
+  `obj_to` varchar(100) NULL DEFAULT NULL COMMENT '管道的to端对象',
+  `type_to` varchar(20) NULL DEFAULT NULL COMMENT 'to端对象类型(equipment:设备;pipe:管道)',
+  `direction` int(0) NULL DEFAULT NULL COMMENT '管道方向(1:正向from->to;-1:反向to->from;0:无方向)',
+  `pipe_type` varchar(40) NOT NULL COMMENT '管道的数据字典类型(OTLAPL: 液体管道|OTAAPL: 气体管道)',
+  `pipe_sub_type` varchar(100) NULL DEFAULT NULL COMMENT '管道用途',
+  `route` json NULL COMMENT '管道路由(坐标列表格式:[{x:1,y:1,z:1}])',
+  `infos` json NULL COMMENT '管道的信息点',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '管道数据-交付阶段' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_pipe_config`  (
+  `id` varchar(40) NOT NULL,
+  `class_code_from` varchar(40) NOT NULL COMMENT 'from端设备对象class_code',
+  `pipe_type` varchar(40) NOT NULL COMMENT '管道类型(数据字典定义的设备类型)',
+  `pipe_sub_type` varchar(40) NULL DEFAULT NULL COMMENT '管道用途(业务定义补充描述类型) 数据字典4.0后取消',
+  `pipe_direction` tinyint(0) NOT NULL COMMENT '管道方向(1:正向from->to;-1:反向to->from;0:无方向)',
+  `pipe_description` varchar(200) NULL DEFAULT NULL COMMENT '文字描述信息',
+  `class_code_to` varchar(40) NOT NULL COMMENT 'to端设备对象class_code',
+  `flag` varchar(20) NULL DEFAULT NULL COMMENT '批量导入标记',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '对象类型-管道配置' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_problem`  (
+  `id` varchar(100) NOT NULL,
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `floor_id` varchar(60) NOT NULL COMMENT '问题所在楼层id',
+  `file_id` varchar(100) NULL DEFAULT NULL COMMENT '核查对应的文件ID',
+  `check_type` varchar(10) NOT NULL COMMENT '1 空间 2对象',
+  `obj_type_code` varchar(40) NOT NULL COMMENT '问题对象类型',
+  `obj_type_name` varchar(40) NOT NULL COMMENT '问题对象类型名称',
+  `obj_id` varchar(100) NULL DEFAULT NULL COMMENT '问题对象id',
+  `obj_name` varchar(40) NULL DEFAULT NULL COMMENT '问题对象名称',
+  `type_code` varchar(20) NOT NULL COMMENT '问题类型编码',
+  `type_name` varchar(40) NOT NULL COMMENT '问题类型名称',
+  `info` json NULL COMMENT '问题描述',
+  `state` tinyint(0) NOT NULL COMMENT '建筑结构核查任务状态(1:有效;2:已解决)',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(1) NULL DEFAULT 1 COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE,
+  INDEX `idx_pbf`(`project_id`, `building_id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '核查问题表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_problem_arch`  (
+  `id` varchar(100) NOT NULL,
+  `work_id` varchar(40) NULL DEFAULT NULL COMMENT '交付工作流程id',
+  `floor_id` varchar(60) NOT NULL COMMENT '问题所在楼层id',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `geom_type` varchar(20) NULL DEFAULT NULL COMMENT '问题记录的几何类型(point|line|polygon)',
+  `geom` json NULL COMMENT '问题记录的几何数据(统一为列表格式:[{x:1,y:1}])',
+  `problem_type` varchar(20) NULL DEFAULT NULL COMMENT '问题类型',
+  `message` varchar(1000) NULL DEFAULT NULL COMMENT '问题描述',
+  `problem_state` tinyint(0) NOT NULL COMMENT '建筑结构核查任务状态(1:有效;2:已解决)',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '建筑结构问题' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_problem_equip`  (
+  `id` varchar(40) NOT NULL,
+  `work_id` varchar(40) NULL DEFAULT NULL COMMENT '交付工作流程id',
+  `floor_id` varchar(60) NOT NULL COMMENT '问题所在楼层id',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `equip_id` varchar(100) NOT NULL COMMENT '设备id',
+  `problem_type` varchar(20) NULL DEFAULT NULL COMMENT '问题类型',
+  `message` varchar(1000) NULL DEFAULT NULL COMMENT '问题描述',
+  `problem_state` tinyint(0) NOT NULL COMMENT '设备核查任务状态(1:有效;2:已解决)',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '设备问题' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_qr_code`  (
+  `id` varchar(40) NOT NULL,
+  `qr_code` varchar(100) NOT NULL COMMENT '二维码数据值',
+  `obj_id` varchar(100) NOT NULL COMMENT '二维码对应的对象id',
+  `floor_id` varchar(60) NOT NULL COMMENT '楼层id',
+  `location` json NOT NULL COMMENT '位置坐标({x:1,y:1,z:1})',
+  `remark` varchar(200) NULL DEFAULT NULL COMMENT '描述信息(临时记录二维码粘贴位置)',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '二维码' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_rels_config`  (
+  `id` varchar(40) NOT NULL,
+  `obj_type_from` varchar(40) NOT NULL COMMENT 'from端对象类型(space|equipment)',
+  `class_code_from` varchar(40) NOT NULL COMMENT 'from端对象class_code',
+  `graph_code` varchar(40) NOT NULL COMMENT '关系的图类型代码',
+  `graph_name` varchar(100) NULL DEFAULT NULL COMMENT '关系的图类型名称',
+  `rel_code` varchar(40) NOT NULL COMMENT '关系的边类型代码',
+  `rel_name` varchar(100) NULL DEFAULT NULL COMMENT '关系的边类型名称',
+  `obj_type_to` varchar(40) NOT NULL COMMENT 'to端对象类型(space|equipment)',
+  `class_code_to` varchar(40) NOT NULL COMMENT 'to端对象class_code',
+  `direction` varchar(20) NULL DEFAULT NULL COMMENT '关系方向(fixed|optional|none)',
+  `flag` varchar(20) NULL DEFAULT NULL COMMENT '批量导入标记',
+  `project_id` varchar(40) NULL DEFAULT NULL COMMENT '项目id',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '对象类型-关系配置' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_serve_area`  (
+  `id` varchar(40) NOT NULL,
+  `obj_id` varchar(100) NOT NULL COMMENT '为该区域提供服务的设备id',
+  `floor_id` varchar(60) NULL DEFAULT NULL COMMENT '楼层id',
+  `geom_type` varchar(20) NOT NULL COMMENT '服务区域的几何类型(polygon:多边形|circle:圆形|ellipse:椭圆)',
+  `geom` json NOT NULL COMMENT '服务区域的轮廓几何信息(polygon对应xy坐标数组, circle和ellipse对应对象(圆心半径))',
+  `serve_type` varchar(40) NULL DEFAULT NULL COMMENT '服务的类型,照明回路等,暂时为空',
+  `remark` varchar(200) NULL DEFAULT NULL COMMENT '描述信息',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `building_id` varchar(60) NOT NULL COMMENT '建筑id',
+  `creator` varchar(32) NULL DEFAULT NULL COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT NULL COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT NULL COMMENT '合法标识',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '服务区域' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_upload_job`  (
+  `id` varchar(40) NOT NULL COMMENT '上传任务id',
+  `project_id` varchar(40) NOT NULL COMMENT '项目id',
+  `operator` varchar(40) NOT NULL COMMENT '操作人员id(user_id+client_flag_id)',
+  `status` varchar(10) NOT NULL COMMENT '任务状态(processing|finished|error)',
+  `start_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '开始时间',
+  `finish_time` timestamp(0) NULL DEFAULT NULL COMMENT '结束时间',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '上传任务表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `adm_upload_log`  (
+  `id` int(0) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
+  `job_id` varchar(40) NULL DEFAULT NULL COMMENT '上传任务id',
+  `operator` varchar(40) NULL DEFAULT NULL COMMENT '上传操作人',
+  `entity_type` varchar(30) NOT NULL COMMENT '实体类型',
+  `operation` varchar(10) NULL DEFAULT NULL,
+  `data` json NOT NULL COMMENT '上传的数据条目',
+  `ts` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '时间戳',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 24145 DEFAULT CHARSET=utf8mb4 COMMENT = '客户端上传日志' ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `project`  (
+  `id` varchar(80) NOT NULL COMMENT '项目id',
+  `name` varchar(50) NULL DEFAULT NULL COMMENT '项目名称',
+  `config_json` json NOT NULL COMMENT '模型解析的配置',
+  `type` varchar(50) NULL DEFAULT NULL COMMENT '空间类型',
+  `room_space` varchar(50) NULL DEFAULT NULL COMMENT '空间code',
+  `group_code` varchar(40) NOT NULL DEFAULT '0' COMMENT '集团编码',
+  `group_name` varchar(200) NULL DEFAULT NULL COMMENT '集团名称',
+  `creator` varchar(32) NULL DEFAULT '0' COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT '0' COMMENT '最后修改人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后修改时间',
+  `valid` tinyint(0) NULL DEFAULT 1 COMMENT '合法标识',
+  `ts` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '乐观锁',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT = Dynamic;
+
+CREATE TABLE IF NOT EXISTS `project_user`  (
+  `id` varchar(36) NOT NULL COMMENT '表主键',
+  `project_id` varchar(36) NOT NULL COMMENT '项目id',
+  `user_id` varchar(36) NOT NULL COMMENT '用户id',
+  `creator` varchar(32) NULL DEFAULT '0' COMMENT '创建人',
+  `creation_time` char(14) NULL DEFAULT NULL COMMENT '创建时间',
+  `modifier` varchar(32) NULL DEFAULT '0' COMMENT '最后更新人',
+  `modified_time` char(14) NULL DEFAULT NULL COMMENT '最后更新时间',
+  `valid` tinyint(0) NULL DEFAULT 1 COMMENT '合法标识',
+  `ts` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '乐观锁',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `project_user_pk_2`(`project_id`, `user_id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COMMENT = '项目用户关系表' ROW_FORMAT = Dynamic;

+ 1 - 3
docker/k8sfiles/adm-server-standard.yml

@@ -59,6 +59,4 @@ spec:
         - name: eureka.instance.health-check-url
           value: "http://${eureka.instance.ip-address}:${eureka.instance.non-secure-port}/${spring.application.name}/health"
         - name: eureka.instance.non-secure-port
-          value: "8080"
-        - name: mybatis-plus.configuration.log-impl
-          value: "org.apache.ibatis.logging.nologging.NoLoggingImpl"
+          value: "8080"