4 Commits af77a4896f ... 609a7e710c

Author SHA1 Message Date
  yucheng 609a7e710c Revert "apm系统图列表接口" 2 years ago
  yucheng c8fb8d56f6 Revert "模板编辑复制粘贴操作" 2 years ago
  yucheng d202b4916d Revert "设备节点锚点位置信息bug修复" 2 years ago
  yucheng 93846c1e7d Revert "修改配置文件" 2 years ago

+ 0 - 6
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -77,12 +77,6 @@ public class DiagramController {
 
         List<Diagram> diagramList = dataStrategy.getDiagrams(null, projectId,
                 (String) diagram.get("systemId"), groupCode, null, false);
-        if (diagramList != null) { //TODO 批量处理会导致接口响应慢,优化为列表和内容拆分的方式
-            diagramList.forEach(d -> {
-                diagramManager.buildDiagram(d);
-                d.toAbsoluteLocation();
-            });
-        }
 
         return diagramManager.json4View(ResultHelper.multi(diagramList));
     }

+ 0 - 10
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/TemplateController.java

@@ -106,14 +106,4 @@ public class TemplateController {
         return ResultHelper.single(templateManager.modifyDynGroup(params.getDynGroup(), params.getCurrentCompId(), params.getTemplateId()));
     }
 
-    @PostMapping("copyContent")
-    public CommonResult<String> copyContent(@RequestBody EditRequest params){
-        return ResultHelper.single(templateManager.getCopyContent(params.getCurrentCompId(), params.getTemplateId()));
-    }
-
-    @PostMapping("pasteContent")
-    public CommonResult<DiagramTemplate> pasteContent(@RequestBody EditRequest params){
-        return ResultHelper.single(templateManager.setPasteContent(params.getContent(), params.getCurrentCompId(), params.getTemplateId()));
-    }
-
 }

+ 1 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramDataLoader.java

@@ -70,7 +70,7 @@ public class DiagramDataLoader {
 				}
 
 				//设置anchorLocations
-				en.setAnchorLocations();
+				en.getAnchorLocations();
 			}
 
 			if(obj != null) {

+ 8 - 9
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/EquipmentNode.java

@@ -56,7 +56,7 @@ public class EquipmentNode extends DiagramNode implements IDataBind {
 			label.setLocation(new XY(10, 10)); //TODO
 		}
 
-		setAnchorLocations();
+		//TODO anchors
 	}
 
 	@Override
@@ -115,16 +115,15 @@ public class EquipmentNode extends DiagramNode implements IDataBind {
 		return legend;
 	}
 
-	public void setAnchorLocations() {
-		if (legend.getAnchors() != null) {
-			anchorLocations = new HashMap<>();
-			for (Anchor anchor : legend.getAnchors()) {
-				anchorLocations.put(anchor.getCode(), anchor.calcLocation(size));
+	public Map<String, XY> getAnchorLocations() {
+		if (anchorLocations == null) {
+			if (legend.getAnchors() != null) {
+				anchorLocations = new HashMap<>();
+				for (Anchor anchor : legend.getAnchors()) {
+					anchorLocations.put(anchor.getCode(), anchor.calcLocation(size));
+				}
 			}
 		}
-	}
-
-	public Map<String, XY> getAnchorLocations() {
 		return anchorLocations;
 	}
 

+ 0 - 2
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/frame/EditRequest.java

@@ -40,8 +40,6 @@ public class EditRequest {
 
 	private DynGroup dynGroup;
 
-	private String content;
-
 	@Data
 	public static class TemplatePropsData {
 

+ 0 - 61
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/TemplateManager.java

@@ -2,7 +2,6 @@ package com.persagy.adm.diagram.manage;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.diagram.core.ContentParser;
 import com.persagy.adm.diagram.core.DataStrategy;
@@ -402,64 +401,4 @@ public class TemplateManager {
         return saveTemplate(template);
     }
 
-    public String getCopyContent(String compId, String templateId){
-        DiagramTemplate template = dataStrategy.getTemplate(templateId);
-        template.init();
-
-        Object obj;
-        if(StrUtil.isNotBlank(compId)) {
-            obj = template.getContainerById(compId);
-            if(obj == null){
-                obj = template.getMainPipeById(compId);
-            }
-        } else {
-            obj = template;
-        }
-        return obj != null ? contentParser.toJson(obj) : "";
-    }
-
-    public DiagramTemplate setPasteContent(String content, String compId, String templateId){
-        DiagramTemplate template = dataStrategy.getTemplate(templateId);
-        template.init();
-
-        if(StrUtil.isNotBlank(content)) {
-            Map<String, Object> map = contentParser.parseContent(content, Map.class);
-            Object o = null;
-            if(Container.TYPE.equals(map.get("compType"))){
-                o = contentParser.parseContent(content, Container.class);
-            } else if(MainPipe.TYPE.equals(map.get("compType"))) {
-                o = contentParser.parseContent(content, MainPipe.class);
-            } else if(map.containsKey("frame")) {
-                o = contentParser.parseContent(content, DiagramTemplate.class);
-            }
-
-            if(o != null) {
-                if(o instanceof DiagramTemplate){
-                    DiagramTemplate other = (DiagramTemplate)o;
-                    if(StrUtil.isBlank(compId)) {
-                        template.setFrame(other.getFrame());
-                        template.setMainPipes(other.getMainPipes());
-                        template.setScatteredContainers(other.getScatteredContainers());
-                    }
-                } else if(o instanceof Container) {
-                    Container target = null;
-                    if(StrUtil.isNotBlank(compId)) {
-                        Container con = template.getContainerById(compId);
-                        if(con != null){
-                            target = con;
-                        }
-                    } else {
-                      target = template.getFrame();
-                    }
-                    if(target != null){
-                        target.addComp((Container)o);
-                    }
-                } else {
-                    //暂不支持干管粘贴
-                }
-            }
-        }
-        return saveTemplate(template);
-    }
-
 }

+ 33 - 3
adm-business/adm-diagram/src/main/resources/bootstrap.yml

@@ -4,8 +4,6 @@ spring:
   application:
     # 应用名称
     name: adm-diagram
-  main:
-    allow-bean-definition-overriding: true
   datasource:
     dynamic:
       datasource:
@@ -24,4 +22,36 @@ persagy:
     dic:
       service: http://develop.ysbdtp.com/dmp-dic
     file:
-      service: http://develop.ysbdtp.com/dmp-file
+      service: http://develop.ysbdtp.com/dmp-file
+
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#  datasource:
+#    druid:
+#      filters: stat,slf4j
+#      filter:
+#        wall:
+#          config:
+#            #允许一次执行多条语句
+#            multi-statement-allow: true
+#            #允许非基本语句的其他语句,开启后可以执行DDL语句
+#            none-base-statement-allow: true
+#          enabled: false
+#        slf4j:
+#          enabled: true
+
+config:
+  file:
+    absolute:
+      path: ${CONFIG_FILE_PATH:D:\SpringCloud}
+#feign:
+#  compression:
+#    request:
+#      # 开启请求压缩
+#      enabled: true
+#      # 配置压缩的 MIME TYPE
+#      mime-types: text/xml,application/xml,application/json
+#      # 配置压缩数据大小的下限
+#      min-request-size: 2048
+#    response:
+#      # 开启响应压缩
+#      enabled: true