Преглед на файлове

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

lijie преди 3 години
родител
ревизия
6ccb71c629

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

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.dto.RequestData;
+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.ObjectDigital;
@@ -32,13 +33,22 @@ public abstract class AbstractRelationObject implements RelationObjectStrategy {
 	
 	@Override
 	public void queryPageRelations(List<ObjectDigital> allDigitals, RequestData requestData, String groupCode, String projectId) {
-		List<ObjectDigital> objectDigitals = DigitalObjectFacade.queryObjectListByGraphCodeAndRelCode(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, requestData);
-		if (CollectionUtil.isEmpty(objectDigitals)) {
+		CommonResult<List<ObjectDigital>> queryPrototype = DigitalObjectFacade.queryObjectListByGraphCodeAndRelCodePrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, requestData);
+		Long count = queryPrototype.getCount();
+		List<ObjectDigital> infos = queryPrototype.getData();
+		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
-		allDigitals.addAll(objectDigitals);
-		requestData.setPage((requestData.getPage() + 1));
-		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
+		
+		allDigitals.addAll(infos);
+		if (count < 500) {
+			return;
+		} else if ((infos.size()*requestData.getPage()) > count) {
+			return;
+		} else {
+			requestData.setPage((requestData.getPage() + 1));
+			this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
+		}
 	}
 	
 	@Override

+ 29 - 1
src/main/java/com/persagy/proxy/object/controller/AdmEquipmentController.java

@@ -6,22 +6,26 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.Sets;
+import com.persagy.dmp.basic.dto.RequestData;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.context.AppContext;
 import com.persagy.dmp.common.exception.BusinessException;
 import com.persagy.dmp.common.helper.SpringHelper;
 import com.persagy.dmp.common.model.entity.BaseEntity;
+import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.define.client.DigitalDefineFacade;
 import com.persagy.dmp.define.entity.ObjectInfoDefine;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
+import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
@@ -237,7 +241,31 @@ public class AdmEquipmentController {
 	public AdmResponse query(@RequestBody AdmQueryCriteria request) throws Exception {
 		// 组装上下文条件
 		request.setName(AdmEquipment.OBJ_TYPE);
-		return service.query(request);
+		if(CollUtil.isEmpty(request.getCascade()) && CollUtil.isNotEmpty(request.getProjection()) && request.getDistinct() && request.getProjection().size() == 1 && request.getProjection().get(0).equals("classCode")) {
+			/** 特殊处理
+			 * distinct: true
+			 * pageNumber: 1
+			 * pageSize: 1000
+			 * projection: ["classCode"]
+			 * 0: "classCode"
+			 */
+			RequestData requestData = new RequestData();
+			requestData.setProjection(request.getProjection());
+			requestData.setObjType(AdmEquipment.OBJ_TYPE);
+			requestData.setPage(request.getPageNumber().longValue());
+			requestData.setSize(request.getPageSize().longValue());
+			CommonResult<List<ObjectNode>> result = DigitalObjectSimpleFacade.queryObjListByConditions(AdmContextUtil.toDmpContext().getGroupCode(), AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, requestData);
+			if (result == null || CollUtil.isEmpty(result.getData())) {
+				return AdmResponse.success();
+			}else{
+				List<AdmEquipment> admEquipments = JSONUtil.toList(result.getData().toString(), AdmEquipment.class);
+				service.ensureSpecialValues(AdmContextUtil.toDmpContext(), admEquipments);
+				return AdmResponse.success(admEquipments);
+			}
+		}else{
+			return service.query(request);
+		}
+
 	}
 
 	/**

+ 0 - 1
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -183,7 +183,6 @@ public class AdmSpaceController {
                     relationDTOList.add(relationFl);
                 }
             });
-
             if (CollUtil.isNotEmpty(relationDTOList)) {
                 relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOList);
             }

+ 2 - 3
src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -218,14 +218,13 @@ public class AdmSystemController {
     @PostMapping("/query")
     public AdmResponse query(@RequestBody AdmQueryCriteria request) {
         request.setName(AdmSystem.OBJ_TYPE);
-
-        if(CollUtil.isNotEmpty(request.getProjection()) && request.getDistinct() && !request.getProjection().contains(BaseEntity.PROP_ID)){
+        if(CollUtil.isEmpty(request.getCascade()) && CollUtil.isNotEmpty(request.getProjection()) && request.getDistinct() && !request.getProjection().contains(BaseEntity.PROP_ID)){
             RequestData requestData = new RequestData();
             requestData.setProjection(request.getProjection());
             requestData.setObjType(AdmSystem.OBJ_TYPE);
             requestData.setPage(request.getPageNumber().longValue());
             requestData.setSize(request.getPageSize().longValue());
-            CommonResult<List<ObjectNode>> result = DigitalObjectSimpleFacade.querySystemListByConditions(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, requestData);
+            CommonResult<List<ObjectNode>> result = DigitalObjectSimpleFacade.queryObjListByConditions(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, requestData);
             if(result == null || CollUtil.isEmpty(result.getData())){
                 return AdmResponse.success();
             }

+ 1 - 1
src/main/java/com/persagy/proxy/object/model/AdmSpace.java

@@ -44,7 +44,7 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     /** 图片 - 信息点里已存在的信息点不应在实体中重复定义为其他格式 */
     private ArrayNode pic;
     /** 空间是否受影响 */
-    private String state;
+    private Integer state;
     /** 空间常驻人数 */
     private Integer permanentPeopleNum;
 

+ 86 - 81
src/main/java/com/persagy/proxy/report/controller/AdmReportEquipController.java

@@ -43,13 +43,12 @@ import org.springframework.web.bind.annotation.*;
 import javax.ws.rs.QueryParam;
 import java.lang.reflect.Field;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
-*  设备报表API
-* @author lvxy
-* @date 2021/9/18
-*/
+ *  设备报表API
+ * @author lvxy
+ * @date 2021/9/18
+ */
 @RestController
 @RequestMapping("/equip-query")
 public class AdmReportEquipController {
@@ -171,7 +170,7 @@ public class AdmReportEquipController {
      */
     @GetMapping("/equip-compon")
     public AdmResponse getEquipCompon(@QueryParam("id") String id, @QueryParam("category") String category){
-        //return  rEquipComponService.getEquipCompon(id,category)        
+        //return  rEquipComponService.getEquipCompon(id,category)
         RequestData requestData = new RequestData();
         if(StrUtil.isNotEmpty(id)){
             requestData.setEquipmentId(id);
@@ -284,7 +283,7 @@ public class AdmReportEquipController {
             request.setName(AdmComponent.OBJ_TYPE);
             return pageQuery(request);
         }
-       return null;
+        return null;
     }
 
     /**
@@ -435,7 +434,7 @@ public class AdmReportEquipController {
         if(JSONUtil.isNull(equipUpDateEnclosureRequest)){
             return AdmResponse.failure(ResponseCode.A0400.getDesc()+",不能为空");
         }
-        
+
         List<EquipUpDateEnclosure> equipUpDateEnclosure = JSONUtil.toList(equipUpDateEnclosureRequest.get("content").toString(), EquipUpDateEnclosure.class);
         if(CollUtil.isNotEmpty(equipUpDateEnclosure)){
             Map<String, EquipUpDateEnclosure> equipUpDateEnclosureMap = CollUtil.fieldValueMap(equipUpDateEnclosure, BaseEntity.PROP_ID);
@@ -491,30 +490,39 @@ public class AdmReportEquipController {
         ObjectNode criteriaEquip = JsonNodeFactory.instance.objectNode();
         criteriaEquip.put("objType", AdmEquipment.OBJ_TYPE);
         criteriaEquip.put("taskState",-1);
-        ArrayNode array = criteriaEquip.putObject("modelId").putArray("$in");
-        equipComDelList.stream().forEach(nodeObj -> {
-            if(StrUtil.isNotEmpty(nodeObj.get("modelId").textValue())) {
-                array.add(nodeObj.get("modelId").textValue());
+        ArrayNode idList = criteriaEquip.putObject("modelId").putArray("$in");
+        // 组装结果Map 并 设置modelId数组
+        Map<String, ObjectNode> equipDelMap = new HashMap<>(equipComDelList.size());
+        for (ObjectNode equipComDel : equipComDelList) {
+            // 取id
+            JsonNode idNode = equipComDel.get("modelId");
+            if(idNode == null || !idNode.isTextual()) {
+                continue;
             }
-        });
+            // 设置默认count
+            JsonNode countNode = equipComDel.get("count");
+            if(countNode == null || !countNode.isIntegralNumber()) {
+                // 没有count,则设置为0
+                equipComDel.put("count", 0);
+            }
+            idList.add(idNode.textValue());
+            equipDelMap.put(idNode.textValue(), equipComDel);
+        }
         queryCriteriaEuip.setCriteria(criteriaEquip);
         List<ObjectNode> equipList = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(),AdmCommonConstant.APP_ID,null, queryCriteriaEuip);
         if(CollUtil.isEmpty(equipList)){
             return AdmResponse.success(equipComDelList);
         }
-        Map<String, ObjectNode> equipDelMap = new HashMap<>(equipComDelList.size());
-        for (ObjectNode equipComDel : equipComDelList) {
-            String modelIdObj = equipComDel.get("modelId").toString();
-            equipDelMap.put(modelIdObj, equipComDel);
-        }
-        equipList.stream().forEach(euip -> {
-            String modelIdEq = euip.get("modelId").textValue();
-            if(equipDelMap.containsKey(modelIdEq)){
-                Integer count = Integer.parseInt(equipDelMap.get(modelIdEq).get("count").textValue()) + 1;
-                equipDelMap.get(modelIdEq).put("count", count);
+        // 按查询到的设备计数
+        equipList.stream().forEach(eq -> {
+            String modelId = eq.get("modelId").textValue();
+            if(equipDelMap.containsKey(modelId)){
+                ObjectNode delCounter = equipDelMap.get(modelId);
+                int count = delCounter.get("count").intValue() + 1;
+                delCounter.put("count", count);
             }
         });
-        return AdmResponse.success(equipDelMap.values().stream().collect(Collectors.toList()));
+        return AdmResponse.success(equipComDelList);
     }
 
 
@@ -527,8 +535,6 @@ public class AdmReportEquipController {
      */
     @PostMapping("/equip-supply")
     public AdmResponse equipPropertySupply(@RequestBody List<ObjectNode> equipComDelList){
-        //return EquipmentService.equipPropertySupplys(equipComDelList)
-        //
         if(CollUtil.isEmpty(equipComDelList)){
             return AdmResponse.success();
         }
@@ -536,14 +542,28 @@ public class AdmReportEquipController {
         QueryCriteria queryCriteria = new QueryCriteria();
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         criteria.put("objType", AdmFloor.OBJ_TYPE);
-        ArrayNode arrayNode = criteria.putObject("modelId").putArray("$in");
-        equipComDelList.stream().forEach(node -> {
-            arrayNode.add(node.get("modelId").textValue());
-        });
+        ArrayNode idList = criteria.putObject("modelId").putArray("$in");
+        // 组装结果Map 并 设置modelId数组
+        Map<String, ObjectNode> equipDelMap = new HashMap<>(equipComDelList.size());
+        for (ObjectNode equipComDel : equipComDelList) {
+            // 取id
+            JsonNode idNode = equipComDel.get("modelId");
+            if(idNode == null || !idNode.isTextual()) {
+                continue;
+            }
+            // 设置默认count
+            JsonNode countNode = equipComDel.get("count");
+            if(countNode == null || !countNode.isIntegralNumber()) {
+                // 没有count,则设置为0
+                equipComDel.put("count", 0);
+            }
+            idList.add(idNode.textValue());
+            equipDelMap.put(idNode.textValue(), equipComDel);
+        }
         queryCriteria.setCriteria(criteria);
         List<ObjectNode> floorList = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(),AdmCommonConstant.APP_ID,null,queryCriteria);
         if(CollUtil.isEmpty(floorList)){
-            return AdmResponse.success();
+            return AdmResponse.success(equipComDelList);
         }
         List<AdmFloor> admFloorList = JSONUtil.toList(floorList.toString(), AdmFloor.class);
         Map<String, AdmFloor> admFloorMap = CollUtil.fieldValueMap(admFloorList, BaseEntity.PROP_ID);
@@ -553,46 +573,33 @@ public class AdmReportEquipController {
         criteriaEquip.put("objType", AdmEquipment.OBJ_TYPE);
         ArrayNode array = criteriaEquip.putObject("floorId").putArray("$in");
         admFloorMap.keySet().stream().forEach(id -> array.add(id));
-
-        JSONObject bimId = new JSONObject();
-        bimId.put("$null", true);
-        criteria.putPOJO("bimId", bimId);
-
-        JSONObject bimLocation = new JSONObject();
-        bimId.put("$null", false);
-        criteriaEquip.putPOJO("bimLocation", bimLocation);
-
-        JSONObject modelId = new JSONObject();
-        modelId.put("$null", true);
-        criteriaEquip.putPOJO("modelId", modelId);
-
+        criteria.putObject("bimId").put("$null", true);
+        criteria.putObject("bimLocation").put("$null", false);
+        criteria.putObject("modelId").put("$null", true);
         queryCriteriaEuip.setCriteria(criteriaEquip);
         List<ObjectNode> equipList = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(),AdmCommonConstant.APP_ID,null, queryCriteriaEuip);
         if(CollUtil.isEmpty(equipList)){
             return AdmResponse.success(equipComDelList);
         }
+        // 按楼层统计设备数量
         equipList.stream().forEach(equip -> {
-            String floolId = equip.get("floorId").textValue();
-            if(admFloorMap.containsKey(floolId)){
-                Integer count = Integer.parseInt(admFloorMap.get(floolId).getCount()) + 1;
-                admFloorMap.get(floolId).setCount(count.toString());
+            String floorId = equip.get("floorId").textValue();
+            if(admFloorMap.containsKey(floorId)){
+                AdmFloor floor = admFloorMap.get(floorId);
+                Integer count = floor.getCount() == null ? 0 : Integer.parseInt(floor.getCount());
+                floor.setCount(String.valueOf(count+1));
             }
         });
-
         // 3 根据floorId,modelId 汇总
-        Map<String, ObjectNode> equipDelMap = new HashMap<>(equipComDelList.size());
-        for (ObjectNode equipComDel : equipComDelList) {
-           String modelIdObj = equipComDel.get("modelId").toString();
-           equipDelMap.put(modelIdObj, equipComDel);
-        }
         admFloorMap.values().stream().forEach(floor -> {
-            String modelIdFl = floor.getModelId();
-            if(equipDelMap.containsKey(modelIdFl)){
-                Integer count = Integer.parseInt(equipDelMap.get(modelIdFl).get("count").textValue()) + Integer.parseInt(floor.getCount());
-                equipDelMap.get(modelIdFl).put("count", count);
+            String modelId = floor.getModelId();
+            if(equipDelMap.containsKey(modelId)){
+                ObjectNode delCounter = equipDelMap.get(modelId);
+                int count = delCounter.get("count").intValue() + Integer.parseInt(floor.getCount());
+                delCounter.put("count", count);
             }
         });
-        return AdmResponse.success(equipDelMap.values().stream().collect(Collectors.toList()));
+        return AdmResponse.success(equipComDelList);
     }
 
     /**
@@ -624,7 +631,7 @@ public class AdmReportEquipController {
      */
     @PostMapping("/property-equip-supp")
     public AdmResponse propertyEquip(@RequestBody AdmQueryCriteria request){
-        
+
         //return EquipmentService.equipPropertySupp(sQueryRequest)
         //equipment.bim_id IS NULL
         //  AND equipment.model_id IS NULL
@@ -669,23 +676,23 @@ public class AdmReportEquipController {
             filter =  filter + ";id in "+arrayNode.toString();
             request.setFilters(filter);
 
-           AdmResponse admResponse = equipmentService.query(request);
-           if(CollUtil.isNotEmpty(admResponse.getContent())){
-               //处理数据
-               List<ObjectNode> objectNodeList = (List<ObjectNode>) admResponse.getContent();
-               objectNodeList.stream().forEach(equip ->{
-                   JsonNode building = equip.get("building");
-                   JsonNode floor = equip.get("floor");
-                   if(!JSONUtil.isNull(building)){
-                       equip.put("buildingName", building.get("localName").textValue());
-                   }
-                   if(!JSONUtil.isNull(floor)){
-                       equip.put("floorName", floor.get("localName").textValue());
-                       equip.put("modelId", floor.get("modelId").textValue());
-                   }
-               });
-           }
-           return admResponse;
+            AdmResponse admResponse = equipmentService.query(request);
+            if(CollUtil.isNotEmpty(admResponse.getContent())){
+                //处理数据
+                List<ObjectNode> objectNodeList = (List<ObjectNode>) admResponse.getContent();
+                objectNodeList.stream().forEach(equip ->{
+                    JsonNode building = equip.get("building");
+                    JsonNode floor = equip.get("floor");
+                    if(!JSONUtil.isNull(building)){
+                        equip.put("buildingName", building.get("localName").textValue());
+                    }
+                    if(!JSONUtil.isNull(floor)){
+                        equip.put("floorName", floor.get("localName").textValue());
+                        equip.put("modelId", floor.get("modelId").textValue());
+                    }
+                });
+            }
+            return admResponse;
         }else{
             return AdmResponse.success();
         }
@@ -814,7 +821,7 @@ public class AdmReportEquipController {
         AdmGatherInfoPoint gatherInfoPoint = new AdmGatherInfoPoint();
 
         Integer controlInfoCounts = controlInfoCounts(AdmEquipment.OBJ_TYPE);
-       // 根据objType获取定义 获取采集的设备的classcode
+        // 根据objType获取定义 获取采集的设备的classcode
         Set<String> objTypes = new HashSet<>(1);
         objTypes.add(AdmEquipment.OBJ_TYPE);
         List<Map<String, Object>> codes = DigitalObjectSimpleFacade.queryDefineInfoByObjType(AdmContextUtil.toDmpContext().getGroupCode(), AdmContextUtil.toDmpContext().getProjectId(), AdmCommonConstant.APP_ID,null, RequestData.builder().objTypes(objTypes).build());
@@ -935,7 +942,7 @@ public class AdmReportEquipController {
         queryCriteria.setOnlyCount(true);
         List<ObjectNode> euipCom = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(),AdmCommonConstant.APP_ID,null, queryCriteria);
         if(CollUtil.isNotEmpty(euipCom)){
-           return AdmResponse.success(euipCom);
+            return AdmResponse.success(euipCom);
         }else{
             return AdmResponse.success();
         }
@@ -1165,6 +1172,4 @@ public class AdmReportEquipController {
             infos.put(attribute, upTarget);
         }
     }
-
-
 }

+ 35 - 15
src/main/java/com/persagy/proxy/report/service/impl/RelationReportService.java

@@ -216,7 +216,7 @@ public class RelationReportService implements IRelationReportService {
 		ObjectNode objectNode = this.getRelationProjectCal(groupCode, projectId, relationTypeEnum.getGraphCode(),
 				relationTypeEnum.getRelCode(), null);
 		Map<String, AdmRelationTypeEnum> graphRelTypeMap = AdmCommonConstant.GRAPH_RELATION_TYPE_MAP;
-		Map<String, RelationDefine> relationDefineMap = queryAllRelationDefineMap(groupCode, projectId);
+		Map<String, RelationDefine> relationDefineMap = this.queryAllRelationDefineMap(groupCode, projectId);
 		if (objectNode != null) {
 			return this.fillRelationProjectCal(objectNode, relationTypeEnum.getGraphCode(), relationTypeEnum.getRelCode(), graphRelTypeMap, relationDefineMap, groupCode, projectId);
 		}
@@ -803,13 +803,13 @@ public class RelationReportService implements IRelationReportService {
 		CommonResult<List<ObjectTypeDefine>> queryPrototype = DigitalDefineFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, classCriteria);
 		Long count = queryPrototype.getCount();
 		List<ObjectTypeDefine> infos = queryPrototype.getData();
-		if (CollectionUtil.isEmpty(infos)) {
+		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
 		
 		all.addAll(infos);
 		
-		if (count == null || count < 500) {
+		if (count < 500) {
 			return;
 		} else if ((infos.size()*classCriteria.getPage()) > count) {
 			return;
@@ -828,13 +828,23 @@ public class RelationReportService implements IRelationReportService {
 	 * @param projectId
 	 */
 	private void queryPageObjects(List<ObjectNode> all, QueryCriteria objectCriteria, String groupCode, String projectId) {
-		List<ObjectNode> objectNodes = DigitalObjectFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, objectCriteria);
-		if (CollectionUtil.isEmpty(objectNodes)) {
+		CommonResult<List<ObjectNode>> queryPrototype = DigitalObjectFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, objectCriteria);
+		Long count = queryPrototype.getCount();
+		List<ObjectNode> infos = queryPrototype.getData();
+		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
-		all.addAll(objectNodes);
-		objectCriteria.setPage((objectCriteria.getPage() + 1));
-		this.queryPageObjects(all, objectCriteria, groupCode, projectId);
+		
+		all.addAll(infos);
+		
+		if (count < 500) {
+			return;
+		} else if ((infos.size()*objectCriteria.getPage()) > count) {
+			return;
+		} else {
+			objectCriteria.setPage((objectCriteria.getPage() + 1));
+			this.queryPageObjects(all, objectCriteria, groupCode, projectId);
+		}
 	}
 
 	/**
@@ -846,13 +856,23 @@ public class RelationReportService implements IRelationReportService {
 	 * @param projectId
 	 */
 	private void queryPageRelations(List<ObjectRelation> all, QueryCriteria queryCriteria, String groupCode, String projectId) {
-		List<ObjectRelation> objectRelations = DigitalRelationFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
-		if (CollectionUtil.isEmpty(objectRelations)) {
+		CommonResult<List<ObjectRelation>> queryPrototype = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		Long count = queryPrototype.getCount();
+		List<ObjectRelation> infos = queryPrototype.getData();
+		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
-		all.addAll(objectRelations);
-		queryCriteria.setPage((queryCriteria.getPage() + 1));
-		this.queryPageRelations(all, queryCriteria, groupCode, projectId);
+		
+		all.addAll(infos);
+		
+		if (count < 500) {
+			return;
+		} else if ((infos.size()*queryCriteria.getPage()) > count) {
+			return;
+		} else {
+			queryCriteria.setPage((queryCriteria.getPage() + 1));
+			this.queryPageRelations(all, queryCriteria, groupCode, projectId);
+		}
 	}
 	
 	/**
@@ -867,13 +887,13 @@ public class RelationReportService implements IRelationReportService {
 		CommonResult<List<ObjectInfoDefine>> queryPrototype = DigitalObjectInfoFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
 		Long count = queryPrototype.getCount();
 		List<ObjectInfoDefine> infos = queryPrototype.getData();
-		if (CollectionUtil.isEmpty(infos)) {
+		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
 		
 		all.addAll(infos);
 		
-		if (count == null || count < 500) {
+		if (count < 500) {
 			return;
 		} else if ((infos.size()*queryCriteria.getPage()) > count) {
 			return;