Browse Source

优化关系对象查询

zhangqiankun 3 years ago
parent
commit
8b2a5c8f0f
35 changed files with 938 additions and 831 deletions
  1. 17 0
      src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java
  2. 16 0
      src/main/java/com/persagy/proxy/adm/strategy/QueryRelationObjectContext.java
  3. 48 42
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java
  4. 39 53
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdForRelationObject.java
  5. 34 47
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdRelationObject.java
  6. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java
  7. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java
  8. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java
  9. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java
  10. 39 53
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlForRelationObject.java
  11. 29 42
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlRelationObject.java
  12. 39 53
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2ShForRelationObject.java
  13. 26 38
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java
  14. 9 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/QueryRelationObjectStrategy.java
  15. 26 39
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2BdForRelationObject.java
  16. 32 43
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2FlForRelationObject.java
  17. 27 40
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2ShForRelationObject.java
  18. 39 53
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2SpForRelationObject.java
  19. 38 52
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2BdForRelationObject.java
  20. 40 53
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2FlForRelationObject.java
  21. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java
  22. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java
  23. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java
  24. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java
  25. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java
  26. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java
  27. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java
  28. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java
  29. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java
  30. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java
  31. 21 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java
  32. 27 40
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2BdForRelationObject.java
  33. 32 44
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2FlForRelationObject.java
  34. 27 40
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2ShForRelationObject.java
  35. 39 54
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2SpForRelationObject.java

+ 17 - 0
src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java

@@ -60,6 +60,23 @@ public class RelationReportController {
 	private QueryRelationObjectContext queryRelationObjectContext;
 	
 	/**
+	 * 查询总览数量-根据类型查询关系数量
+	 * 
+	 * @param type	relationType
+	 */
+	@RequestMapping("/graphic/type/query-count")
+	public AdmResponse countRelationObjects(@RequestParam String type, HttpServletRequest request) {
+		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		int count = this.queryRelationObjectContext.countRelationObjects(groupCode, projectId, type);
+		JSONObject result = new JSONObject();
+		result.put("count", count);
+		result.put("relationType", type);
+		return AdmResponse.success(Lists.newArrayList(result));
+	}
+	
+	
+	/**
 	 * 下载报告-设备静态信息维护模板
 	 * 
 	 * @param request

+ 16 - 0
src/main/java/com/persagy/proxy/adm/strategy/QueryRelationObjectContext.java

@@ -86,4 +86,20 @@ public class QueryRelationObjectContext {
 		return strategy.saveRelationObjects(relationObjects, groupCode, projectId);
 	}
 
+	/**
+	 * 统计关系总数
+	 * 
+	 * @param groupCode
+	 * @param projectId
+	 * @param relType ADM-传过来的边类型
+	 * @return 
+	 */
+	public int countRelationObjects(String groupCode, String projectId, String relType) {
+		QueryRelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+		if (strategy == null) {
+			return 0;
+		}
+		
+		return strategy.countRelationObjects(groupCode, projectId);
+	}
 }

+ 48 - 42
src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java

@@ -1,14 +1,13 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
@@ -41,67 +40,72 @@ public abstract class AbstractQueryRelationObject implements QueryRelationObject
 	 * @param extraMapping
 	 * @return
 	 */
-	protected List<AdmRelationObject> queryAllObjectInfo(QueryCriteria queryCriteria, String groupCode, String projectId) {
-		List<ObjectNode> tempList = new ArrayList<ObjectNode>();
+	protected List<AdmRelationObject> queryAllObjectInfo(RequestData requestData, String groupCode, String projectId) {
+		List<ObjectDigital> masterObjs = new ArrayList<ObjectDigital>();
 		
 		// 获取数据
-		this.queryPageObjectInfo(tempList, queryCriteria, groupCode, projectId, queryCriteria.getPage());
+		this.queryPageObjectInfo(masterObjs, requestData, groupCode, projectId, requestData.getPage());
 		
 		// 转换中台数据
-		return this.handleObjectDigital(tempList, groupCode, projectId);
+		return this.handleObjectDigital(masterObjs, groupCode, projectId);
 	}
 	
 	/**
 	 * 分页查询
 	 * 
-	 * @param tempList
-	 * @param queryCriteria
+	 * @param masterObjs
+	 * @param requestData
 	 * @param groupCode
 	 * @param projectId
 	 * @param page
-	 * @param pageSize
 	 */
-	protected void queryPageObjectInfo(List<ObjectNode> tempList, QueryCriteria queryCriteria, String groupCode, String projectId, Long page) {
-		queryCriteria.setPage(page);
-		List<ObjectNode> objectNodes = DigitalObjectFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
-		if (CollectionUtil.isEmpty(objectNodes)) {
+	private void queryPageObjectInfo(List<ObjectDigital> tempList, RequestData requestData, String groupCode, String projectId, Long page) {
+		requestData.setPage(page);
+		List<ObjectDigital> objectDigitals = DigitalObjectFacade.queryObjectListByGraphCodeAndRelCode(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, requestData);
+		if (CollectionUtil.isEmpty(objectDigitals)) {
 			return;
 		}
-		tempList.addAll(objectNodes);
-		this.queryPageObjectInfo(tempList, queryCriteria, groupCode, projectId, ++page);
+		tempList.addAll(objectDigitals);
+		this.queryPageObjectInfo(tempList, requestData, groupCode, projectId, ++page);
 	}
 	
 	/**
 	 * 处理中台响应数据,转换为ADM所需要的数据
 	 * 
-	 * @param tempList
+	 * @param masterObjs
 	 * @param groupCode
 	 * @param projectId
 	 * @return
 	 */
-	private List<AdmRelationObject> handleObjectDigital(List<ObjectNode> tempList, String groupCode, String projectId) {
-		// 第一次遍历
-		// id -> object
-		Map<String, ObjectNode> tempAllMap = new HashMap<String, ObjectNode>(tempList.size());
-		for (ObjectNode objectNode : tempList) {
-			String id = objectNode.get("id").asText();
-			tempAllMap.put(id, objectNode);
+	protected List<AdmRelationObject> handleObjectDigital(List<ObjectDigital> masterObjs, String groupCode, String projectId) {
+		List<AdmRelationObject> result = new ArrayList<AdmRelationObject>();
+		// 遍历所有主对象
+		for (ObjectDigital master : masterObjs) {
+			List<ObjectDigital> slaveObjs = master.getRelObjs();
+			if (CollectionUtil.isEmpty(slaveObjs)) {
+				continue;	// 从对象不存在的,不再返回主对象数据
+			}
+			
+			// 遍历所有的从对象
+			for (ObjectDigital slave : slaveObjs) {
+				result.add(this.handleObjectDigital(master, slave, groupCode, projectId));
+			}
 		}
 		
-		return this.handleObjectDigital(tempAllMap, groupCode, projectId);
+		return result;
 	}
 	
-	
 	/**
-	 * 处理中台响应数据,转换为ADM所需要的数据
+	 * 处理中台对象,返回前端所需要的
 	 * 
+	 * @param master
+	 * @param slave
 	 * @param groupCode
 	 * @param projectId
-	 * @param tempAllMap 对象ID -> 对象
-	 * @return 不允许返回null
+	 * @return
 	 */
-	protected abstract List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId);	
-	
+	protected abstract AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId);
+
 	/**
 	 * 封装响应数据,具体的传值,请仔细侦查,这里仅返回共有字段,特殊字段,自行赋值
 	 * 
@@ -111,36 +115,38 @@ public abstract class AbstractQueryRelationObject implements QueryRelationObject
 	 * @param slaveType
 	 * @return
 	 */
-	protected AdmRelationObject convertObject(ObjectNode master, String masterType, ObjectNode slave, String slaveType) {
+	protected AdmRelationObject convertObject(ObjectDigital master, String masterType, ObjectDigital slave, String slaveType) {
 		AdmRelationObject relationObject = new AdmRelationObject();
 		
 		// ID
-		String masterId = master.get("id") == null ? AdmCommonConstant.EMPTY  : master.get("id").asText();
+		String masterId = master.getId();
 		relationObject.setMasterCode(masterId);
 		relationObject.setMasterId(masterId);
 		// 图纸编码
-		relationObject.setMasterCadId(master.get("cADID") == null ? AdmCommonConstant.EMPTY  : master.get("cADID").asText());
+		ObjectNode masterInfos = master.getInfos();
+		relationObject.setMasterCadId(masterInfos.get("cADID") == null ? AdmCommonConstant.EMPTY  : masterInfos.get("cADID").asText());
 		// 名称
-		relationObject.setMasterName(master.get("name") == null ? AdmCommonConstant.EMPTY  : master.get("name").asText());
+		relationObject.setMasterName(master.getName());
 		// 本地ID
-		relationObject.setMasterLocalId(master.get("localId") == null ? AdmCommonConstant.EMPTY  : master.get("localId").asText());
+		relationObject.setMasterLocalId(master.getLocalId());
 		// 本地名称
-		relationObject.setMasterLocalName(master.get("localName") == null ? AdmCommonConstant.EMPTY  : master.get("localName").asText());
+		relationObject.setMasterLocalName(master.getLocalName());
 		// 类型
 		relationObject.setMasterType(masterType);
 		
 		// ID
-		String slaveId = slave.get("id") == null ? AdmCommonConstant.EMPTY  : slave.get("id").asText();
+		String slaveId = slave.getId();
 		relationObject.setSlaveCode(slaveId);
 		relationObject.setSlaveId(slaveId);
 		// 图纸编码
-		relationObject.setSlaveCadId(master.get("cADID") == null ? AdmCommonConstant.EMPTY  : master.get("cADID").asText());
+		ObjectNode slaveInfos = slave.getInfos();
+		relationObject.setSlaveCadId(slaveInfos.get("cADID") == null ? AdmCommonConstant.EMPTY  : slaveInfos.get("cADID").asText());
 		// 名称
-		relationObject.setSlaveName(slave.get("name") == null ? AdmCommonConstant.EMPTY  : slave.get("name").asText());
+		relationObject.setSlaveName(slave.getName());
 		// 本地ID
-		relationObject.setSlaveLocalId(slave.get("localId") == null ? AdmCommonConstant.EMPTY  : slave.get("localId").asText());
+		relationObject.setSlaveLocalId(slave.getLocalId());
 		// 本地名称
-		relationObject.setSlaveLocalName(slave.get("localName") == null ? AdmCommonConstant.EMPTY  : slave.get("localName").asText());
+		relationObject.setSlaveLocalName(slave.getLocalName());
 		// 类型
 		relationObject.setSlaveType(slaveType);
 		

+ 39 - 53
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -36,62 +33,51 @@ public class Eq2BdForRelationObject extends AbstractQueryRelationObject {
 	public Eq2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.BUILDING.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2BD_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2BD_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode(), 
+				RelCodeEnum.Eq2Fl.name(), master.getId(), null);
+		
+		AdmRelationObject convertObject = this.convertObject(master, "设备", slave, "建筑");
+		String buildingName = slave.getLocalName();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setMasterFloorName(floorName);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode(), AdmRelationTypeEnum.EQ2BD_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String buildingId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(buildingId)) {
-				continue;
-			}
-			ObjectNode equipment = tempAllMap.get(equipId);
-			ObjectNode building = tempAllMap.get(buildingId);
-			
-			// 获取楼层信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode(), 
-					RelCodeEnum.Eq2Fl.name(), equipId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", building, "建筑");
-			String buildingName = building.get("localName") == null ? AdmCommonConstant.EMPTY : building.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setMasterFloorName(floorName);
-			
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setMasterBelong(buildingName);
-			} else {
-				convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			
-			resultList.add(convertObject);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setMasterBelong(buildingName);
+		} else {
+			convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
 		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 34 - 47
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdRelationObject.java

@@ -1,26 +1,24 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -34,55 +32,44 @@ public class Eq2BdRelationObject extends AbstractQueryRelationObject {
 	public Eq2BdRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.BUILDING.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2BD.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2BD.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2BD.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2BD.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2BD.getGraphCode(), 
+				RelCodeEnum.Eq2Fl.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.EQ2BD.getGraphCode(), AdmRelationTypeEnum.EQ2BD.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String buildingId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(buildingId)) {
-				continue;
-			}
-			ObjectNode equipment = tempAllMap.get(equipId);
-			ObjectNode building = tempAllMap.get(buildingId);
-			
-			// 获取楼层信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2BD.getGraphCode(), 
-					RelCodeEnum.Eq2Fl.name(), equipId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", building, "建筑");
-			String buildingName = building.get("localName") == null ? AdmCommonConstant.EMPTY : building.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setSlaveFloorName(floorName);
-			
-			resultList.add(convertObject);
-		}
+		AdmRelationObject convertObject = this.convertObject(master, "设备", slave, "建筑");
+		String buildingName = slave.getLocalName();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setSlaveFloorName(floorName);
 		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Eq2EqEqBackupRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_2.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_2.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Eq2EqEqNormalRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_1.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_1.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -25,6 +31,19 @@ public class Eq2EqSyBackupRelationObject extends AbstractQueryRelationObject {
 	public Eq2EqSyBackupRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
+	
+	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_4.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_4.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
 
 	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
@@ -32,8 +51,7 @@ public class Eq2EqSyBackupRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Eq2EqSyNormalRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_3.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_3.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 39 - 53
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -38,61 +35,50 @@ public class Eq2FlForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.FLOOR.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2FL_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2FL_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取建筑信息
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode(), 
+				RelCodeEnum.Eq2Bd.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode(), AdmRelationTypeEnum.EQ2FL_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String floorId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(floorId)) {
-				continue;
-			}
-			ObjectNode equipment = tempAllMap.get(equipId);
-			ObjectNode floor = tempAllMap.get(floorId);
-			
-			// 获取建筑信息
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode(), 
-					RelCodeEnum.Eq2Bd.name(), equipId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", floor, "楼层");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			String floorName = floor.get("localName") == null ? AdmCommonConstant.EMPTY : floor.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setMasterFloorName(floorName);
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveBelong(buildingName);
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setMasterBelong(buildingName);
-			} else {
-				convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			
-			resultList.add(convertObject);
+		AdmRelationObject convertObject = this.convertObject(master, "设备", slave, "楼层");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		String floorName = slave.getLocalName();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setMasterFloorName(floorName);
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveBelong(buildingName);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setMasterBelong(buildingName);
+		} else {
+			convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
 		
-		return resultList;
+		return convertObject;
 	}
 	
 	@Override

+ 29 - 42
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlRelationObject.java

@@ -1,25 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -35,48 +33,37 @@ public class Eq2FlRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.FLOOR.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2FL.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2FL.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2FL.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2FL.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.EQ2FL.getGraphCode(), AdmRelationTypeEnum.EQ2FL.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String floorId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(floorId)) {
-				continue;
-			}
-			ObjectNode equipment = tempAllMap.get(equipId);
-			ObjectNode floor = tempAllMap.get(floorId);
-			
-			AdmRelationObject convertObject = this.convertObject(floor, "楼层", equipment, "设备");
-			String floorName = floor.get("localName") == null ? AdmCommonConstant.EMPTY : floor.get("localName").asText();
-			convertObject.setMasterFloorName(floorName);
-			convertObject.setSlaveFloorName(floorName);
-			
-			resultList.add(convertObject);
-		}
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		AdmRelationObject convertObject = this.convertObject(master, "楼层", slave, "设备");
+		String floorName = master.getLocalName();
+		convertObject.setMasterFloorName(floorName);
+		convertObject.setSlaveFloorName(floorName);
 		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 39 - 53
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2ShForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -38,60 +35,49 @@ public class Eq2ShForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.SHAFT.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2SH_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2SH_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode(), 
+				RelCodeEnum.Eq2Fl.name(), master.getId(), null);
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode(), 
+				RelCodeEnum.Eq2Bd.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode(), AdmRelationTypeEnum.EQ2SH_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String shaftId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(shaftId)) {
-				continue;
-			}
-			ObjectNode equipment = tempAllMap.get(equipId);
-			ObjectNode shaft = tempAllMap.get(shaftId);
-			
-			// 获取楼层信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode(), 
-					RelCodeEnum.Eq2Fl.name(), equipId, null);
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode(), 
-					RelCodeEnum.Eq2Bd.name(), equipId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", shaft, "竖井");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setMasterFloorName(floorName);
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setMasterBelong(buildingName);
-			} else {
-				convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			resultList.add(convertObject);
+		AdmRelationObject convertObject = this.convertObject(master, "设备", slave, "竖井");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setMasterFloorName(floorName);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setMasterBelong(buildingName);
+		} else {
+			convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
-		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 26 - 38
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java

@@ -1,24 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
-import com.persagy.proxy.adm.constant.AdmObjectType;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 此类型需转为 AdmRelationTypeEnum.EQ2SP_IN 进行数据查询
  * 
@@ -35,43 +34,32 @@ public class Eq2SpRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.EQUIPMENT.getIndex()).add(AdmObjectType.SPACE.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SP_IN.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2SP_IN.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.EQ2SP_IN.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.EQ2SP_IN.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, AdmRelationTypeEnum.EQ2SP_IN.getGraphCode(), AdmRelationTypeEnum.EQ2SP_IN.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String spaceId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(spaceId)) {
-				continue;
-			}
-			ObjectNode space = tempAllMap.get(spaceId);
-			ObjectNode equipment = tempAllMap.get(equipId);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", space, "空间");
-			resultList.add(convertObject);
-		}
-		
-		return resultList;
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		return this.convertObject(master, "设备", slave, "空间");
 	}
 
 	@Override

+ 9 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/QueryRelationObjectStrategy.java

@@ -36,6 +36,15 @@ public interface QueryRelationObjectStrategy {
     };
     
 	/**
+	 * 统计关系总数
+	 * 
+	 * @param groupCode
+	 * @param projectId
+	 * @return
+	 */
+	int countRelationObjects(String groupCode, String projectId);
+    
+	/**
 	 * 查询出所有的关系信息
 	 * 
 	 * @param groupCode 集团编码

+ 26 - 39
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2BdForRelationObject.java

@@ -1,24 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
-import com.persagy.proxy.adm.constant.AdmObjectType;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -34,44 +33,32 @@ public class Sh2BdForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SHAFT.getIndex()).add(AdmObjectType.BUILDING.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String equipId = objectRelation.getObjFrom();
-			String spaceId = objectRelation.getObjTo();
-			if (!allKeys.contains(equipId) || !allKeys.contains(spaceId)) {
-				continue;
-			}
-			ObjectNode space = tempAllMap.get(spaceId);
-			ObjectNode equipment = tempAllMap.get(equipId);
-			
-			AdmRelationObject convertObject = this.convertObject(equipment, "设备", space, "空间");
-			resultList.add(convertObject);
-		}
-		
-		return resultList;
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		return this.convertObject(master, "设备", slave, "空间");
 	}
 
 	@Override

+ 32 - 43
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2FlForRelationObject.java

@@ -1,26 +1,24 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -36,50 +34,41 @@ public class Sh2FlForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SHAFT.getIndex()).add(AdmObjectType.FLOOR.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String shaftId = objectRelation.getObjFrom();
-			String floorId = objectRelation.getObjTo();
-			if (!allKeys.contains(shaftId) || !allKeys.contains(floorId)) {
-				continue;
-			}
-			ObjectNode shaft = tempAllMap.get(shaftId);
-			ObjectNode floor = tempAllMap.get(floorId);
-			// 获取建筑的信息
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode(), 
-					RelCodeEnum.Sh2Bd.name(), shaftId, null);
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取建筑的信息
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode(), 
+				RelCodeEnum.Sh2Bd.name(), master.getId(), null);
 
-			AdmRelationObject convertObject = this.convertObject(shaft, "竖井", floor, "楼层");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveBelong(buildingName);
-			resultList.add(convertObject);
-		}
+		AdmRelationObject convertObject = this.convertObject(master, "竖井", slave, "楼层");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveBelong(buildingName);
 		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 27 - 40
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2ShForRelationObject.java

@@ -1,24 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
-import com.persagy.proxy.adm.constant.AdmObjectType;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -32,46 +31,34 @@ public class Sh2ShForRelationObject extends AbstractQueryRelationObject {
 	public Sh2ShForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SHAFT.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
-		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String shaftIdF = objectRelation.getObjFrom();
-			String shaftIdT = objectRelation.getObjTo();
-			if (!allKeys.contains(shaftIdF) || !allKeys.contains(shaftIdT)) {
-				continue;
-			}
-			ObjectNode shaftF = tempAllMap.get(shaftIdF);
-			ObjectNode shaftT = tempAllMap.get(shaftIdT);
-			
-			AdmRelationObject convertObject = this.convertObject(shaftF, "竖井", shaftT, "竖井");
-			resultList.add(convertObject);
-		}
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return resultList;
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
+	}
+
+	@Override
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		return this.convertObject(master, "竖井", slave, "竖井");
 	}
 
 	@Override

+ 39 - 53
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2SpForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -38,60 +35,49 @@ public class Sh2SpForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SHAFT.getIndex()).add(AdmObjectType.SPACE.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取建筑的信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode(), 
+				RelCodeEnum.Sh2Fl.name(), master.getId(), null);
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode(), 
+				RelCodeEnum.Sh2Bd.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String shaftId = objectRelation.getObjFrom();
-			String spaceId = objectRelation.getObjTo();
-			if (!allKeys.contains(shaftId) || !allKeys.contains(spaceId)) {
-				continue;
-			}
-			ObjectNode shaft = tempAllMap.get(shaftId);
-			ObjectNode space = tempAllMap.get(spaceId);
-			// 获取建筑的信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode(), 
-					RelCodeEnum.Sh2Fl.name(), shaftId, null);
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode(), 
-					RelCodeEnum.Sh2Bd.name(), shaftId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(shaft, "竖井", space, "空间");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveFloorName(floorName);
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setSlaveBelong(buildingName);
-			} else {
-				convertObject.setSlaveBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-
-			resultList.add(convertObject);
+		AdmRelationObject convertObject = this.convertObject(master, "竖井", slave, "空间");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveFloorName(floorName);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setSlaveBelong(buildingName);
+		} else {
+			convertObject.setSlaveBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
-		
-		return resultList;
+		return convertObject;
 	}
 	
 	@Override

+ 38 - 52
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2BdForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -36,60 +33,49 @@ public class Sp2BdForRelationObject extends AbstractQueryRelationObject {
 	public Sp2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SPACE.getIndex()).add(AdmObjectType.BUILDING.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层的信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode(), 
+				RelCodeEnum.Sp2Fl.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String spaceId = objectRelation.getObjFrom();
-			String buildingId = objectRelation.getObjTo();
-			if (!allKeys.contains(spaceId) || !allKeys.contains(buildingId)) {
-				continue;
-			}
-			ObjectNode space = tempAllMap.get(spaceId);
-			ObjectNode building = tempAllMap.get(buildingId);
-			// 获取楼层的信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode(), 
-					RelCodeEnum.Sp2Fl.name(), spaceId, null);
-			
-			// 这里最后一个参数,写为空间,和ADM保持一致
-			AdmRelationObject convertObject = this.convertObject(space, "空间", building, "空间");
-			String buildingName = building.get("localName") == null ? AdmCommonConstant.EMPTY : building.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setMasterFloorName(floorName);
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setMasterBelong(buildingName);
-			} else {
-				convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			resultList.add(convertObject);
+		AdmRelationObject convertObject = this.convertObject(master, "空间", slave, "建筑");
+		String buildingName = slave.getLocalName();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setMasterFloorName(floorName);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setMasterBelong(buildingName);
+		} else {
+			convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
-		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 40 - 53
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2FlForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -38,60 +35,50 @@ public class Sp2FlForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SPACE.getIndex()).add(AdmObjectType.FLOOR.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取建筑的信息
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode(), 
+				RelCodeEnum.Sp2Bd.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode(), AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String spaceId = objectRelation.getObjFrom();
-			String floorId = objectRelation.getObjTo();
-			if (!allKeys.contains(spaceId) || !allKeys.contains(floorId)) {
-				continue;
-			}
-			ObjectNode space = tempAllMap.get(spaceId);
-			ObjectNode floor = tempAllMap.get(floorId);
-			// 获取建筑的信息
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode(), 
-					RelCodeEnum.Sp2Bd.name(), spaceId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(space, "空间", floor, "楼层");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			String floorName = floor.get("localName") == null ? AdmCommonConstant.EMPTY : floor.get("localName").asText();
-			convertObject.setMasterBuildingName(buildingName);
-			convertObject.setMasterFloorName(floorName);
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveBelong(buildingName);
-			
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setMasterBelong(buildingName);
-			} else {
-				convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			resultList.add(convertObject);
-		}
+		AdmRelationObject convertObject = this.convertObject(master, "空间", slave, "楼层");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		String floorName = slave.getLocalName();
+		convertObject.setMasterBuildingName(buildingName);
+		convertObject.setMasterFloorName(floorName);
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveBelong(buildingName);
 		
-		return resultList;
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setMasterBelong(buildingName);
+		} else {
+			convertObject.setMasterBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
+		}
+		return convertObject;
 	}
 
 	@Override

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpConnectRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_2.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_2.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpFFCloseRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_3.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_3.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpFFOpenRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_2.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_2.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpMixMechRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_2.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_2.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpNaturalRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -25,6 +31,19 @@ public class Sp2SpNormalRelationObject extends AbstractQueryRelationObject {
 	public Sp2SpNormalRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
+	
+	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
 
 	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
@@ -32,8 +51,7 @@ public class Sp2SpNormalRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpOnewayMechRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_3.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_3.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.SpaceTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -27,13 +33,25 @@ public class Sp2SpTransparentRelationObject extends AbstractQueryRelationObject
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 图类型编码 -- SensorRelationship
  * 
@@ -28,13 +34,25 @@ public class Ss2EqShipRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_SENSORRELATIONSHIP_SS2EQ.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2EQ_SENSORRELATIONSHIP_SS2EQ.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 图类型编码 -- SensorRelationship
  * 
@@ -26,6 +32,19 @@ public class Ss2SpShipRelationObject extends AbstractQueryRelationObject {
 	public Ss2SpShipRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
+	
+	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
 
 	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
@@ -33,8 +52,7 @@ public class Ss2SpShipRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 21 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java

@@ -1,17 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmObjectInfoConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 图类型编码 -- SensorRelationship
  * 
@@ -28,13 +34,25 @@ public class Ss2SyShipRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
+	public int countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SY_SENSORRELATIONSHIP_SS2SY.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.EQ2SY_SENSORRELATIONSHIP_SS2SY.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode,
-			String projectId) {
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}
 

+ 27 - 40
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2BdForRelationObject.java

@@ -1,24 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
-import com.persagy.proxy.adm.constant.AdmObjectType;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -32,46 +31,34 @@ public class Sy2BdForRelationObject extends AbstractQueryRelationObject {
 	public Sy2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SYSTEM.getIndex()).add(AdmObjectType.BUILDING.getIndex());
-		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SY2BD_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SY2BD_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SY2BD_FOR.getGraphCode(), AdmRelationTypeEnum.SY2BD_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String systemId = objectRelation.getObjFrom();
-			String buildingId = objectRelation.getObjTo();
-			if (!allKeys.contains(systemId) || !allKeys.contains(buildingId)) {
-				continue;
-			}
-			ObjectNode system = tempAllMap.get(systemId);
-			ObjectNode building = tempAllMap.get(buildingId);
-			
-			AdmRelationObject convertObject = this.convertObject(system, "系统", building, "建筑");
-			resultList.add(convertObject);
-		}
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SY2BD_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SY2BD_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return resultList;
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
+	}
+
+	@Override
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		return this.convertObject(master, "系统", slave, "建筑");
 	}
 	
 	@Override

+ 32 - 44
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2FlForRelationObject.java

@@ -1,26 +1,24 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -36,51 +34,41 @@ public class Sy2FlForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SYSTEM.getIndex()).add(AdmObjectType.FLOOR.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SY2FL_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SY2FL_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SY2FL_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SY2FL_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层信息
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2FL_FOR.getGraphCode(), 
+				RelCodeEnum.Sy2Bd.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SY2FL_FOR.getGraphCode(), AdmRelationTypeEnum.SY2FL_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String systemId = objectRelation.getObjFrom();
-			String floorId = objectRelation.getObjTo();
-			if (!allKeys.contains(systemId) || !allKeys.contains(floorId)) {
-				continue;
-			}
-			ObjectNode system = tempAllMap.get(systemId);
-			ObjectNode floor = tempAllMap.get(floorId);
-			
-			// 获取楼层信息
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2FL_FOR.getGraphCode(), 
-					RelCodeEnum.Sy2Bd.name(), systemId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(system, "系统", floor, "楼层");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveBelong(buildingName);
-			resultList.add(convertObject);
-		}
+		AdmRelationObject convertObject = this.convertObject(master, "系统", slave, "楼层");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveBelong(buildingName);
 		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override

+ 27 - 40
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2ShForRelationObject.java

@@ -1,24 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
-import com.persagy.proxy.adm.constant.AdmObjectType;
+import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
+
 /**
  * 
  * @version 1.0.0
@@ -32,46 +31,34 @@ public class Sy2ShForRelationObject extends AbstractQueryRelationObject {
 	public Sy2ShForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
-
+	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SYSTEM.getIndex()).add(AdmObjectType.SHAFT.getIndex());
-		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SY2SH_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SY2SH_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
-		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SY2SH_FOR.getGraphCode(), AdmRelationTypeEnum.SY2SH_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String systemId = objectRelation.getObjFrom();
-			String shaftId = objectRelation.getObjTo();
-			if (!allKeys.contains(systemId) || !allKeys.contains(shaftId)) {
-				continue;
-			}
-			ObjectNode system = tempAllMap.get(systemId);
-			ObjectNode shaft = tempAllMap.get(shaftId);
-			
-			AdmRelationObject convertObject = this.convertObject(system, "系统", shaft, "竖井");
-			resultList.add(convertObject);
-		}
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SY2SH_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SY2SH_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return resultList;
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
+	}
+
+	@Override
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		return this.convertObject(master, "系统", slave, "竖井");
 	}
 
 	@Override

+ 39 - 54
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2SpForRelationObject.java

@@ -1,26 +1,23 @@
 package com.persagy.proxy.adm.strategy.relationdata;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.springframework.stereotype.Component;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
-import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.constant.AdmObjectType;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
@@ -38,61 +35,49 @@ public class Sy2SpForRelationObject extends AbstractQueryRelationObject {
 	}
 
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+	public int countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
-		ObjectNode criteria = objectMapper.createObjectNode();
-		// 参数条件
-		ObjectNode objType = objectMapper.createObjectNode();
-		ArrayNode objTypes = objType.putArray(WHERE_IN);
-		objTypes.add(AdmObjectType.SYSTEM.getIndex()).add(AdmObjectType.SPACE.getIndex());
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SY2SP_FOR.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SY2SP_FOR.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
 		
-		criteria.set(OBJ_TYPE, objType);
-		queryCriteria.setCriteria(criteria);
-		queryCriteria.setPage(1L);
-		queryCriteria.setSize(1000L);
+		List<ObjectRelation> result = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return CollectionUtil.isEmpty(result) ? 0 : result.size();
+	}
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(AdmRelationTypeEnum.SY2SP_FOR.getGraphCode());
+		requestData.setRelCode(AdmRelationTypeEnum.SY2SP_FOR.getRelCode());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
 		
-		return this.queryAllObjectInfo(queryCriteria, groupCode, projectId);
+		return this.queryAllObjectInfo(requestData, groupCode, projectId);
 	}
 
 	@Override
-	protected List<AdmRelationObject> handleObjectDigital(Map<String, ObjectNode> tempAllMap, String groupCode, String projectId) {
-		Set<String> allKeys = tempAllMap.keySet();
-		List<AdmRelationObject> resultList = new ArrayList<AdmRelationObject>();
+	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
+		// 获取楼层信息
+		ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2SP_FOR.getGraphCode(), 
+				RelCodeEnum.Sy2Bd.name(), master.getId(), null);
+		ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2SP_FOR.getGraphCode(), 
+				RelCodeEnum.Sy2Fl.name(), master.getId(), null);
 		
-		List<ObjectRelation> relationList = this.relationReportService.findObjectRelationList(groupCode, projectId, 
-				AdmRelationTypeEnum.SY2SP_FOR.getGraphCode(), AdmRelationTypeEnum.SY2SP_FOR.getRelCode());
-		for (ObjectRelation objectRelation : relationList) {
-			String systemId = objectRelation.getObjFrom();
-			String spaceId = objectRelation.getObjTo();
-			if (!allKeys.contains(systemId) || !allKeys.contains(spaceId)) {
-				continue;
-			}
-			ObjectNode system = tempAllMap.get(systemId);
-			ObjectNode space = tempAllMap.get(spaceId);
-			
-			// 获取楼层信息
-			ObjectNode floorInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2SP_FOR.getGraphCode(), 
-					RelCodeEnum.Sy2Bd.name(), systemId, null);
-			ObjectNode buildingInfo = this.relationReportService.getObjectByCodeAndId(groupCode, projectId, AdmRelationTypeEnum.SY2SP_FOR.getGraphCode(), 
-					RelCodeEnum.Sy2Fl.name(), systemId, null);
-			
-			AdmRelationObject convertObject = this.convertObject(system, "系统", space, "空间");
-			String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
-			String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
-			convertObject.setSlaveBuildingName(buildingName);
-			convertObject.setSlaveFloorName(floorName);
-			if (StrUtil.isBlank(floorName)) {
-				convertObject.setSlaveBelong(buildingName);
-			} else {
-				convertObject.setSlaveBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
-						: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
-			}
-			
-			resultList.add(convertObject);
+		AdmRelationObject convertObject = this.convertObject(master, "系统", slave, "空间");
+		String buildingName = buildingInfo.get("localName") == null ? AdmCommonConstant.EMPTY : buildingInfo.get("localName").asText();
+		String floorName = floorInfo.get("localName") == null ? AdmCommonConstant.EMPTY : floorInfo.get("localName").asText();
+		convertObject.setSlaveBuildingName(buildingName);
+		convertObject.setSlaveFloorName(floorName);
+		if (StrUtil.isBlank(floorName)) {
+			convertObject.setSlaveBelong(buildingName);
+		} else {
+			convertObject.setSlaveBelong((StrUtil.isBlank(buildingName) ? AdmCommonConstant.EMPTY 
+					: StrUtil.join(AdmCommonConstant.LINE_THROUGH, buildingName, floorName)));
 		}
-		
-		return resultList;
+		return convertObject;
 	}
 
 	@Override