فهرست منبع

新增报表服务建筑与统计查询功能

zhangqiankun 3 سال پیش
والد
کامیت
c386fffd85
42فایلهای تغییر یافته به همراه721 افزوده شده و 295 حذف شده
  1. 6 3
      src/main/java/com/persagy/proxy/adm/constant/AdmRelationType.java
  2. 145 0
      src/main/java/com/persagy/proxy/adm/controller/ComponentBuildingController.java
  3. 191 0
      src/main/java/com/persagy/proxy/adm/controller/ComponentStatisticsController.java
  4. 6 6
      src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java
  5. 38 0
      src/main/java/com/persagy/proxy/adm/request/AdmCountResponse.java
  6. 5 5
      src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java
  7. 32 9
      src/main/java/com/persagy/proxy/adm/strategy/QueryRelationObjectContext.java
  8. 67 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractRelationObject.java
  9. 5 35
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java
  10. 45 0
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Bd2FlSubRelationObject.java
  11. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdForRelationObject.java
  12. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdRelationObject.java
  13. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java
  14. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java
  15. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java
  16. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java
  17. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlForRelationObject.java
  18. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlRelationObject.java
  19. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2ShForRelationObject.java
  20. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java
  21. 26 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/QueryRelationObjectStrategy.java
  22. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2BdForRelationObject.java
  23. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2FlForRelationObject.java
  24. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2ShForRelationObject.java
  25. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2SpForRelationObject.java
  26. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2BdForRelationObject.java
  27. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2FlForRelationObject.java
  28. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java
  29. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java
  30. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java
  31. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java
  32. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java
  33. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java
  34. 5 11
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java
  35. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java
  36. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java
  37. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java
  38. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java
  39. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2BdForRelationObject.java
  40. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2FlForRelationObject.java
  41. 5 6
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2ShForRelationObject.java
  42. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2SpForRelationObject.java

+ 6 - 3
src/main/java/com/persagy/proxy/adm/constant/AdmRelationType.java

@@ -1,9 +1,9 @@
 package com.persagy.proxy.adm.constant;
 
 /**
- * 所有数据的来源为
- * {@link com.persagy.proxy.adm.constant.AdmRelationTypeEnum}
- * 的relationType字段
+ * 数据的来源为 {@link com.persagy.proxy.adm.constant.AdmRelationTypeEnum} 的relationType字段
+ * 部分字段为自定义
+ * 
  * @version 1.0.0
  * @company persagy 
  * @author zhangqiankun
@@ -11,6 +11,9 @@ package com.persagy.proxy.adm.constant;
  */
 public interface AdmRelationType {
 
+	/** Bd2Fl_ArchSubset  表示从属关系*/
+	String BD2FL_ARCHSUBSET = "bd2fl_ArchSubset";
+	
 	String EQ2BD = "eq2bd";
 	
 	String EQ2FL = "eq2fl";

+ 145 - 0
src/main/java/com/persagy/proxy/adm/controller/ComponentBuildingController.java

@@ -0,0 +1,145 @@
+package com.persagy.proxy.adm.controller;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.common.model.response.CommonResult;
+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.GraphCodeEnum;
+import com.persagy.proxy.adm.constant.RelCodeEnum;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.adm.strategy.RelationObjectContext;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年9月8日 下午7:28:00
+ */
+@RestController
+public class ComponentBuildingController {
+
+	@Autowired
+	private RelationObjectContext relationObjectContext;
+	
+	/**
+	 * 建筑查询,这里查楼层都是从属关系,而非服务关系
+	 * @param queryCriteria
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping("/building/query")
+	public AdmResponse queryBuilding(@RequestBody AdmQueryCriteria queryCriteria, HttpServletRequest request) {
+		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		
+		// 查询出所有的建筑对象
+		RequestData requestData = new RequestData();
+		requestData.setGraphCode(GraphCodeEnum.ArchSubset.name());
+		requestData.setRelCode(RelCodeEnum.Bd2Fl.name());
+		requestData.setPage(1L);
+		requestData.setSize(1000L);
+		
+		List<ObjectDigital> masterObjs = this.relationObjectContext.queryPageObjectInfo(requestData, groupCode, projectId, AdmRelationType.BD2FL_ARCHSUBSET);
+		this.handleMasterObjs(masterObjs, groupCode, projectId);
+		return AdmResponse.success();
+	}
+
+	/**
+	 * 处理响应结果集
+	 * 
+	 * @param masterObjs
+	 * @param groupCode
+	 * @param projectId
+	 */
+	private List<JSONObject> handleMasterObjs(List<ObjectDigital> masterObjs, String groupCode, String projectId) {
+		Map<String, Long> modelIds = new HashMap<String, Long>();
+		List<JSONObject> resultList = new ArrayList<JSONObject>();
+		
+		// 遍历所有主对象
+		for (ObjectDigital master : masterObjs) {
+			JSONObject result = new JSONObject();
+			
+			result.put("id", master.getId());
+			result.put("localId", master.getLocalId());
+			result.put("localName", master.getLocalName());
+			result.put("name", master.getName());
+			result.put("objectType", master.getObjType());
+			result.put("projectId", master.getProjectId());
+			result.put("infos", master.getInfos());
+			result.put("createTime", master.getCreationTime() == null ? null : master.getCreationTime().toString("yyyy-DD-MM 24HH:mm:ss"));
+			result.put("lastUpdate", master.getModifiedTime() == null ? null : master.getModifiedTime().toString("yyyy-DD-MM 24HH:mm:ss"));
+			result.put("statistics", new JSONObject());
+			
+			List<ObjectDigital> slaveObjs = master.getRelObjs();
+			if (CollectionUtil.isNotEmpty(slaveObjs)) {
+				// 遍历所有的从对象
+				for (ObjectDigital slave : slaveObjs) {
+					ObjectNode infos = slave.getInfos();
+					String outline = infos.get("outline") == null ? null : infos.get("outline").asText();
+					String modelFile = infos.get("modelFile") == null ? null : infos.get("modelFile").asText();
+					if (StrUtil.isEmpty(outline) && StrUtil.isNotBlank(modelFile)) {
+						// 判断此模型是否被多处使用
+						if (modelIds.containsKey(modelFile)) {
+							result.put("count", modelIds.get(modelFile));
+						} else {
+							long count = this.getNumByModelId(groupCode, projectId, modelFile);
+							result.put("count", count);
+							modelIds.put(modelFile, count);
+						}
+					}
+				}
+			}
+			
+			resultList.add(result);
+		}
+		
+		return resultList;
+	}
+	
+	/**
+	 * 获取此项目使用此模型ID的所有楼层数量
+	 * 
+	 * @param groupCode
+	 * @param projectId
+	 * @param modelId
+	 * @return
+	 */
+	private long getNumByModelId(String groupCode, String projectId, String modelId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+		ObjectNode objectNode = objectMapper.createObjectNode();
+		objectNode.put("classCode", AdmObjectType.FLOOR.getIndex());
+		objectNode.put("modelFile", modelId);
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
+	}
+	
+}

+ 191 - 0
src/main/java/com/persagy/proxy/adm/controller/ComponentStatisticsController.java

@@ -0,0 +1,191 @@
+package com.persagy.proxy.adm.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.digital.client.DigitalObjectFacade;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+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.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.request.AdmCountResponse;
+
+/**
+ * 统计接口
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年9月8日 下午7:51:56
+ */
+@RestController
+@RequestMapping("/statistics")
+public class ComponentStatisticsController {
+
+	/**
+	 * 台账中待删除的对象
+	 * <p>条件:"filters": "taskState = -1"</p>
+	 * @param queryCriteria
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/object-delete-count")
+	public AdmCountResponse objectDeleteCount(@RequestBody JSONObject params, HttpServletRequest request) {
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 不能同步到物理世界的关系数据
+	 * 
+	 * @param params
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/unsyn-relation-count")
+	public AdmCountResponse unsynRelationCount(HttpServletRequest request) {
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 岗位和关联的资产信息点值不一致
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/eq2pe-count")
+	public AdmCountResponse eq2peCount(HttpServletRequest request) {
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 岗位和关联的资产信息点值不一致的数据
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/eq2pe-different")
+	public AdmCountResponse eq2peDifferent(HttpServletRequest request) {
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 设备-未关联资产的设备,这里返回所有的设备
+	 * 
+	 * @param params
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/uneq2pe-count")
+	public AdmCountResponse uneq2peCount(HttpServletRequest request) {
+		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+		ObjectNode objectNode = objectMapper.createObjectNode();
+		objectNode.put("classCode", AdmObjectType.EQUIPMENT.getIndex());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		CommonResult<List<ObjectNode>> result = DigitalObjectFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
+		return AdmCountResponse.success(count);
+	}
+	
+	/**
+	 * 业务空间-各分区占比
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/sp-objecttype-count")
+	public AdmCountResponse spObjectTypeCount(HttpServletRequest request) {
+		//String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		//String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 业务空间-默认分区功能类型占比
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/general-sp-functype-count")
+	public AdmCountResponse generalSpFunctypeCount(HttpServletRequest request) {
+		//String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		//String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		return AdmCountResponse.success(0L);
+	}
+	
+	/**
+	 * 租户-关联业务空间完成度
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/tenant2sp-count")
+	public AdmCountResponse tenant2spCount(HttpServletRequest request) {
+		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+		ObjectNode objectNode = objectMapper.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.TN2SP.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.TN2SP.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
+		return AdmCountResponse.success(count);
+	}
+	
+	/**
+	 * 竖井-关联业务空间完成度
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/shaft2sp-count")
+	public AdmCountResponse shaft2spCount(HttpServletRequest request) {
+		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+		ObjectNode objectNode = objectMapper.createObjectNode();
+		objectNode.put("graphCode", AdmRelationTypeEnum.SH2SP.getGraphCode());
+		objectNode.put("relCode", AdmRelationTypeEnum.SH2SP.getRelCode());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
+		return AdmCountResponse.success(count);
+	}
+	
+	/**
+	 * 竖井-按功能类型占比
+	 * 
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/shaft-functype-count")
+	public AdmCountResponse shaftFunctypeCount(HttpServletRequest request) {
+		//String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
+		//String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
+		return AdmCountResponse.success(0L);
+	}
+	
+}

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

@@ -34,7 +34,7 @@ import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IRelationReportService;
-import com.persagy.proxy.adm.strategy.QueryRelationObjectContext;
+import com.persagy.proxy.adm.strategy.RelationObjectContext;
 
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -54,10 +54,10 @@ public class RelationReportController {
 	public static final String EXPORT_SHEET_NAME = "关系维护";
 	
 	@Autowired
-	private IRelationReportService relationReportService;
+	private RelationObjectContext relationObjectContext;
 	
 	@Autowired
-	private QueryRelationObjectContext queryRelationObjectContext;
+	private IRelationReportService relationReportService;
 	
 	/**
 	 * 查询总览数量-根据类型查询关系数量
@@ -68,7 +68,7 @@ public class RelationReportController {
 	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);
+		long count = this.relationObjectContext.countRelationObjects(groupCode, projectId, type);
 		JSONObject result = new JSONObject();
 		result.put("count", count);
 		result.put("relationType", type);
@@ -312,7 +312,7 @@ public class RelationReportController {
 		    	relationObject.setSlaveId(slaveIdCell == null ? null : slaveIdCell.getStringCellValue());
 		    	
 		    	// 校验数据
-				Object result = this.queryRelationObjectContext.checkRelationObject(relationObject, groupCode, projectId, relType, code);
+				Object result = this.relationObjectContext.checkRelationObject(relationObject, groupCode, projectId, relType, code);
 				if (result instanceof String) {
 					failurNum++;
 					xssfRow.createCell(16).setCellValue((String)result);
@@ -325,7 +325,7 @@ public class RelationReportController {
 				rowNums.add(i);
 				relationObjects.add(relation);
 				if (relationObjects.size() >= 1000) {
-					boolean objects = this.queryRelationObjectContext.saveRelationObjects(relationObjects, groupCode, projectId, relType);
+					boolean objects = this.relationObjectContext.saveRelationObjects(relationObjects, groupCode, projectId, relType);
 					if (objects) {
 						successNum += relationObjects.size();
 					} else {

+ 38 - 0
src/main/java/com/persagy/proxy/adm/request/AdmCountResponse.java

@@ -0,0 +1,38 @@
+package com.persagy.proxy.adm.request;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * ADM 通用返回结果
+ * @author Charlie Yu
+ * @date 2021-08-16
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class AdmCountResponse {
+    private final static String SUCCESS = "success";
+    private final static String FAILURE = "failure";
+    
+    /** 结果 */
+    private String result;
+    /** 消息 */
+    private String message;
+    /** 符合条件的总记录数 */
+    private Long count;
+
+    public static AdmCountResponse success() {
+        return new AdmCountResponse(SUCCESS, null, null);
+    }
+    
+    public static AdmCountResponse success(Long count) {
+        return new AdmCountResponse(SUCCESS, null, count);
+    }
+
+    public static AdmCountResponse failure(String message) {
+        return new AdmCountResponse(FAILURE, message, null);
+    }
+
+}

+ 5 - 5
src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java

@@ -18,8 +18,8 @@ import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationType;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.service.IRelationReportService;
-import com.persagy.proxy.adm.strategy.QueryRelationObjectContext;
-import com.persagy.proxy.adm.strategy.relationdata.QueryRelationObjectStrategy;
+import com.persagy.proxy.adm.strategy.RelationObjectContext;
+import com.persagy.proxy.adm.strategy.relationdata.RelationObjectStrategy;
 
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
@@ -46,7 +46,7 @@ public class RelationReportService implements IRelationReportService {
 	private String defaultCode;
 
 	@Autowired
-	private QueryRelationObjectContext queryRelationObjectContext;
+	private RelationObjectContext relationObjectContext;
 	
 	@Override
 	public ObjectNode getObjectNode(String groupCode, String projectId, String id) {
@@ -64,7 +64,7 @@ public class RelationReportService implements IRelationReportService {
 		if (StrUtil.isBlank(code)) {
 			return null;
 		}
-		String key = QueryRelationObjectStrategy.OBJNAME_2_TYPE.get(code);
+		String key = RelationObjectStrategy.OBJNAME_2_TYPE.get(code);
 		if (StrUtil.isBlank(key)) {
 			return null;
 		}
@@ -128,7 +128,7 @@ public class RelationReportService implements IRelationReportService {
 			relType = AdmRelationType.EQ2SP;
         }
 		log.info("下载报表: groupCode[{}], projectId[{}], relType[{}], code[{}]", groupCode, projectId, relType, code);
-		return this.queryRelationObjectContext.findRelationObject(groupCode, projectId, relType);
+		return this.relationObjectContext.findRelationObject(groupCode, projectId, relType);
 	}
 
 }

+ 32 - 9
src/main/java/com/persagy/proxy/adm/strategy/QueryRelationObjectContext.java

@@ -1,5 +1,6 @@
 package com.persagy.proxy.adm.strategy;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -9,8 +10,10 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.Lists;
+import com.persagy.dmp.basic.dto.RequestData;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.proxy.adm.model.AdmRelationObject;
-import com.persagy.proxy.adm.strategy.relationdata.QueryRelationObjectStrategy;
+import com.persagy.proxy.adm.strategy.relationdata.RelationObjectStrategy;
 
 /**
  * 获取关系对象的上下文类
@@ -21,12 +24,12 @@ import com.persagy.proxy.adm.strategy.relationdata.QueryRelationObjectStrategy;
  * @date 2021年9月2日 下午10:44:32
  */
 @Component
-public class QueryRelationObjectContext {
+public class RelationObjectContext {
 
 	/**
 	 * 策略执行类
 	 */
-	private Map<String, QueryRelationObjectStrategy> relationObjectStrategyMap;
+	private Map<String, RelationObjectStrategy> relationObjectStrategyMap;
 	
 	/**
 	 * 自动注入 byName
@@ -34,7 +37,7 @@ public class QueryRelationObjectContext {
 	 * @param relationObjectStrategyMap
 	 */
 	@Resource
-	public void relationObjectStrategyMap(Map<String, QueryRelationObjectStrategy> relationObjectStrategyMap) {
+	public void relationObjectStrategyMap(Map<String, RelationObjectStrategy> relationObjectStrategyMap) {
 		this.relationObjectStrategyMap = relationObjectStrategyMap;
 	}
 	
@@ -47,7 +50,7 @@ public class QueryRelationObjectContext {
 	 * @return
 	 */
 	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId, String relType) {
-		QueryRelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
 		return strategy == null ? Lists.newArrayList() : strategy.findRelationObject(groupCode, projectId);
 	}
 	
@@ -60,7 +63,7 @@ public class QueryRelationObjectContext {
 	 * @return String - 校验失败的原因, ObjectNode -- BDTP接口的参数,不会返回null,请用instanceOf 判断返回值
 	 */
 	public Object checkRelationObject(AdmRelationObject relationObject, String groupCode, String projectId, String relType, String code) {
-		QueryRelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
 		if (strategy == null) {
 			return "不存在此策略类";
 		}
@@ -78,7 +81,7 @@ public class QueryRelationObjectContext {
 	 * @return 
 	 */
 	public boolean saveRelationObjects(List<ObjectNode> relationObjects, String groupCode, String projectId, String relType) {
-		QueryRelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
 		if (strategy == null) {
 			return false;
 		}
@@ -94,12 +97,32 @@ public class QueryRelationObjectContext {
 	 * @param relType ADM-传过来的边类型
 	 * @return 
 	 */
-	public int countRelationObjects(String groupCode, String projectId, String relType) {
-		QueryRelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+	public long countRelationObjects(String groupCode, String projectId, String relType) {
+		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
 		if (strategy == null) {
 			return 0;
 		}
 		
 		return strategy.countRelationObjects(groupCode, projectId);
 	}
+	
+	/**
+	 * 分页查询关系对象数据
+	 * 
+	 * @param masterObjs 查询的数据集存储地方
+	 * @param requestData 请求参数
+	 * @param groupCode 集团编码
+	 * @param projectId 项目ID
+	 * @param relType 
+	 */
+	public List<ObjectDigital> queryPageObjectInfo(RequestData requestData, String groupCode, String projectId, String relType) {
+		List<ObjectDigital> masterObjs = new ArrayList<ObjectDigital>();
+		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(relType);
+		if (strategy == null) {
+			return masterObjs;
+		}
+		strategy.queryPageObjectInfo(masterObjs, requestData, groupCode, projectId, requestData.getPage());
+		return masterObjs;
+	}
+	
 }

+ 67 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractRelationObject.java

@@ -0,0 +1,67 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+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.model.AdmRelationObject;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+import cn.hutool.core.collection.CollectionUtil;
+
+/**
+ * 普通操作抽象类
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年9月2日 下午11:00:26
+ */
+public abstract class AbstractRelationObject implements RelationObjectStrategy {
+
+	protected IRelationReportService relationReportService;
+	
+	public AbstractRelationObject(IRelationReportService reportDownloadService) {
+		this.relationReportService = reportDownloadService;
+	}
+	
+	@Override
+	public void queryPageObjectInfo(List<ObjectDigital> masterObjs, 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;
+		}
+		masterObjs.addAll(objectDigitals);
+		this.queryPageObjectInfo(masterObjs, requestData, groupCode, projectId, ++page);
+	}
+	
+	@Override
+	public boolean saveRelationObject(ObjectNode relationObject, String groupCode, String projectId) {
+		ObjectRelation objectRelation = DigitalRelationFacade.createOne(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, relationObject);
+		return 	objectRelation != null;
+	}
+	
+	@Override
+	public boolean saveRelationObjects(List<ObjectNode> relationObjects, String groupCode, String projectId) {
+		List<ObjectRelation> create = DigitalRelationFacade.create(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, relationObjects);
+		return 	CollectionUtil.isNotEmpty(create);
+	}
+	
+	/**************************************************** 默认不实现的类 *******************************************************/
+	
+	@Override
+	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+
+	@Override
+	public Object beforeSaveRelationObject(AdmRelationObject relationObject, String groupCode, String projectId, String code) {
+		throw new UnsupportedOperationException("未实现的策略类");
+	}
+}

+ 5 - 35
src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractQueryRelationObject.java

@@ -5,10 +5,7 @@ import java.util.List;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 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;
 import com.persagy.proxy.adm.constant.ObjTypeMapping;
@@ -19,20 +16,19 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 
 /**
+ * 报表数据抽象类
  * 
  * @version 1.0.0
  * @company persagy 
  * @author zhangqiankun
  * @date 2021年9月2日 下午11:00:26
  */
-public abstract class AbstractQueryRelationObject implements QueryRelationObjectStrategy {
+public abstract class AbstractReportRelationObject extends AbstractRelationObject {
 
-	protected IRelationReportService relationReportService;
-	
-	public AbstractQueryRelationObject(IRelationReportService reportDownloadService) {
-		this.relationReportService = reportDownloadService;
+	public AbstractReportRelationObject(IRelationReportService reportDownloadService) {
+		super(reportDownloadService);
 	}
-	
+
 	/**
 	 * 根据项目ID,查询出所有的对象信息
 	 * 
@@ -51,25 +47,6 @@ public abstract class AbstractQueryRelationObject implements QueryRelationObject
 	}
 	
 	/**
-	 * 分页查询
-	 * 
-	 * @param masterObjs
-	 * @param requestData
-	 * @param groupCode
-	 * @param projectId
-	 * @param page
-	 */
-	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(objectDigitals);
-		this.queryPageObjectInfo(tempList, requestData, groupCode, projectId, ++page);
-	}
-	
-	/**
 	 * 处理中台响应数据,转换为ADM所需要的数据
 	 * 
 	 * @param masterObjs
@@ -153,13 +130,6 @@ public abstract class AbstractQueryRelationObject implements QueryRelationObject
 		return relationObject;
 	}
 	
-	
-	@Override
-	public boolean saveRelationObjects(List<ObjectNode> relationObjects, String groupCode, String projectId) {
-		List<ObjectRelation> create = DigitalRelationFacade.create(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, relationObjects);
-		return 	CollectionUtil.isEmpty(create) ? false : true;
-	}
-	
 	/**
 	 * 检查关系对象数据的正确性,并完成额外字段的赋值功能
 	 * 

+ 45 - 0
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Bd2FlSubRelationObject.java

@@ -0,0 +1,45 @@
+package com.persagy.proxy.adm.strategy.relationdata;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
+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.GraphCodeEnum;
+import com.persagy.proxy.adm.constant.RelCodeEnum;
+import com.persagy.proxy.adm.service.IRelationReportService;
+
+/**
+ * 
+ * @version 1.0.0
+ * @company persagy 
+ * @author zhangqiankun
+ * @date 2021年9月9日 下午5:28:21
+ */
+@Component(value = AdmRelationType.BD2FL_ARCHSUBSET)
+public class Bd2FlSubRelationObject extends AbstractRelationObject {
+
+	public Bd2FlSubRelationObject(IRelationReportService reportDownloadService) {
+		super(reportDownloadService);
+	}
+
+	@Override
+	public long countRelationObjects(String groupCode, String projectId) {
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
+		objectNode.put("graphCode", GraphCodeEnum.ArchSubset.name());
+		objectNode.put("relCode", RelCodeEnum.Bd2Fl.name());
+		queryCriteria.setCriteria(objectNode);
+		queryCriteria.setOnlyCount(true);
+		
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
+	}
+
+}

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2BD_FOR)
-public class Eq2BdForRelationObject extends AbstractQueryRelationObject {
+public class Eq2BdForRelationObject extends AbstractReportRelationObject {
 
 	public Eq2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2BD_FOR.getGraphCode());
@@ -43,8 +43,8 @@ public class Eq2BdForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2BdRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,8 +18,6 @@ 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
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2BD)
-public class Eq2BdRelationObject extends AbstractQueryRelationObject {
+public class Eq2BdRelationObject extends AbstractReportRelationObject {
 
 	public Eq2BdRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2BD.getGraphCode());
@@ -42,8 +41,8 @@ public class Eq2BdRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqBackupRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_2)
-public class Eq2EqEqBackupRelationObject extends AbstractQueryRelationObject {
+public class Eq2EqEqBackupRelationObject extends AbstractReportRelationObject {
 	
 	public Eq2EqEqBackupRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_2.getGraphCode());
@@ -41,16 +40,11 @@ public class Eq2EqEqBackupRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqEqNormalRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_1)
-public class Eq2EqEqNormalRelationObject extends AbstractQueryRelationObject {
+public class Eq2EqEqNormalRelationObject extends AbstractReportRelationObject {
 	
 	public Eq2EqEqNormalRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_1.getGraphCode());
@@ -41,16 +40,11 @@ public class Eq2EqEqNormalRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyBackupRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_4)
-public class Eq2EqSyBackupRelationObject extends AbstractQueryRelationObject {
+public class Eq2EqSyBackupRelationObject extends AbstractReportRelationObject {
 	
 	public Eq2EqSyBackupRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_4.getGraphCode());
@@ -41,13 +40,8 @@ public class Eq2EqSyBackupRelationObject extends AbstractQueryRelationObject {
 		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("未实现的策略类");
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2EqSyNormalRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2EQ_EQUIPPOWER_3)
-public class Eq2EqSyNormalRelationObject extends AbstractQueryRelationObject {
+public class Eq2EqSyNormalRelationObject extends AbstractReportRelationObject {
 	
 	public Eq2EqSyNormalRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_EQUIPPOWER_3.getGraphCode());
@@ -41,13 +40,8 @@ public class Eq2EqSyNormalRelationObject extends AbstractQueryRelationObject {
 		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("未实现的策略类");
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2FL_FOR)
-public class Eq2FlForRelationObject extends AbstractQueryRelationObject {
+public class Eq2FlForRelationObject extends AbstractReportRelationObject {
 
 	public Eq2FlForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2FL_FOR.getGraphCode());
@@ -43,8 +43,8 @@ public class Eq2FlForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2FlRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2FL)
-public class Eq2FlRelationObject extends AbstractQueryRelationObject {
+public class Eq2FlRelationObject extends AbstractReportRelationObject {
 
 	public Eq2FlRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2FL.getGraphCode());
@@ -41,8 +40,8 @@ public class Eq2FlRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2SH_FOR)
-public class Eq2ShForRelationObject extends AbstractQueryRelationObject {
+public class Eq2ShForRelationObject extends AbstractReportRelationObject {
 
 	public Eq2ShForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SH_FOR.getGraphCode());
@@ -43,8 +43,8 @@ public class Eq2ShForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Eq2SpRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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 进行数据查询
  * 
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2SP)
-public class Eq2SpRelationObject extends AbstractQueryRelationObject {
+public class Eq2SpRelationObject extends AbstractReportRelationObject {
 
 	public Eq2SpRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SP_IN.getGraphCode());
@@ -42,8 +41,8 @@ public class Eq2SpRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 26 - 3
src/main/java/com/persagy/proxy/adm/strategy/relationdata/QueryRelationObjectStrategy.java

@@ -6,7 +6,9 @@ import java.util.Map;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.common.helper.SpringHelper;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 
 /**
@@ -16,7 +18,7 @@ import com.persagy.proxy.adm.model.AdmRelationObject;
  * @author zhangqiankun
  * @date 2021年9月2日 下午10:46:03
  */
-public interface QueryRelationObjectStrategy {
+public interface RelationObjectStrategy {
 
 	String WHERE_IN = "$in";
 	
@@ -42,7 +44,7 @@ public interface QueryRelationObjectStrategy {
 	 * @param projectId
 	 * @return
 	 */
-	int countRelationObjects(String groupCode, String projectId);
+    long countRelationObjects(String groupCode, String projectId);
     
 	/**
 	 * 查询出所有的关系信息
@@ -54,6 +56,17 @@ public interface QueryRelationObjectStrategy {
 	List<AdmRelationObject> findRelationObject(String groupCode, String projectId);
 	
 	/**
+	 * 分页查询关系对象数据
+	 * 
+	 * @param masterObjs 查询的数据集存储地方
+	 * @param requestData 请求参数
+	 * @param groupCode 集团编码
+	 * @param projectId 项目ID
+	 * @param page 分页起始位置
+	 */
+	void queryPageObjectInfo(List<ObjectDigital> masterObjs, RequestData requestData, String groupCode, String projectId, Long page);
+	
+	/**
 	 * 保存之前校验数据的合法性
 	 * 
 	 * @param relationObject 需要校验的对象
@@ -65,9 +78,19 @@ public interface QueryRelationObjectStrategy {
 	Object beforeSaveRelationObject(AdmRelationObject relationObject, String groupCode, String projectId, String code);
 
 	/**
+	 * 保存对象之间的关系
+	 * 
+	 * @param relationObject
+	 * @param groupCode
+	 * @param projectId
+	 * @return 
+	 */
+	boolean saveRelationObject(ObjectNode relationObject, String groupCode, String projectId);
+	
+	/**
 	 * 批量保存对象之间的关系
 	 * 
-	 * @param admRelationObject
+	 * @param relationObjects
 	 * @param groupCode
 	 * @param projectId
 	 * @return 

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2BdForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SH2BD_ARCHFORARCH)
-public class Sh2BdForRelationObject extends AbstractQueryRelationObject {
+public class Sh2BdForRelationObject extends AbstractReportRelationObject {
 
 	public Sh2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SH2BD_ARCHFORARCH.getGraphCode());
@@ -41,8 +40,8 @@ public class Sh2BdForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2FlForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,8 +18,6 @@ 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
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SH2FL_ARCHFORARCH)
-public class Sh2FlForRelationObject extends AbstractQueryRelationObject {
+public class Sh2FlForRelationObject extends AbstractReportRelationObject {
 
 	public Sh2FlForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SH2FL_ARCHFORARCH.getGraphCode());
@@ -42,8 +41,8 @@ public class Sh2FlForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sh2ShForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SH2SH_ARCHFORARCH)
-public class Sh2ShForRelationObject extends AbstractQueryRelationObject {
+public class Sh2ShForRelationObject extends AbstractReportRelationObject {
 
 	public Sh2ShForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SH2SH_ARCHFORARCH.getGraphCode());
@@ -41,8 +40,8 @@ public class Sh2ShForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SH2SP_ARCHFORARCH)
-public class Sh2SpForRelationObject extends AbstractQueryRelationObject {
+public class Sh2SpForRelationObject extends AbstractReportRelationObject {
 
 	public Sh2SpForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SH2SP_ARCHFORARCH.getGraphCode());
@@ -43,8 +43,8 @@ public class Sh2SpForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2BD_ARCHFORARCH)
-public class Sp2BdForRelationObject extends AbstractQueryRelationObject {
+public class Sp2BdForRelationObject extends AbstractReportRelationObject {
 
 	public Sp2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2BD_ARCHFORARCH.getGraphCode());
@@ -43,8 +43,8 @@ public class Sp2BdForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2FL_ARCHFORARCH)
-public class Sp2FlForRelationObject extends AbstractQueryRelationObject {
+public class Sp2FlForRelationObject extends AbstractReportRelationObject {
 
 	public Sp2FlForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2FL_ARCHFORARCH.getGraphCode());
@@ -43,8 +43,8 @@ public class Sp2FlForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpConnectRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_RADIATIONNETWORK_2)
-public class Sp2SpConnectRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpConnectRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpConnectRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_2.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpConnectRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFCloseRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_3)
-public class Sp2SpFFCloseRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpFFCloseRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpFFCloseRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_3.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpFFCloseRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpFFOpenRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_2)
-public class Sp2SpFFOpenRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpFFOpenRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpFFOpenRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_2.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpFFOpenRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpMixMechRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_2)
-public class Sp2SpMixMechRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpMixMechRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpMixMechRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_2.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpMixMechRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNaturalRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_1)
-public class Sp2SpNaturalRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpNaturalRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpNaturalRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpNaturalRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpNormalRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_TRAFFICNETWORK_1)
-public class Sp2SpNormalRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpNormalRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpNormalRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1.getGraphCode());
@@ -41,13 +40,8 @@ public class Sp2SpNormalRelationObject extends AbstractQueryRelationObject {
 		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("未实现的策略类");
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 11
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpOnewayMechRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_CONVECTIONNETWORK_3)
-public class Sp2SpOnewayMechRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpOnewayMechRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpOnewayMechRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_3.getGraphCode());
@@ -41,16 +40,11 @@ public class Sp2SpOnewayMechRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override
-	public List<AdmRelationObject> findRelationObject(String groupCode, String projectId) {
-		throw new UnsupportedOperationException("未实现的策略类");
-	}
-
-	@Override
 	protected AdmRelationObject handleObjectDigital(ObjectDigital master, ObjectDigital slave, String groupCode, String projectId) {
 		throw new UnsupportedOperationException("未实现的策略类");
 	}

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sp2SpTransparentRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SP2SP_RADIATIONNETWORK_1)
-public class Sp2SpTransparentRelationObject extends AbstractQueryRelationObject {
+public class Sp2SpTransparentRelationObject extends AbstractReportRelationObject {
 	
 	public Sp2SpTransparentRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1.getGraphCode());
@@ -41,8 +40,8 @@ public class Sp2SpTransparentRelationObject extends AbstractQueryRelationObject
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2EqShipRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
  * 
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2EQ_SENSORRELATIONSHIP_SS2EQ)
-public class Ss2EqShipRelationObject extends AbstractQueryRelationObject {
+public class Ss2EqShipRelationObject extends AbstractReportRelationObject {
 	
 	public Ss2EqShipRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2EQ_SENSORRELATIONSHIP_SS2EQ.getGraphCode());
@@ -42,8 +41,8 @@ public class Ss2EqShipRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SpShipRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
  * 
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2SP_SENSORRELATIONSHIP_SS2SP)
-public class Ss2SpShipRelationObject extends AbstractQueryRelationObject {
+public class Ss2SpShipRelationObject extends AbstractReportRelationObject {
 	
 	public Ss2SpShipRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP.getGraphCode());
@@ -42,8 +41,8 @@ public class Ss2SpShipRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Ss2SyShipRelationObject.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
  * 
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.EQ2SY_SENSORRELATIONSHIP_SS2SY)
-public class Ss2SyShipRelationObject extends AbstractQueryRelationObject {
+public class Ss2SyShipRelationObject extends AbstractReportRelationObject {
 	
 	public Ss2SyShipRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.EQ2SY_SENSORRELATIONSHIP_SS2SY.getGraphCode());
@@ -42,8 +41,8 @@ public class Ss2SyShipRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2BdForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SY2BD_FOR)
-public class Sy2BdForRelationObject extends AbstractQueryRelationObject {
+public class Sy2BdForRelationObject extends AbstractReportRelationObject {
 
 	public Sy2BdForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SY2BD_FOR.getGraphCode());
@@ -41,8 +40,8 @@ public class Sy2BdForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2FlForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,8 +18,6 @@ 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
@@ -27,14 +26,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SY2FL_FOR)
-public class Sy2FlForRelationObject extends AbstractQueryRelationObject {
+public class Sy2FlForRelationObject extends AbstractReportRelationObject {
 
 	public Sy2FlForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SY2FL_FOR.getGraphCode());
@@ -42,8 +41,8 @@ public class Sy2FlForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override

+ 5 - 6
src/main/java/com/persagy/proxy/adm/strategy/relationdata/Sy2ShForRelationObject.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -16,8 +17,6 @@ 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
@@ -26,14 +25,14 @@ import cn.hutool.core.collection.CollectionUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SY2SH_FOR)
-public class Sy2ShForRelationObject extends AbstractQueryRelationObject {
+public class Sy2ShForRelationObject extends AbstractReportRelationObject {
 
 	public Sy2ShForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 	
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SY2SH_FOR.getGraphCode());
@@ -41,8 +40,8 @@ public class Sy2ShForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 
 	@Override

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

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
 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.model.response.CommonResult;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
@@ -17,7 +18,6 @@ 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;
 
 /**
@@ -28,14 +28,14 @@ import cn.hutool.core.util.StrUtil;
  * @date 2021年9月3日 上午9:42:46
  */
 @Component(value = AdmRelationType.SY2SP_FOR)
-public class Sy2SpForRelationObject extends AbstractQueryRelationObject {
+public class Sy2SpForRelationObject extends AbstractReportRelationObject {
 
 	public Sy2SpForRelationObject(IRelationReportService relationReportService) {
 		super(relationReportService);
 	}
 
 	@Override
-	public int countRelationObjects(String groupCode, String projectId) {
+	public long countRelationObjects(String groupCode, String projectId) {
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode objectNode = OBJECT_MAPPER.createObjectNode();
 		objectNode.put("graphCode", AdmRelationTypeEnum.SY2SP_FOR.getGraphCode());
@@ -43,8 +43,8 @@ public class Sy2SpForRelationObject extends AbstractQueryRelationObject {
 		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();
+		CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
 	}
 	
 	@Override