فهرست منبع

Merge remote-tracking branch 'origin/develop' into develop

lijie 3 سال پیش
والد
کامیت
0938c2783a
100فایلهای تغییر یافته به همراه1546 افزوده شده و 1212 حذف شده
  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. 85 45
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramBuilder.java
  4. 129 112
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramDataLoader.java
  5. 16 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramException.java
  6. 13 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/line/LineLayoutManager.java
  7. 4 2
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/ConnectPoint.java
  8. 25 8
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/Diagram.java
  9. 14 7
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/AbstractComponent.java
  10. 24 12
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/Container.java
  11. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/base/PositionData.java
  12. 12 6
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Anchor.java
  13. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/legend/Legend.java
  14. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/AndFilter.java
  15. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/LogicFilter.java
  16. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/MatchFilter.java
  17. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/logic/OrFilter.java
  18. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/ContainerRefPoint.java
  19. 14 7
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/DiagramTemplate.java
  20. 4 0
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/template/MainPipe.java
  21. 2 1
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/virtual/PackNode.java
  22. 10 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GeomUtil.java
  23. 10 10
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GsonUtil.java
  24. 365 346
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java
  25. 8 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/DemoDiagramManager.java
  26. 5 3
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/Folder.java
  27. 3 4
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/LegendManager.java
  28. 373 358
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/TemplateManager.java
  29. 121 112
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/service/BdtpDataService.java
  30. 3 2
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/Pagination.java
  31. 7 5
      adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/util/ServiceUtil.java
  32. 2 2
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/DefineInfoMigration.java
  33. 15 3
      adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/ObjectRelationMigration.java
  34. 3 3
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/aop/ExceptionAspect.java
  35. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/DicClient.java
  36. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/ImageServiceClient.java
  37. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/OldAdmClient.java
  38. 3 3
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/RwdClient.java
  39. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmConst.java
  40. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmMessageConst.java
  41. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmRequest.java
  42. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmResult.java
  43. 1 5
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/AdmCommonConfig.java
  44. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/AdmRabbitConfig.java
  45. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/TestConfig.java
  46. 6 6
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/AdmFileController.java
  47. 11 11
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/AppController.java
  48. 5 5
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/ManageController.java
  49. 13 11
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/ToolController.java
  50. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmCadMapper.java
  51. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmClientFlagMapper.java
  52. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmComponentMapper.java
  53. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmConfigMapper.java
  54. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmContainerConfigMapper.java
  55. 16 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmDefineProblemInfoMapper.java
  56. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmDefineProblemTypeMapper.java
  57. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmFileMapper.java
  58. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmInfosConfigMapper.java
  59. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmJobSpaceMapper.java
  60. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmM2dEquipMapper.java
  61. 2 3
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmMessagePMapper.java
  62. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmObjectMapper.java
  63. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmPipeConfigMapper.java
  64. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmPipeMapper.java
  65. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemArchMapper.java
  66. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemEquipMapper.java
  67. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemMapper.java
  68. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmQrCodeMapper.java
  69. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmRelationMapper.java
  70. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmRelsConfigMapper.java
  71. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmServeAreaMapper.java
  72. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmUploadJobMapper.java
  73. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmUploadLogMapper.java
  74. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/DataTxHandler.java
  75. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/ObjectForTx.java
  76. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/ObjectMapper4Tx.java
  77. 2 3
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/AdmCad.java
  78. 101 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmDefineProblemInfo.java
  79. 2 4
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/AdmProblem.java
  80. 2 6
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/BuildingData.java
  81. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/CadFileInfo.java
  82. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/CadFileQueryParam.java
  83. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/D2mMessage.java
  84. 1 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/Dict.java
  85. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/DownLoadData.java
  86. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/InfoDef.java
  87. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/Pagination.java
  88. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/ProjectData.java
  89. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/TypeDef.java
  90. 2 2
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/UploadData.java
  91. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/UploadRtn.java
  92. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmClientFlag.java
  93. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmComponent.java
  94. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmConfig.java
  95. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmContainerConfig.java
  96. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmDefineProblemType.java
  97. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmFile.java
  98. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmInfosConfig.java
  99. 1 1
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmJobSpace.java
  100. 0 0
      adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmM2dEquip.java

+ 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")

+ 85 - 45
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramBuilder.java

@@ -55,19 +55,25 @@ public class DiagramBuilder {
 	private void init(){
 		//记录节点中已使用的数据id
 		diagram.getNodes().forEach(node -> {
-			if (EquipmentNode.TYPE.equals(node.getCompType()))
+			if (EquipmentNode.TYPE.equals(node.getCompType())) {
 				equipMap.put(((EquipmentNode) node).getObjId(), node);
+			}
 		});
 		//记录干管中已使用的数据id
 		if(template.getMainPipes() != null) {
 			template.getMainPipes().forEach(mainPipe -> {
-				if(StrUtil.isNotBlank(mainPipe.getDataObjectId()))
+				if(StrUtil.isNotBlank(mainPipe.getDataObjectId())) {
 					equipMap.put(mainPipe.getDataObjectId(), mainPipe);
+				}
 			});
 		}
 	}
 
-	//加载设备数据,并进行计算处理
+	/**
+	 * 加载设备数据,并进行计算处理
+	 * @param containers 容器列表
+	 * @param optionalObjs 节点列表
+	 */
 	public void buildEquipNodeAndContainer(List<Container> containers, List<ObjectNode> optionalObjs){
 		for(Container con : containers) {
 			if(con.isEquipmentBox()) {
@@ -75,10 +81,11 @@ public class DiagramBuilder {
 				while (iter.hasNext()) {
 					ObjectNode obj = iter.next();
 					if (match(obj, con)) {
-						if(con.getEquipPack() != null)
+						if(con.getEquipPack() != null) {
 							addPackData(con, obj);
-						else
+						} else {
 							addEquipNode(con, obj);
+						}
 
 						iter.remove();
 					}
@@ -111,8 +118,9 @@ public class DiagramBuilder {
 	}
 
 	private void addEquipNode(Container con, ObjectNode obj){
-		if(con.getChildren().size() > equipLimit)
+		if(con.getChildren().size() > equipLimit) {
 			return;
+		}
 
 		EquipmentNode node = new EquipmentNode();
 		node.setId(IdUtil.simpleUUID());
@@ -145,16 +153,20 @@ public class DiagramBuilder {
 		PackNode pn = null;
 		String classCode = getClassCode(obj);
 		Legend legend = null;
-		if(!con.getEquipPack().isPackByType()) { //single
+		//single
+		if(!con.getEquipPack().isPackByType()) {
 			String packName = con.getEquipPack().getPackName();
-			if(StrUtil.isBlank(packName))
+			if(StrUtil.isBlank(packName)) {
 				packName = getTypeName(classCode);
-			if(con.getChildren().size() == 0)
+			}
+			if(con.getChildren().size() == 0) {
 				pn = newPackNode(PackNode.SINGLE_PACK, con, packName);
-			else
+			} else {
 				pn = (PackNode) con.getChildren().get(0);
-			if(con.getEquipPack().getLegendId() != null)
+			}
+			if(con.getEquipPack().getLegendId() != null) {
 				legend = dataStrategy.getLegend(con.getEquipPack().getLegendId(), classCode.substring(0, 4));
+			}
 		} else { //group
 			for(IComponent comp : con.getChildren()) {
 				PackNode item = (PackNode) comp;
@@ -163,15 +175,18 @@ public class DiagramBuilder {
 					break;
 				}
 			}
-			if(pn == null)
+			if(pn == null) {
 				pn = newPackNode(classCode, con, getTypeName(classCode));
+			}
 		}
 
 		if (pn.getLegend() == null) {
-			if(con.getEquipPack().getLegendId() != null)
+			if(con.getEquipPack().getLegendId() != null) {
 				legend = dataStrategy.getLegend(con.getEquipPack().getLegendId(), classCode.substring(0, 4));
-			if(legend == null)
+			}
+			if(legend == null) {
 				legend = findLegend(classCode, null);
+			}
 
 			pn.setLegendId(legend.getId());
 			pn.setLegend(legend);
@@ -194,8 +209,9 @@ public class DiagramBuilder {
 		String classCode = DiagramBuilder.getClassCode(obj);
 		if(equipHolder.getEquipmentTypes() != null && equipHolder.getEquipmentTypes().contains(classCode)) {
 			DataFilter filter = equipHolder.getDataFilter();
-			if(filter != null)
+			if(filter != null) {
 				return filter.filter(obj);
+			}
 			return true;
 		}
 		return false;
@@ -204,8 +220,9 @@ public class DiagramBuilder {
 	private void buildContainers(List<Container> containers) {
 		for(Container con : containers) {
 			if(con.isEquipmentBox()) {
-				if(Boolean.TRUE.equals(con.getProp(Container.PROP_AUTO_HIDDEN)) && CollUtil.isEmpty(con.getChildren()))
+				if(Boolean.TRUE.equals(con.getProp(Container.PROP_AUTO_HIDDEN)) && CollUtil.isEmpty(con.getChildren())) {
 					con.setHidden(true);
+				}
 			}
 		}
 	}
@@ -229,8 +246,9 @@ public class DiagramBuilder {
 		List<Anchor> anchors = equipmentNode.getLegend().getAnchors();
 		if(anchors != null) {
 			for(Anchor anchor : anchors) {
-				if(anchor.getAcceptRelations() != null)
+				if(anchor.getAcceptRelations() != null) {
 					anchor.getAcceptRelations().forEach(rel -> refRelTypes.add(rel));
+				}
 			}
 		}
 	}
@@ -244,8 +262,9 @@ public class DiagramBuilder {
 		List<Legend> legends = legendsCache.get(classCode);
 		if (legends == null) {
 			legends = dataStrategy.getLegendsForEquipment(classCode);
-			if (legends == null)
+			if (legends == null) {
 				legends = new ArrayList<>();
+			}
 			legendsCache.put(classCode, legends);
 		}
 		if(legends.size() > 0) {
@@ -255,25 +274,31 @@ public class DiagramBuilder {
 				boolean typeMatch = CollUtil.isNotEmpty(legend.getDiagramTypes()) && legend.getDiagramTypes().contains(diagram.getType());
 				//过滤条件匹配
 				boolean filterMatch;
-				if(obj != null && legend.getDataFilter() != null)
+				if(obj != null && legend.getDataFilter() != null) {
 					filterMatch = legend.getDataFilter().filter(obj);
-				else
+				} else {
 					filterMatch = true;
+				}
 
-				if(typeMatch && filterMatch)
+				if(typeMatch && filterMatch) {
 					return legend;
+				}
 
-				if(typeMatch && l0 == null)
+				if(typeMatch && l0 == null) {
 					l0 = legend;
-				if(filterMatch && l1 == null)
+				}
+				if(filterMatch && l1 == null) {
 					l1 = legend;
+				}
 			}
-			if(l0 != null)
+			if(l0 != null) {
 				return l0;
-			if(l1 != null)
+			}
+			if(l1 != null) {
 				return l1;
-
-			return legends.get(0); //没有优先匹配的话取第一个
+			}
+			//没有优先匹配的话取第一个
+			return legends.get(0);
 		}
 
 		//返回一个缺省图例
@@ -312,10 +337,11 @@ public class DiagramBuilder {
 		for(Object o : equipMap.values()) {
 			if(o instanceof EquipmentNode){
 				String txt = ((EquipmentNode) o).getLabel().getContent();
-				if("1#进线柜".equals(txt))
+				if("1#进线柜".equals(txt)) {
 					n1 = (EquipmentNode) o;
-				else if("1#计量柜".equals(txt))
+				} else if("1#计量柜".equals(txt)) {
 					n2 = (EquipmentNode) o;
+				}
 			}
 		}
 		if(n1 != null && n2 != null) {
@@ -338,10 +364,11 @@ public class DiagramBuilder {
 
 	private ConnectPoint getConnectPoint(Object obj, String  relType, Object theOtherEnd){
 		ObjectNode theOtherData = null;
-		if(theOtherEnd instanceof EquipmentNode)
+		if(theOtherEnd instanceof EquipmentNode) {
 			theOtherData = (ObjectNode) ((EquipmentNode) theOtherEnd).getDataObject();
-		else if(theOtherEnd instanceof MainPipe)
+		} else if(theOtherEnd instanceof MainPipe) {
 			theOtherData = (ObjectNode) ((MainPipe) theOtherEnd).getDataObject();
+		}
 		String theOtherType = getClassCode(theOtherData);
 
 		if(obj instanceof EquipmentNode) {
@@ -349,40 +376,50 @@ public class DiagramBuilder {
 			Anchor anchor = null;
 			List<Anchor> anchors = en.getLegend().getAnchors();
 			if(CollUtil.isNotEmpty(anchors)) {
-				Anchor anchor1 = null; //部分匹配
+				//部分匹配
+				Anchor anchor1 = null;
 				for (Anchor a : anchors) {
-					Boolean relMatch = null; //关系匹配
-					Boolean equipMatch = null; //另一端设备匹配
+					//关系匹配
+					Boolean relMatch = null;
+					//另一端设备匹配
+					Boolean equipMatch = null;
 
-					if(CollUtil.isNotEmpty(a.getAcceptRelations()))
+					if(CollUtil.isNotEmpty(a.getAcceptRelations())) {
 						relMatch = a.getAcceptRelations().contains(relType);
+					}
 
 					if(!Boolean.FALSE.equals(relMatch)) {
-						if(CollUtil.isNotEmpty(a.getToEquipmentTypes()))
+						if(CollUtil.isNotEmpty(a.getToEquipmentTypes())) {
 							equipMatch = a.getToEquipmentTypes().contains(theOtherType);
-						if(!Boolean.FALSE.equals(equipMatch) && a.getToDataFilter() != null)
+						}
+						if(!Boolean.FALSE.equals(equipMatch) && a.getToDataFilter() != null) {
 							equipMatch = a.getToDataFilter().filter(theOtherData);
+						}
 					}
 
 					if(!Boolean.FALSE.equals(relMatch) && !Boolean.FALSE.equals(equipMatch)) {
 						if(relMatch == null || equipMatch == null) {
 							//部分匹配
-							if(anchor1 == null)
+							if(anchor1 == null) {
 								anchor1 = a;
-							else if(CollUtil.isNotEmpty(anchor1.getLines()) && CollUtil.isEmpty(a.getLines()))
+							} else if(CollUtil.isNotEmpty(anchor1.getLines()) && CollUtil.isEmpty(a.getLines())) {
 								anchor1 = a;
+							}
 						} else {
 							//完全匹配
-							if(CollUtil.isEmpty(a.getLines())) { //优先每个锚点只有一条连线
+							//优先每个锚点只有一条连线
+							if(CollUtil.isEmpty(a.getLines())) {
 								anchor = a;
 								break;
-							} else if(anchor == null)
+							} else if(anchor == null) {
 								anchor = a;
+							}
 						}
 					}
 				}
-				if(anchor == null && anchor1 != null)
+				if(anchor == null && anchor1 != null) {
 					anchor = anchor1;
+				}
 			}
 
 			if(anchor != null) {
@@ -438,16 +475,19 @@ public class DiagramBuilder {
 
 	public static String getName(ObjectNode obj){
 		String name = null;
-		if(obj.get("localName") != null)
+		if(obj.get("localName") != null) {
 			name = obj.get("localName").asText();
-		if(StrUtil.isBlank(name))
+		}
+		if(StrUtil.isBlank(name)) {
 			name = obj.get("name").asText();
+		}
 		return name;
 	}
 
 	public static String getClassCode(ObjectNode obj){
-		if(obj != null && obj.get("classCode") != null)
+		if(obj != null && obj.get("classCode") != null) {
 			return obj.get("classCode").asText();
+		}
 		return null;
 	}
 

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

@@ -14,131 +14,148 @@ import java.util.stream.Collectors;
 
 /**
  * 系统图数据加载
+ *
  * @author zhaoyk
  */
 public class DiagramDataLoader {
 
-	private Diagram diagram;
-
-	private DataStrategy dataStrategy;
-
-	private List<ObjectNode> rels;
-
-	private List<ObjectNode> optionalObjs;
-
-	private List<ObjectNode> optionalRels;
-
-	public DiagramDataLoader(Diagram diagram, DataStrategy dataStrategy) {
-		this.diagram = diagram;
-		this.dataStrategy = dataStrategy;
-	}
-
-	/**
-	 * 加载已经保存的数据
-	 */
-	public void initLoad(){
-		List<String> objIds = diagram.getObjIds();
-		if(objIds.size() > 0) {
-			List<ObjectNode> objs = dataStrategy.loadObjectsById(objIds, diagram.getProjectId(), diagram.getGroupCode());
-			if(CollUtil.isNotEmpty(objs))
-				initNodes(objs);
-		}
-
-		List<String> relIds = diagram.getRelIds();
-		if(relIds.size() > 0) {
-			List<ObjectNode> rels = dataStrategy.loadRelationsById(relIds, diagram.getProjectId(), diagram.getGroupCode());
-			if(CollUtil.isNotEmpty(rels))
-				initLines(rels);
-		}
-	}
-
-	private void initNodes(List<ObjectNode> objs) {
-		HashMap<String, ObjectNode> objMap = new HashMap<>();
-		objs.forEach(obj -> objMap.put(obj.get("id").asText(), obj));
-
-		for (DiagramNode node : diagram.getNodes()) {
-			ObjectNode obj = null;
-
-			if(EquipmentNode.TYPE.equals(node.getCompType())) { //设备节点
-				EquipmentNode en = (EquipmentNode) node;
-				obj = objMap.get(en.getObjId());
-
-				if(en.getLegendId() != null)
-					en.setLegend(dataStrategy.getLegend(en.getLegendId(), en.getObjSystemCode()));
-				else
-					en.setLegend(DiagramBuilder.emptyLegend());
-			}
-
-			if(obj != null)
-				node.setDataObject(obj);
-		}
-
-		//设备类干管
-		if(diagram.getTemplate().getMainPipes() != null) {
-			for(MainPipe mainPipe : diagram.getTemplate().getMainPipes()) {
-				if(mainPipe.isBindEquipment()){
-					ObjectNode obj = objMap.get(mainPipe.getDataObjectId());
-					if(obj != null)
-						mainPipe.setDataObject(obj);
-				}
-			}
-		}
-	}
-
-	private void initLines(List<ObjectNode> rels){
-		HashMap<String, ObjectNode> relMap = new HashMap<>();
-		rels.forEach(obj -> relMap.put(obj.get("id").asText(), obj));
-
-		for(Line line : diagram.getLines()) {
-			if(line.getDataObjectId() != null){
-				ObjectNode rel = relMap.get(line.getDataObjectId());
-				if(rel != null)
+    private Diagram diagram;
+
+    private DataStrategy dataStrategy;
+
+    private List<ObjectNode> rels;
+
+    private List<ObjectNode> optionalObjs;
+
+    private List<ObjectNode> optionalRels;
+
+    public DiagramDataLoader(Diagram diagram, DataStrategy dataStrategy) {
+        this.diagram = diagram;
+        this.dataStrategy = dataStrategy;
+    }
+
+    /**
+     * 加载已经保存的数据
+     */
+    public void initLoad() {
+        List<String> objIds = diagram.getObjIds();
+        if (objIds.size() > 0) {
+            List<ObjectNode> objs = dataStrategy.loadObjectsById(objIds, diagram.getProjectId(), diagram.getGroupCode());
+            if (CollUtil.isNotEmpty(objs)) {
+                initNodes(objs);
+            } else {
+                throw new DiagramException("对象数据加载失败");
+            }
+        }
+
+        List<String> relIds = diagram.getRelIds();
+        if (relIds.size() > 0) {
+            List<ObjectNode> rels = dataStrategy.loadRelationsById(relIds, diagram.getProjectId(), diagram.getGroupCode());
+            if (CollUtil.isNotEmpty(rels)) {
+                initLines(rels);
+            } else {
+                throw new DiagramException("关系数据加载失败");
+            }
+        }
+    }
+
+    private void initNodes(List<ObjectNode> objs) {
+        HashMap<String, ObjectNode> objMap = new HashMap<>();
+        objs.forEach(obj -> objMap.put(obj.get("id").asText(), obj));
+
+        for (DiagramNode node : diagram.getNodes()) {
+            ObjectNode obj = null;
+            //设备节点
+            if (EquipmentNode.TYPE.equals(node.getCompType())) {
+                EquipmentNode en = (EquipmentNode) node;
+                obj = objMap.get(en.getObjId());
+
+                if (en.getLegendId() != null) {
+                    en.setLegend(dataStrategy.getLegend(en.getLegendId(), en.getObjSystemCode()));
+                } else {
+                    en.setLegend(DiagramBuilder.emptyLegend());
+                }
+            }
+
+            if (obj != null) {
+                node.setDataObject(obj);
+            }
+        }
+
+        //设备类干管
+        if (diagram.getTemplate().getMainPipes() != null) {
+            for (MainPipe mainPipe : diagram.getTemplate().getMainPipes()) {
+                if (mainPipe.isBindEquipment()) {
+                    ObjectNode obj = objMap.get(mainPipe.getDataObjectId());
+                    if (obj != null) {
+                        mainPipe.setDataObject(obj);
+                    }
+                }
+            }
+        }
+    }
+
+    private void initLines(List<ObjectNode> rels) {
+        HashMap<String, ObjectNode> relMap = new HashMap<>();
+        rels.forEach(obj -> relMap.put(obj.get("id").asText(), obj));
+
+        for (Line line : diagram.getLines()) {
+            if (line.getDataObjectId() != null) {
+                ObjectNode rel = relMap.get(line.getDataObjectId());
+                if (rel != null) {
 					line.setDataObject(rel);
-			}
-		}
-	}
-
-	/**
-	 * 搜索数据并自动加载
-	 */
-	public void autoLoad(DiagramBuilder builder) {
-		//查询备选数据
-		HashSet<String> equipTypes = new HashSet<>();
-		List<Container> containers = diagram.getTemplate().getContainers();
-		for(Container con : containers) {
-			if(con.getEquipmentTypes() != null)
-				equipTypes.addAll(con.getEquipmentTypes());
-		}
-		if(diagram.getTemplate().getMainPipes() != null) {
-			for(MainPipe mainPipe : diagram.getTemplate().getMainPipes()) {
-				if(mainPipe.getEquipmentTypes() != null) //TODO 过滤已经初始化加载数据的干管
-					equipTypes.addAll(mainPipe.getEquipmentTypes());
-			}
-		}
-
-		//TODO 打包设备查询性能优化
-		if(equipTypes.size() > 0)
+				}
+            }
+        }
+    }
+
+    /**
+     * 搜索数据并自动加载
+     */
+    public void autoLoad(DiagramBuilder builder) {
+        //查询备选数据
+        HashSet<String> equipTypes = new HashSet<>();
+        List<Container> containers = diagram.getTemplate().getContainers();
+        for (Container con : containers) {
+            if (con.getEquipmentTypes() != null) {
+                equipTypes.addAll(con.getEquipmentTypes());
+            }
+        }
+        if (diagram.getTemplate().getMainPipes() != null) {
+            for (MainPipe mainPipe : diagram.getTemplate().getMainPipes()) {
+                //TODO 过滤已经初始化加载数据的干管
+                if (mainPipe.getEquipmentTypes() != null) {
+                    equipTypes.addAll(mainPipe.getEquipmentTypes());
+                }
+            }
+        }
+
+        //TODO 打包设备查询性能优化
+        if (equipTypes.size() > 0) {
 			optionalObjs = dataStrategy.loadObjectsByType(new ArrayList<>(equipTypes), diagram.getProjectId(), diagram.getSystemId(), diagram.getGroupCode());
-		else
+		} else {
 			optionalObjs = new ArrayList<>();
-		//记录备选对象id列表
-		List<String> objIds = optionalObjs.stream().map(obj -> obj.get("id").asText()).collect(Collectors.toList());
+		}
+        //记录备选对象id列表
+        List<String> objIds = optionalObjs.stream().map(obj -> obj.get("id").asText()).collect(Collectors.toList());
 
-		//去掉已经使用的数据项
-		HashMap<String, Object> equipMap = builder.getEquipMap();
-		if(equipMap.size() > 0)
+        //去掉已经使用的数据项
+        HashMap<String, Object> equipMap = builder.getEquipMap();
+        if (equipMap.size() > 0) {
 			optionalObjs = optionalObjs.stream().filter(obj -> !equipMap.containsKey(obj.get("id").asText())).collect(Collectors.toList());
+		}
 
-		builder.buildEquipNodeAndContainer(containers, optionalObjs);
-		List<String[]> relTypes = builder.getRefRelTypes().stream().map(type -> type.split("/")).collect(Collectors.toList());
+        builder.buildEquipNodeAndContainer(containers, optionalObjs);
+        List<String[]> relTypes = builder.getRefRelTypes().stream().map(type -> type.split("/")).collect(Collectors.toList());
 
-		//TODO 关系查询,需要区分打包设备
-		if(objIds.size() > 0 && relTypes.size() > 0)
+        //TODO 关系查询,需要区分打包设备
+        if (objIds.size() > 0 && relTypes.size() > 0) {
 			optionalRels = dataStrategy.loadRelationsByType(relTypes, objIds, diagram.getProjectId(), diagram.getGroupCode());
-		else
+		} else {
 			optionalRels = new ArrayList<>();
+		}
 
-		builder.buildLines(optionalRels);
-	}
+        builder.buildLines(optionalRels);
+    }
 
 }

+ 16 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/DiagramException.java

@@ -0,0 +1,16 @@
+package com.persagy.adm.diagram.core;
+
+/**
+ * 系统图运行时异常
+ */
+public class DiagramException extends RuntimeException {
+
+	public DiagramException(String message) {
+		super(message);
+	}
+
+	public DiagramException(String message, Exception cause) {
+		super(message, cause);
+	}
+
+}

+ 13 - 5
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/line/LineLayoutManager.java

@@ -13,6 +13,8 @@ import java.util.List;
 
 /**
  * 连线布局计算
+ * @author zhaoyk
+ * @date 2022-01-12
  */
 public class LineLayoutManager {
 
@@ -27,8 +29,9 @@ public class LineLayoutManager {
 
 	private void initBlocks(){
 		for(Object o : diagramBuilder.getEquipMap().values()){
-			if (o instanceof DiagramNode)
+			if (o instanceof DiagramNode) {
 				blocks.add(new Block((DiagramNode)o));
+			}
 		}
 	}
 
@@ -37,9 +40,11 @@ public class LineLayoutManager {
 		ConnectPoint p2 = line.getTo();
 
 		boolean exchange = false;
-		if(p1.getEquipmentNode() == null) { //先计算点模型的终点
-			if(p2.getEquipmentNode() == null)
+		//先计算点模型的终点
+		if(p1.getEquipmentNode() == null) {
+			if(p2.getEquipmentNode() == null) {
 				throw new RuntimeException("do not support 2 main pipe connect");
+			}
 
 			ConnectPoint tmp = p2;
 			p2 = p1;
@@ -90,15 +95,17 @@ public class LineLayoutManager {
 	 * 就算点和线段的最短距离
 	 */
 	private double distance(XY[] line, XY xy){
-		return 0; //TODO
+		//TODO
+		return 0;
 	}
 
 	/**
 	 * 锚点出线
 	 */
 	private XY anchorEmerge(ConnectPoint point){
-		if(point.getLocation() == null)
+		if(point.getLocation() == null) {
 			point.layout();
+		}
 
 		XY xy = new XY(point.getLocation());
 		switch (point.getAnchorCode().charAt(0)) {
@@ -114,6 +121,7 @@ public class LineLayoutManager {
 			case 'R':
 				xy.x += LineEnd.offset;
 				break;
+			default:
 		}
 		return xy;
 	}

+ 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;
 	}
 

+ 25 - 8
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/model/Diagram.java

@@ -8,6 +8,7 @@ import com.persagy.adm.diagram.core.model.base.Container;
 import com.persagy.adm.diagram.core.model.base.XY;
 import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
 import com.persagy.adm.diagram.core.model.template.MainPipe;
+import com.persagy.dmp.common.lang.PsDateTime;
 
 import java.util.*;
 
@@ -86,13 +87,15 @@ public class Diagram {
 	@Expose
 	private List<Line> lines = new ArrayList();
 
+	private PsDateTime createTime;
 	//运行时
 	private DiagramTemplate template;
 
 
 	public void init(){
-		if (template != null)
+		if (template != null) {
 			template.init();
+		}
 
 		nodes.sort(new Comparator<DiagramNode>() {
 			@Override
@@ -102,8 +105,9 @@ public class Diagram {
 		});
 		for (DiagramNode node : nodes) {
 			Container con = template.getContainerById(node.getContainerId());
-			if (con != null)
+			if (con != null) {
 				con.addComp(node);
+			}
 		}
 	}
 
@@ -143,13 +147,15 @@ public class Diagram {
 	public List<String> getObjIds(){
 		List<String> ids = new ArrayList<>();
 		for(DiagramNode node : nodes) {
-			if(EquipmentNode.TYPE.equals(node.getCompType()))
+			if(EquipmentNode.TYPE.equals(node.getCompType())) {
 				ids.add(((EquipmentNode) node).getObjId());
+			}
 		}
 		if(template.getMainPipes() != null) {
 			for(MainPipe mainPipe : template.getMainPipes()) {
-				if(mainPipe.isBindEquipment() && StrUtil.isNotBlank(mainPipe.getDataObjectId()))
+				if(mainPipe.isBindEquipment() && StrUtil.isNotBlank(mainPipe.getDataObjectId())) {
 					ids.add(mainPipe.getDataObjectId());
+				}
 			}
 		}
 		return ids;
@@ -158,8 +164,9 @@ public class Diagram {
 	public List<String> getRelIds(){
 		List<String> ids = new ArrayList<>();
 		for(Line line : lines) {
-			if(StrUtil.isNotBlank(line.getDataObjectId()))
+			if(StrUtil.isNotBlank(line.getDataObjectId())) {
 				ids.add(line.getDataObjectId());
+			}
 		}
 		return ids;
 	}
@@ -257,13 +264,23 @@ public class Diagram {
 	}
 
 	public void setExtraProp(String propName, Object propValue) {
-		if(extraProps == null)
+		if(extraProps == null) {
 			extraProps = new HashMap<>();
+		}
 
-		if(propValue != null)
+		if(propValue != null) {
 			extraProps.put(propName, propValue);
-		else
+		} else {
 			extraProps.remove(propName);
+		}
+	}
+
+	public PsDateTime getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(PsDateTime createTime) {
+		this.createTime = createTime;
 	}
 
 	public DiagramTemplate getTemplate() {

+ 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 - 5
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/util/GeomUtil.java

@@ -67,15 +67,17 @@ public class GeomUtil {
 	}
 
 	public static boolean checkPolygon(ArrayList<ArrayList<ArrayList<CaseInsensitiveMap>>> outline){
-		if(CollUtil.isEmpty(outline))
+		if(CollUtil.isEmpty(outline)) {
 			return false;
+		}
 
 		try {
 			Polygon[] ps = new Polygon[outline.size()];
 			for (int i = 0; i < ps.length; i++) {
 				List space = (List) outline.get(i);
-				if(CollUtil.isEmpty(space))
+				if(CollUtil.isEmpty(space)) {
 					return false;
+				}
 
 				List<Map> shellList = (List) space.get(0);
 				LinearRing shell = geometryFactory.createLinearRing(buildCoords(shellList));
@@ -104,15 +106,17 @@ public class GeomUtil {
 	}
 
 	public static boolean checkPolygon(ArrayNode outline){
-		if(outline == null || outline.size() == 0)
+		if(outline == null || outline.size() == 0) {
 			return false;
+		}
 
 		try {
 			Polygon[] ps = new Polygon[outline.size()];
 			for (int i = 0; i < ps.length; i++) {
 				ArrayNode space = (ArrayNode) outline.get(i);
-				if(space == null || space.size() == 0)
+				if(space == null || space.size() == 0) {
 					return false;
+				}
 
 				ArrayNode shellList = (ArrayNode) space.get(0);
 				LinearRing shell = geometryFactory.createLinearRing(buildCoords(shellList));
@@ -141,7 +145,8 @@ public class GeomUtil {
 		WKTReader reader = new WKTReader( geometryFactory );
 		LineString geometry1 = (LineString) reader.read("LINESTRING(0 0, 2 0, 5 0)");
 		LineString geometry2 = (LineString) reader.read("LINESTRING(5 0, 0 0)");
-		return geometry1.equals(geometry2);//true
+		//true
+		return geometry1.equals(geometry2);
 	}
 
 	/**

+ 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);

+ 365 - 346
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/demo/DemoDataStrategy.java

@@ -23,372 +23,391 @@ import java.util.List;
 
 /**
  * 测试开发使用的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())
+    @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))
+        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))
+			}
+        }
+        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;
-	}
+        return rtn;
+    }
 
 
-	/* 系统图部分 */
-	private static final String DIR_DIAGRAM = "store/diagram/";
+    /** 系统图部分 */
+    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 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<>();
+    @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()))
+        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()))
+					}
+                    if (StrUtil.isNotBlank(diagramType) && !diagramType.equals(diagram.getType())) {
 						continue;
-					if(StrUtil.isNotBlank(systemId) && !systemId.equals(diagram.getSystemId()))
+					}
+                    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())
+                    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;
-	}
+		}
+        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;
+    }
 }

+ 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;

+ 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("',");
             }

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

@@ -233,14 +233,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 {

+ 3 - 3
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/aop/ExceptionAspect.java

@@ -1,6 +1,6 @@
-package com.persagy.bdtp.adm.aop;
+package com.persagy.adm.server.custom.aop;
 
-import com.persagy.bdtp.adm.service.CallException;
+import com.persagy.adm.server.custom.service.CallException;
 import lombok.extern.slf4j.Slf4j;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class ExceptionAspect {
 
-    @Pointcut("execution(public * com.persagy.bdtp.adm.controller.AppController.*(..))")
+    @Pointcut("execution(public * com.persagy.adm.server.custom.controller.AppController.*(..))")
     public void handle(){
 
     }

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/DicClient.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.client;
+package com.persagy.adm.server.custom.client;
 
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import com.persagy.dmp.basic.model.QueryCriteria;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/ImageServiceClient.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.client;
+package com.persagy.adm.server.custom.client;
 
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import feign.Response;

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/OldAdmClient.java

@@ -1,6 +1,6 @@
-package com.persagy.bdtp.adm.client;
+package com.persagy.adm.server.custom.client;
 
-import com.persagy.bdtp.adm.entity.oldadm.*;
+import com.persagy.adm.server.custom.entity.oldadm.*;
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import feign.Response;
 import org.springframework.cloud.openfeign.FeignClient;

+ 3 - 3
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/client/RwdClient.java

@@ -1,8 +1,8 @@
-package com.persagy.bdtp.adm.client;
+package com.persagy.adm.server.custom.client;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.bdtp.adm.entity.InfoDef;
-import com.persagy.bdtp.adm.entity.TypeDef;
+import com.persagy.adm.server.custom.entity.InfoDef;
+import com.persagy.adm.server.custom.entity.TypeDef;
 import com.persagy.dmp.basic.config.DigitalFeignConfig;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmConst.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.common;
+package com.persagy.adm.server.custom.common;
 
 public interface AdmConst {
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmMessageConst.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.common;
+package com.persagy.adm.server.custom.common;
 
 public interface AdmMessageConst {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmRequest.java

@@ -1,6 +1,6 @@
-package com.persagy.bdtp.adm.common;
+package com.persagy.adm.server.custom.common;
 
-import com.persagy.bdtp.adm.entity.UploadData;
+import com.persagy.adm.server.custom.entity.UploadData;
 import lombok.Data;
 
 @Data

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/common/AdmResult.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.common;
+package com.persagy.adm.server.custom.common;
 
 import com.persagy.dmp.common.constant.ResponseCode;
 import com.persagy.dmp.common.model.response.CommonResult;

+ 1 - 5
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/AdmCommonConfig.java

@@ -1,9 +1,5 @@
-package com.persagy.bdtp.adm.config;
+package com.persagy.adm.server.custom.config;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/AdmRabbitConfig.java

@@ -1,6 +1,6 @@
-package com.persagy.bdtp.adm.config;
+package com.persagy.adm.server.custom.config;
 
-import com.persagy.bdtp.adm.common.AdmMessageConst;
+import com.persagy.adm.server.custom.common.AdmMessageConst;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.core.Binding;
 import org.springframework.amqp.core.BindingBuilder;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/config/TestConfig.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.config;
+package com.persagy.adm.server.custom.config;
 
 import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

+ 6 - 6
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/AdmFileController.java

@@ -1,13 +1,13 @@
-package com.persagy.bdtp.adm.controller;
+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.bdtp.adm.common.AdmResult;
-import com.persagy.bdtp.adm.dao.AdmFileMapper;
-import com.persagy.bdtp.adm.entity.AdmCad;
-import com.persagy.bdtp.adm.entity.CadFileQueryParam;
-import com.persagy.bdtp.adm.service.IAdmCadService;
+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.service.IAdmCadService;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;

+ 11 - 11
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/AppController.java

@@ -1,16 +1,16 @@
-package com.persagy.bdtp.adm.controller;
+package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.StrUtil;
-import com.persagy.bdtp.adm.client.ImageServiceClient;
-import com.persagy.bdtp.adm.client.OldAdmClient;
-import com.persagy.bdtp.adm.common.AdmRequest;
-import com.persagy.bdtp.adm.common.AdmResult;
-import com.persagy.bdtp.adm.datatx.DataTxHandler;
-import com.persagy.bdtp.adm.entity.Dict;
-import com.persagy.bdtp.adm.entity.DownLoadData;
-import com.persagy.bdtp.adm.entity.UploadRtn;
-import com.persagy.bdtp.adm.service.ISyncApp;
-import com.persagy.bdtp.adm.service.ServiceUtil;
+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.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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;

+ 5 - 5
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/ManageController.java

@@ -1,9 +1,9 @@
-package com.persagy.bdtp.adm.controller;
+package com.persagy.adm.server.custom.controller;
 
-import com.persagy.bdtp.adm.common.AdmRequest;
-import com.persagy.bdtp.adm.common.AdmResult;
-import com.persagy.bdtp.adm.service.ISyncOldAdm;
-import com.persagy.bdtp.adm.service.ISyncSpace;
+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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestBody;

+ 13 - 11
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/controller/ToolController.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.controller;
+package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
@@ -8,16 +8,18 @@ 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.bdtp.adm.client.RwdClient;
-import com.persagy.bdtp.adm.common.AdmConst;
-import com.persagy.bdtp.adm.common.AdmRequest;
-import com.persagy.bdtp.adm.common.AdmResult;
-import com.persagy.bdtp.adm.dao.*;
-import com.persagy.bdtp.adm.entity.*;
-import com.persagy.bdtp.adm.entity.db.*;
-import com.persagy.bdtp.adm.service.IConfigService;
-import com.persagy.bdtp.adm.service.ISyncApp;
-import com.persagy.bdtp.adm.service.ServiceUtil;
+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;
+import com.persagy.adm.server.custom.entity.TypeDef;
+import com.persagy.adm.server.custom.entity.db.*;
+import com.persagy.adm.server.custom.service.IConfigService;
+import com.persagy.adm.server.custom.service.ISyncApp;
+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;

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmCadMapper.java

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

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmClientFlagMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmClientFlag;
+import com.persagy.adm.server.custom.entity.db.AdmClientFlag;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmComponentMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmComponent;
+import com.persagy.adm.server.custom.entity.db.AdmComponent;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmConfigMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmConfig;
+import com.persagy.adm.server.custom.entity.db.AdmConfig;
 
 public interface AdmConfigMapper extends BaseMapper<AdmConfig> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmContainerConfigMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmContainerConfig;
+import com.persagy.adm.server.custom.entity.db.AdmContainerConfig;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

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

@@ -0,0 +1,16 @@
+package com.persagy.adm.server.custom.dao;
+
+import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 核查问题信息点定义表 Mapper 接口
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+public interface AdmDefineProblemInfoMapper extends BaseMapper<AdmDefineProblemInfo> {
+
+}

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmDefineProblemTypeMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmDefineProblemType;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemType;
 
 public interface AdmDefineProblemTypeMapper extends BaseMapper<AdmDefineProblemType> {
 }

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmFileMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmFile;
+import com.persagy.adm.server.custom.entity.db.AdmFile;
 
 /**
  * <p>

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmInfosConfigMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmInfosConfig;
+import com.persagy.adm.server.custom.entity.db.AdmInfosConfig;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmJobSpaceMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmJobSpace;
+import com.persagy.adm.server.custom.entity.db.AdmJobSpace;
 
 public interface AdmJobSpaceMapper extends BaseMapper<AdmJobSpace> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmM2dEquipMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmM2dEquip;
+import com.persagy.adm.server.custom.entity.db.AdmM2dEquip;
 
 public interface AdmM2dEquipMapper extends BaseMapper<AdmM2dEquip> {
 

+ 2 - 3
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmMessagePMapper.java

@@ -1,8 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmJobSpace;
-import com.persagy.bdtp.adm.entity.db.AdmMessageP;
+import com.persagy.adm.server.custom.entity.db.AdmMessageP;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmObjectMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmObject;
+import com.persagy.adm.server.custom.entity.db.AdmObject;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmPipeConfigMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmPipeConfig;
+import com.persagy.adm.server.custom.entity.db.AdmPipeConfig;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmPipeMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmPipe;
+import com.persagy.adm.server.custom.entity.db.AdmPipe;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemArchMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmProblemArch;
+import com.persagy.adm.server.custom.entity.db.AdmProblemArch;
 
 public interface AdmProblemArchMapper extends BaseMapper<AdmProblemArch> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemEquipMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmProblemEquip;
+import com.persagy.adm.server.custom.entity.db.AdmProblemEquip;
 
 public interface AdmProblemEquipMapper extends BaseMapper<AdmProblemEquip> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmProblemMapper.java

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

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmQrCodeMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmQrCode;
+import com.persagy.adm.server.custom.entity.db.AdmQrCode;
 
 public interface AdmQrCodeMapper extends BaseMapper<AdmQrCode> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmRelationMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmRelation;
+import com.persagy.adm.server.custom.entity.db.AdmRelation;
 
 public interface AdmRelationMapper extends BaseMapper<AdmRelation> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmRelsConfigMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmRelsConfig;
+import com.persagy.adm.server.custom.entity.db.AdmRelsConfig;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmServeAreaMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmServeArea;
+import com.persagy.adm.server.custom.entity.db.AdmServeArea;
 
 public interface AdmServeAreaMapper extends BaseMapper<AdmServeArea> {
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmUploadJobMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmUploadJob;
+import com.persagy.adm.server.custom.entity.db.AdmUploadJob;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/dao/AdmUploadLogMapper.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.dao;
+package com.persagy.adm.server.custom.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.persagy.bdtp.adm.entity.db.AdmUploadLog;
+import com.persagy.adm.server.custom.entity.db.AdmUploadLog;
 import org.apache.ibatis.annotations.Mapper;
 
 @Mapper

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/DataTxHandler.java

@@ -1,7 +1,7 @@
-package com.persagy.bdtp.adm.datatx;
+package com.persagy.adm.server.custom.datatx;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.persagy.bdtp.adm.common.AdmRequest;
+import com.persagy.adm.server.custom.common.AdmRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/ObjectForTx.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.datatx;
+package com.persagy.adm.server.custom.datatx;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/datatx/ObjectMapper4Tx.java

@@ -1,10 +1,10 @@
-package com.persagy.bdtp.adm.datatx;
+package com.persagy.adm.server.custom.datatx;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.persagy.bdtp.adm.entity.db.AdmObject;
+import com.persagy.adm.server.custom.entity.db.AdmObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 

+ 2 - 3
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/AdmCad.java

@@ -1,10 +1,9 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
-import java.time.LocalDateTime;
 
-import com.persagy.bdtp.adm.entity.db.BaseAdmDataEntity;
+import com.persagy.adm.server.custom.entity.db.BaseAdmDataEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 

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

@@ -0,0 +1,101 @@
+package com.persagy.adm.server.custom.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 核查问题信息点定义表
+ * </p>
+ *
+ * @author yanguofeng
+ * @since 2022-01-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class AdmDefineProblemInfo implements Serializable {
+
+
+    private String id;
+
+    /**
+     * 信息点编码,同类型下唯一,标准驼峰格式
+     */
+    private String code;
+
+    /**
+     * 信息点名称
+     */
+    private String name;
+
+    /**
+     * 问题类型编码
+     */
+    @TableField("problem_type_code")
+    private String problemTypeCode;
+
+    /**
+     * 单位
+     */
+    private String unit;
+
+    /**
+     * 数据类型
+     */
+    @TableField("data_type")
+    private String dataType;
+
+    /**
+     * 是否复数
+     */
+    @TableField("is_multiple")
+    private Integer isMultiple;
+
+    /**
+     * 数据源取值范围/枚举值清单等,根据dataType有不同的内容
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    @TableField("creation_time")
+    private String creationTime;
+
+    /**
+     * 最后修改人
+     */
+    private String modifier;
+
+    /**
+     * 最后修改时间
+     */
+    @TableField("modified_time")
+    private String modifiedTime;
+
+    /**
+     * 合法标识
+     */
+    private Integer valid;
+
+    /**
+     * 乐观锁
+     */
+    private LocalDateTime ts;
+
+
+}

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

@@ -1,11 +1,9 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;
-import java.time.LocalDateTime;
 
-import com.persagy.bdtp.adm.entity.db.BaseAdmDataEntity;
-import com.persagy.bdtp.adm.entity.db.BaseAdmEntity;
+import com.persagy.adm.server.custom.entity.db.BaseAdmDataEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 

+ 2 - 6
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/BuildingData.java

@@ -1,10 +1,6 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
-import cn.hutool.core.collection.CollUtil;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.bdtp.adm.entity.db.*;
-import com.persagy.dmp.common.model.entity.BaseEntity;
-import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.adm.server.custom.entity.db.*;
 import lombok.Data;
 
 import java.util.List;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/CadFileInfo.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import lombok.Data;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/CadFileQueryParam.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import lombok.Data;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/D2mMessage.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.IdUtil;

+ 1 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/Dict.java

@@ -1,6 +1,5 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
-import com.persagy.dmp.define.entity.RelationDefine;
 import lombok.Data;
 
 import java.util.List;

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/DownLoadData.java

@@ -1,8 +1,8 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import cn.hutool.core.collection.CollUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.bdtp.adm.entity.db.BaseAdmDataEntity;
+import com.persagy.adm.server.custom.entity.db.BaseAdmDataEntity;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import lombok.Data;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/InfoDef.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import lombok.Data;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/Pagination.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import lombok.Data;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/ProjectData.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import lombok.Data;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/TypeDef.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import lombok.Data;

+ 2 - 2
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/UploadData.java

@@ -1,8 +1,8 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import cn.hutool.core.collection.CollUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.bdtp.adm.entity.db.*;
+import com.persagy.adm.server.custom.entity.db.*;
 import lombok.Data;
 
 import java.util.List;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/UploadRtn.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity;
+package com.persagy.adm.server.custom.entity;
 
 import lombok.Data;
 

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmClientFlag.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmComponent.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmConfig.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmContainerConfig.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmDefineProblemType.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.persagy.dmp.common.model.entity.AuditableEntity;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmFile.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmInfosConfig.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmJobSpace.java

@@ -1,4 +1,4 @@
-package com.persagy.bdtp.adm.entity.db;
+package com.persagy.adm.server.custom.entity.db;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.TableField;

+ 0 - 0
adm-business/adm-server/src/main/java/com/persagy/bdtp/adm/entity/db/AdmM2dEquip.java


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است