Parcourir la source

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/adm-middleware.git into develop

zhangqiankun il y a 3 ans
Parent
commit
9576f2708a
23 fichiers modifiés avec 342 ajouts et 78 suppressions
  1. 13 0
      src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmBaseServiceImpl.java
  2. 63 7
      src/main/java/com/persagy/proxy/dictionary/controller/AdmLabslController.java
  3. 12 7
      src/main/java/com/persagy/proxy/object/controller/AdmBuildingController.java
  4. 13 4
      src/main/java/com/persagy/proxy/object/controller/AdmEquipmentController.java
  5. 4 8
      src/main/java/com/persagy/proxy/object/controller/AdmFloorController.java
  6. 8 10
      src/main/java/com/persagy/proxy/object/controller/AdmShaftController.java
  7. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java
  8. 1 3
      src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java
  9. 13 1
      src/main/java/com/persagy/proxy/object/service/IAdmEquipmentService.java
  10. 9 0
      src/main/java/com/persagy/proxy/object/service/IAdmFloorService.java
  11. 10 0
      src/main/java/com/persagy/proxy/object/service/IAdmSpaceService.java
  12. 51 1
      src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java
  13. 61 6
      src/main/java/com/persagy/proxy/object/service/impl/AdmFloorServiceImpl.java
  14. 56 4
      src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java
  15. 1 1
      src/main/java/com/persagy/proxy/relation/controller/RelationFlAndBuController.java
  16. 0 1
      src/main/java/com/persagy/proxy/relation/controller/RelationShContainSpBaseController.java
  17. 4 6
      src/main/java/com/persagy/proxy/report/controller/AdmEquipFloorController.java
  18. 1 1
      src/main/java/com/persagy/proxy/report/controller/AdmEquipShaftController.java
  19. 6 6
      src/main/java/com/persagy/proxy/report/controller/AdmReportEquipController.java
  20. 3 3
      src/main/java/com/persagy/proxy/report/controller/AdmSpaceInfoController.java
  21. 1 1
      src/main/java/com/persagy/proxy/report/controller/ComponentBuildingController.java
  22. 1 1
      src/main/java/com/persagy/proxy/report/controller/ComponentStatisticsController.java
  23. 6 3
      src/main/java/com/persagy/proxy/report/service/impl/AdmLabslServiceImpl.java

+ 13 - 0
src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmBaseServiceImpl.java

@@ -57,6 +57,8 @@ public class AbstractAdmBaseServiceImpl<T> implements IAdmBaseService<T> {
     public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<T> clazz) {
         // 转换为数据中台查询条件
         QueryCriteria dmpRequest = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        // 提供一个钩子方法用于处理已封装好的中台查询参数(因传参有buildingId而处理)
+        processDmpCriteria(dmpRequest);
         // 转换参数
         JSONObject para = null;
         try {
@@ -84,6 +86,17 @@ public class AbstractAdmBaseServiceImpl<T> implements IAdmBaseService<T> {
         response.setPageSize(request.getPageSize());
         return response;
     }
+    /***
+     * Description: 提供一个钩子方法用于处理已封装好的中台查询参数(因传参有buildingId而处理)
+     * @param dmpRequest : 中台查询参数
+     * @return : void
+     * @author : lijie
+     * @date :2021/10/28 20:23
+     * Update By lijie 2021/10/28 20:23
+     */
+    protected void processDmpCriteria(QueryCriteria dmpRequest) {
+        // 空方法,需要时子类重写
+    }
 
     /**
      * 处理级联查询

+ 63 - 7
src/main/java/com/persagy/proxy/dictionary/controller/AdmLabslController.java

@@ -1,13 +1,18 @@
 package com.persagy.proxy.dictionary.controller;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.object.model.AdmEquipment;
 import com.persagy.proxy.object.model.AdmObjectInfo;
 import com.persagy.proxy.dictionary.model.AdmObjectType;
 import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.report.service.IAdmLabslService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -16,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.ws.rs.QueryParam;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -36,7 +42,10 @@ public class AdmLabslController {
     private IAdmLabslService service;
 
     @Value("${middleware.group.code}")
-    private String groupCode;
+    private String groupCode ="XG";
+
+    @Autowired
+    private IAdmEquipmentService iAdmEquipmentService;
 
     /**
      * 查询项目下的设备类型
@@ -46,6 +55,9 @@ public class AdmLabslController {
     @PostMapping("/category")
     public AdmResponse queryCategory() throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        if(StringUtils.isEmpty(context.getGroupCode())){
+            context.setGroupCode(groupCode);
+        }
         return service.queryCategory(context, AdmObjectInfo.class);
     }
 
@@ -58,6 +70,9 @@ public class AdmLabslController {
     @PostMapping("/zone/type")
     public AdmResponse queryZoneType() throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        if(StringUtils.isEmpty(context.getGroupCode())){
+            context.setGroupCode(groupCode);
+        }
         return service.queryZoneType(context, AdmObjectInfo.class);
     }
 
@@ -69,21 +84,59 @@ public class AdmLabslController {
     @PostMapping("/building/floor")
     public AdmResponse queryBuildFloor(@QueryParam("projectId") String projectId) throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        if(StringUtils.isEmpty(context.getGroupCode())){
+            context.setGroupCode(groupCode);
+        }
         return service.queryBuildFloor(context, AdmObjectInfo.class);
     }
 
 
+  /*  *//**
+     * 查询设备包含设备类型
+     * @return
+     * @throws Exception
+     *//*
+    @PostMapping("/query/equip")
+    public AdmResponse queryEquipType(@QueryParam("projectId") AdmQueryCriteria request) throws Exception {
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        return iAdmEquipmentService.doQuery(context, AdmObjectInfo.class);
+    }*/
+
+
     /**
      * 查询设备包含设备类型
      * @return
      * @throws Exception
      */
     @PostMapping("/query/equip")
-    public AdmResponse queryEquipType(@QueryParam("projectId") String projectId) throws Exception {
+    public AdmResponse queryEquipType(@RequestBody AdmQueryCriteria request) throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
-        return service.queryBuildFloor(context, AdmObjectInfo.class);
-    }
+        if(StringUtils.isEmpty(context.getGroupCode())){
+            context.setGroupCode(groupCode);
+        }
+        // 组装上下文条件
+        request.setName(AdmEquipment.OBJ_TYPE);
+        //过滤条件处理
+        String filters = request.getFilters();
 
+        StringBuilder newFilters = new StringBuilder();
+        if(StringUtils.isNotEmpty(filters)){
+            String[] filter = filters.split(";");
+            for(int i =0 ;i< filter.length;i++){
+                if(filter[i].contains("not")){
+                    String[] param = filter[i].split(" ");
+                    filter[i] = StrUtil.format("{} $notcontains {}",param[1],param[3]);
+                }
+                newFilters.append(filter[i]);
+                if(i != filter.length -1){
+                    newFilters.append(" ; ");
+                }
+            }
+            request.setFilters(newFilters.toString());
+        }
+
+        return iAdmEquipmentService.doQuery(context, request, AdmEquipment.class);
+    }
 
     /**
      * 根据设备id统计设备所属的专业
@@ -94,12 +147,15 @@ public class AdmLabslController {
     public AdmResponse queryMajorCategory(@QueryParam("projectId") String projectId,
                                           @RequestBody List<String> ids) throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        if(StringUtils.isEmpty(context.getGroupCode())){
+            context.setGroupCode(groupCode);
+        }
         if(CollUtil.isEmpty(ids)){
-            return AdmResponse.failure("项目下没有设备类型");
+            return AdmResponse.success(new ArrayList<>());
         }
-        List<String> newIds = ids.stream().filter(id->"fisnull".equals(id)).collect(Collectors.toList());
+        List<String> newIds = ids.stream().filter(id->!"fisnull".equals(id)).collect(Collectors.toList());
         if(CollUtil.isEmpty(newIds)){
-            return AdmResponse.failure("项目下没有设备类型");
+            return AdmResponse.success(new ArrayList<>());
         }
         return service.queryMajorCategory(context, newIds , AdmObjectType.class);
     }

+ 12 - 7
src/main/java/com/persagy/proxy/object/controller/AdmBuildingController.java

@@ -1,6 +1,7 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
@@ -54,6 +55,11 @@ public class AdmBuildingController {
             if (StrUtil.isEmpty(admBuilding.getName())){
                 admBuilding.setName(ObjectNameUtil.objectName("建筑-"));
             }
+            if(CollUtil.isNotEmpty(admBuilding.getInfos())){
+                if(admBuilding.getInfos().get("buildAge") != null){
+                    admBuilding.getInfos().put("buildAge", DateUtil.format(DateUtil.parseDate(admBuilding.getInfos().get("buildAge").toString()),"yyyy"));
+                }
+            }
         });
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmBuilding.class, vos);
         return AdmResponse.success(vos);
@@ -75,22 +81,22 @@ public class AdmBuildingController {
         String msg = "建筑下包含其他对象实例,请解除关系后删除";
         AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
         StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append("buildingId in [");
+        stringBuilder.append(" buildingId in [");
         admBuildingMap.keySet().stream().forEach(buildingId -> {
             stringBuilder.append("'").append(buildingId).append("'").append(",");
         });
 
         String filters = StrUtil.sub(stringBuilder.toString(),0, -1);
-        filters+= "]";
+        filters+= "] ";
 
         admQueryCriteria.setFilters(filters);
         admQueryCriteria.setName(AdmFloor.OBJ_TYPE);
-        AdmResponse admResponseF = floorService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmFloor.class);
+        AdmResponse admResponseF = floorService.query(admQueryCriteria);
         if(DmpResult.SUCCESS.equals(admResponseF.getResult()) && CollUtil.isNotEmpty(admResponseF.getContent())){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
-        AdmResponse admResponseSpace = spaceService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmSpace.class);
+        AdmResponse admResponseSpace = spaceService.query(admQueryCriteria);
         if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
@@ -101,7 +107,7 @@ public class AdmBuildingController {
         }
 
         admQueryCriteria.setName(AdmEquipment.OBJ_TYPE);
-        AdmResponse admResponseEuip = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmEquipment.class);
+        AdmResponse admResponseEuip = equipmentService.query(admQueryCriteria);
         if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
         }
@@ -117,8 +123,7 @@ public class AdmBuildingController {
      */
     @PostMapping("/single/delete")
     public AdmResponse deleteSingle(@RequestBody List<AdmBuilding> vos) throws Exception {
-        delete(vos);
-        return AdmResponse.success();
+        return delete(vos);
     }
 
     /**

+ 13 - 4
src/main/java/com/persagy/proxy/object/controller/AdmEquipmentController.java

@@ -84,7 +84,7 @@ public class AdmEquipmentController {
 	public AdmResponse count(@RequestBody AdmQueryCriteria request) throws Exception {
 		request.setName(AdmEquipment.OBJ_TYPE);
 		request.setOnlyCount(true);
-		return service.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+		return service.query(request);
 	}
 
 	/**
@@ -199,7 +199,7 @@ public class AdmEquipmentController {
 			if(CollUtil.isNotEmpty(relationDTOList)){
 				relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOList);
 			}
-
+			//处理设备更新特殊数据
             List<AdmEquipment> equipmentList = new ArrayList<>(vos.size());
             vos.stream().forEach(equipment -> {
                 if(CollUtil.isNotEmpty(equipment.getInfos())){
@@ -208,6 +208,15 @@ public class AdmEquipmentController {
                     admEquipment.setInfos(equipment.getInfos());
                     ObjectNode objectNode = JsonNodeUtils.toObjectNode(admEquipment, "infos", null);
                     AdmEquipment admEquipmentNew = JsonNodeUtils.toEntity(objectNode, AdmEquipment.class, "infos");
+                    if(CollUtil.isNotEmpty(equipment.getNullList())){
+                    	admEquipmentNew.setNullList(equipment.getNullList());
+					}
+                    if(StrUtil.isNotEmpty(equipment.getFloorId())){
+                    	admEquipmentNew.setFloorId(equipment.getFloorId());
+					}
+					if(StrUtil.isNotEmpty(equipment.getBuildingId())){
+						admEquipmentNew.setBuildingId(equipment.getBuildingId());
+					}
                     equipmentList.add(admEquipmentNew);
                 }
             });
@@ -228,7 +237,7 @@ public class AdmEquipmentController {
 	public AdmResponse query(@RequestBody AdmQueryCriteria request) throws Exception {
 		// 组装上下文条件
 		request.setName(AdmEquipment.OBJ_TYPE);
-		return service.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+		return service.query(request);
 	}
 
 	/**
@@ -260,7 +269,7 @@ public class AdmEquipmentController {
 		}else{
 			request.setFilters("objType in ['equipment','component']");
 		}
-		return service.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+		return service.query(request);
 	}
 
 	/**

+ 4 - 8
src/main/java/com/persagy/proxy/object/controller/AdmFloorController.java

@@ -135,7 +135,7 @@ public class AdmFloorController {
         admQueryCriteria.setOnlyCount(true);
 
         admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
-        AdmResponse admResponseSpace = spaceService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmSpace.class);
+        AdmResponse admResponseSpace = spaceService.query(admQueryCriteria);
         if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
@@ -145,7 +145,7 @@ public class AdmFloorController {
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName(AdmEquipment.OBJ_TYPE);
-        AdmResponse admResponseEuip = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmEquipment.class);
+        AdmResponse admResponseEuip = equipmentService.query(admQueryCriteria);
         if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
         }
@@ -188,7 +188,7 @@ public class AdmFloorController {
             filters+= "]";
             admQueryCriteria.setFilters(filters);
             admQueryCriteria.setName("floor");
-            AdmResponse admResponseF = service.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmFloor.class);
+            AdmResponse admResponseF = service.query(admQueryCriteria);
             if(DmpResult.SUCCESS.equals(admResponseF.getResult()) && admResponseF.getTotal() > 0 && CollUtil.isNotEmpty(admResponseF.getContent())){
                 List<AdmFloor> vosOld = (List<AdmFloor>) admResponseF.getContent();
                 for(AdmFloor admFloorOld : vosOld){
@@ -249,11 +249,7 @@ public class AdmFloorController {
     @PostMapping("/query")
     public AdmResponse query(@RequestBody AdmQueryCriteria request) throws Exception {
         request.setName(AdmFloor.OBJ_TYPE);
-        AdmResponse rs = service.doQuery(AdmContextUtil.toDmpContext(), request, AdmFloor.class);
-        List<AdmFloor> vos = (List<AdmFloor>) rs.getContent();
-        service.ensureSpecialValues(AdmContextUtil.toDmpContext(), vos, AdmFloorServiceImpl.QUERY);
-        rs.setContent(vos);
-        return rs;
+        return service.query(request);
     }
 
 

+ 8 - 10
src/main/java/com/persagy/proxy/object/controller/AdmShaftController.java

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
 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.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -20,15 +19,15 @@ import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmBuildingService;
 import com.persagy.proxy.adm.service.IAdmRelationService;
-import com.persagy.proxy.object.service.IAdmShaftService;
-import com.persagy.proxy.object.service.IAdmSpaceService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.RelationDTO;
 import com.persagy.proxy.object.model.*;
+import com.persagy.proxy.object.service.IAdmBuildingService;
+import com.persagy.proxy.object.service.IAdmShaftService;
+import com.persagy.proxy.object.service.IAdmSpaceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -53,8 +52,6 @@ public class AdmShaftController {
     private IAdmBuildingService buildingService;
     @Autowired
     private IAdmSpaceService spaceService;
-    @Autowired
-    private ObjectMapper objectMapper;
 
     /**
      * 统计
@@ -353,10 +350,11 @@ public class AdmShaftController {
 
             List<AdmSpace> vos = JSONUtil.toList(spaceList.toString(), AdmSpace.class);
             Map<String, AdmSpace> admSpaceMap = CollUtil.fieldValueMap(vos, "buildingId");
-            StringBuilder filter = new StringBuilder(" id in ['");
-            admSpaceMap.keySet().stream().forEach(spaceId -> filter.append(spaceId).append("','"));
-            String filters = StrUtil.sub(filter.toString(), 0,-2)+"]";
-            queryCriteriaBd.setFilters(filters);
+            ObjectNode relationFrom = JsonNodeFactory.instance.objectNode();
+            relationFrom.put("relCode", "Bd2Sp");
+            relationFrom.put("graphCode","ArchSubset");
+            ArrayNode arrayNode = relationFrom.putObject("objTo").putArray("$in");
+            admSpaceMap.keySet().stream().forEach(spaceId -> arrayNode.add(spaceId));
             AdmResponse response =  buildingService.doQuery(AdmContextUtil.toDmpContext(), queryCriteriaBd, AdmBuilding.class);
             return response;
         }else{

+ 5 - 4
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -60,9 +60,10 @@ public class AdmSpaceController {
      */
     @PostMapping("/count")
     public AdmResponse count(@RequestBody AdmQueryCriteria request) throws Exception {
-        request.setName("space");
+        request.setName(AdmSpace.OBJ_TYPE);
         request.setOnlyCount(true);
-        return service.doQuery( AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        //return service.doQuery( AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        return service.query(request);
     }
     /**
      * 创建
@@ -280,7 +281,7 @@ public class AdmSpaceController {
                     AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
                     admQueryCriteria.setName(AdmFloor.OBJ_TYPE);
                     admQueryCriteria.setFilters("id = '"+id+"'");
-                    AdmResponse admResponseFl = floorService.doQuery( AdmContextUtil.toDmpContext(), admQueryCriteria, AdmFloor.class);
+                    AdmResponse admResponseFl = floorService.query(admQueryCriteria);
                     if(CollUtil.isNotEmpty(admResponseFl.getContent())){
                         AdmFloor floor = (AdmFloor) admResponseFl.getContent().get(0);
                         if (floor!=null){
@@ -436,7 +437,7 @@ public class AdmSpaceController {
     @PostMapping("/import")
     public AdmResponse importExcel(@RequestBody AdmQueryCriteria request) throws Exception {
         request.setName(AdmSpace.OBJ_TYPE);
-        return service.doQuery( AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        return service.query(request);
     }
 
 

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

@@ -99,7 +99,6 @@ public class AdmSystemController {
         List<AdmSystem> vos = CollUtil.newArrayList(createRequest.getContent());
 
         Map<String, AdmSystem> admSystemMap = CollUtil.fieldValueMap(vos, "classCode");
-
         QueryCriteria defineCriteria = new QueryCriteria();
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         ArrayNode array = criteria.putObject("code").putArray("$in");
@@ -124,7 +123,6 @@ public class AdmSystemController {
                 List<AdmSystem> admSystems = service.doInsert(AdmContextUtil.toDmpContext(), AdmSystem.class, CollUtil.newArrayList(admSystem));
                 //添加关系
                 String systemId = admSystems.get(0).getId();
-
                 admSystem.getBuildingFloorInfoList().forEach(info -> {
                     String floorId = info.get("FloorID") == null ? null : info.get("FloorID").textValue();
                     String buildID = info.get("BuildID") == null ? null : info.get("BuildID").textValue();
@@ -445,7 +443,7 @@ public class AdmSystemController {
         AdmResponse floors = null;
         if(StrUtil.isNotEmpty(floorId)){
             AdmQueryCriteria admQueryCriteria = getAdmQueryCriteria(AdmFloor.OBJ_TYPE, floorId);
-            floors = floorService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmFloor.class);
+            floors = floorService.query(admQueryCriteria);
         }
 
         ObjectNode buildingFloorInfo = JsonNodeFactory.instance.objectNode();

+ 13 - 1
src/main/java/com/persagy/proxy/object/service/IAdmEquipmentService.java

@@ -1,8 +1,11 @@
 package com.persagy.proxy.object.service;
 
+import com.persagy.dmp.basic.model.QueryCriteria;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmBaseService;
-import com.persagy.proxy.object.model.AdmEquipment;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmEquipment;
 
 import java.util.List;
 
@@ -47,4 +50,13 @@ public interface IAdmEquipmentService extends IAdmBaseService<AdmEquipment> {
      * @param vos
      */
     void ensureSpecialValues(InstanceUrlParam context, List<AdmEquipment> vos);
+    /***
+     * Description: 将原来重写的doQuery方法改为该方法,用于使用钩子方法调整查询参数
+     * @param admQueryCriteria : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/29 11:42
+     * Update By lijie 2021/10/29 11:42
+     */
+    AdmResponse query(AdmQueryCriteria admQueryCriteria);
 }

+ 9 - 0
src/main/java/com/persagy/proxy/object/service/IAdmFloorService.java

@@ -37,4 +37,13 @@ public interface IAdmFloorService extends IAdmBaseService<AdmFloor> {
      * @return
      */
     void ensureSpecialValues(InstanceUrlParam context, List<AdmFloor> vos, boolean queryFlag);
+    /***
+     * Description: 根据条件查询
+     * @param criteria : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/28 20:13
+     * Update By lijie 2021/10/28 20:13
+     */
+    AdmResponse query(AdmQueryCriteria criteria);
 }

+ 10 - 0
src/main/java/com/persagy/proxy/object/service/IAdmSpaceService.java

@@ -2,6 +2,7 @@ package com.persagy.proxy.object.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.persagy.proxy.adm.request.AdmDCSQueryRequest;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.service.IAdmBaseService;
 import com.persagy.proxy.object.model.AdmSpace;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -91,4 +92,13 @@ public interface IAdmSpaceService extends IAdmBaseService<AdmSpace> {
      * Update By lijie 2021/10/28 17:56
      */
     AdmResponse queryMultiBuildingOrFloorSpaces(HttpServletRequest request);
+    /***
+     * Description: 根据查询条件查询空间统计数据
+     * @param request : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/28 21:07
+     * Update By lijie 2021/10/28 21:07
+     */
+    AdmResponse query(AdmQueryCriteria request);
 }

+ 51 - 1
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -10,15 +10,19 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 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.entity.BaseEntity;
 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.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.service.impl.AbstractAdmBaseServiceImpl;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.AdmEntityTransferUtil;
+import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
 import com.persagy.proxy.common.client.DmpRwdClient;
 import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
@@ -110,7 +114,9 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
 
     @Override
     public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmEquipment> clazz) {
-        AdmResponse response = super.doQuery(context, request, clazz);
+        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        processDmpCriteria(queryCriteria);
+        AdmResponse response = super.doQuery(context, queryCriteria, clazz);
         // 系统需要补充分类名称属性
         ensureSpecialValues(context, (List<AdmEquipment>) response.getContent());
         return response;
@@ -142,6 +148,50 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
             vo.setEquipCategory(category);
         }
     }
+    /***
+     * Description: 将原来重写的doQuery方法改为该方法,用于使用钩子方法调整查询参数
+     * @param admQueryCriteria : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/29 11:42
+     * Update By lijie 2021/10/29 11:42
+     */
+    @Override
+    public AdmResponse query(AdmQueryCriteria admQueryCriteria) {
+        AdmResponse response = this.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmEquipment.class);
+        // 系统需要补充分类名称属性
+        ensureSpecialValues(AdmContextUtil.toDmpContext(), (List<AdmEquipment>) response.getContent());
+        return response;
+    }
+
+    @Override
+    protected void processDmpCriteria(QueryCriteria dmpRequest) {
+        ObjectNode criteria = dmpRequest.getCriteria();
+        if (null==criteria){
+            return;
+        }
+        if (criteria.has("floorId")){
+            // 有建筑id过滤
+            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+            ObjectNode relationFrom = objectMapper.createObjectNode();
+            relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
+            relationFrom.put("relCode", RelCodeEnum.Eq2Fl.name());
+            relationFrom.set("objTo",criteria.get("floorId"));
+            criteria.set("relationFrom",relationFrom);
+            criteria.remove("floorId");
+            return;
+        }
+        if (criteria.has("buildingId")){
+            // 有建筑id过滤
+            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+            ObjectNode relationFrom = objectMapper.createObjectNode();
+            relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
+            relationFrom.put("relCode", RelCodeEnum.Eq2Bd.name());
+            relationFrom.set("objTo",criteria.get("buildingId"));
+            criteria.set("relationFrom",relationFrom);
+            criteria.remove("buildingId");
+        }
+    }
 
     private DmpResult<List<ObjRelationDTO>> queryRelation(InstanceUrlParam context, Map<String, AdmEquipment> voMap){
         QueryCriteria dmpRequest = new QueryCriteria();

+ 61 - 6
src/main/java/com/persagy/proxy/object/service/impl/AdmFloorServiceImpl.java

@@ -6,10 +6,16 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 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.proxy.adm.constant.GraphCodeEnum;
+import com.persagy.proxy.adm.constant.RelCodeEnum;
 import com.persagy.proxy.adm.service.impl.AbstractAdmBaseServiceImpl;
+import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.object.model.AdmFloor;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
+import com.persagy.proxy.object.model.AdmSpace;
 import com.persagy.proxy.object.service.IAdmFloorService;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,14 +39,63 @@ public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> im
 
     public static final Boolean QUERY = true;
     public static final Boolean CREAT_UPDATE = false;
-
+    /***
+     * Description: 根据条件查询
+     * @param criteria : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/28 20:13
+     * Update By lijie 2021/10/28 20:13
+     */
     @Override
-    public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmFloor> clazz) {
-        AdmResponse response = super.doQuery(context, request, clazz);
+    public AdmResponse query(AdmQueryCriteria criteria) {
+        // 1.查询楼层
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        criteria.setName(AdmFloor.OBJ_TYPE);
+        // 设置级联查询参数
+        AdmQueryCriteria buildCriteria = new AdmQueryCriteria();
+        buildCriteria.setName("building");
+        criteria.setCascade(CollUtil.newArrayList(buildCriteria));
+        AdmResponse response = this.doQuery(context, criteria, AdmFloor.class);
+        List<AdmFloor> admFloors = (List<AdmFloor>) response.getContent();
+        if (CollUtil.isNotEmpty(admFloors)){
+            admFloors.forEach(admFloor -> {
+                if (null==admFloor.getBuilding()){
+                    return;
+                }
+                admFloor.setBuildingId(admFloor.getBuilding().getId());
+            });
+        }
         // 处理properteies 特殊属性
-        ensureSpecialValues(context, (List<AdmFloor>) response.getContent(), QUERY);
+        ensureSpecialValues(context, admFloors, QUERY);
         return response;
     }
+    /***
+     * Description: 子类重写,以便处理带buildingId
+     * @param dmpRequest : 中台查询参数
+     * @return : void
+     * @author : lijie
+     * @date :2021/10/28 20:25
+     * Update By lijie 2021/10/28 20:25
+     */
+    @Override
+    protected void processDmpCriteria(QueryCriteria dmpRequest) {
+        ObjectNode criteria = dmpRequest.getCriteria();
+        if (null==criteria){
+            return;
+        }
+        if (criteria.has("buildingId")){
+            // 有建筑id过滤
+            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+            ObjectNode relationTo = objectMapper.createObjectNode();
+            relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
+            relationTo.put("relCode", RelCodeEnum.Bd2Fl.name());
+            relationTo.set("objFrom",criteria.get("buildingId"));
+            criteria.set("relationTo",relationTo);
+            criteria.remove("buildingId");
+        }
+    }
+
     @Override
     public AdmResponse doQueryOutLine(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmFloor> clazz) {
         request.setProjection(null);
@@ -60,7 +115,7 @@ public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> im
         list.add("infos");
         list.add("properties");
         request.setProjection(list);
-        AdmResponse rs = doQuery(context, request, clazz);
+        AdmResponse rs = query(request);
         List<AdmFloor> vos = (List<AdmFloor>) rs.getContent();
         ensureSpecialValues(context, vos, QUERY);
         vos.forEach(vo->{
@@ -79,7 +134,7 @@ public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> im
         request.setName(AdmFloor.OBJ_TYPE);
         request.resetRelationCond(false, "ArchSubset", "Bd2Fl", buildingId);
         request.setOrders("floorSequenceId desc");
-        AdmResponse rs = doQuery(context, request, AdmFloor.class);
+        AdmResponse rs = query(request);
         List<AdmFloor> vos = (List<AdmFloor>) rs.getContent();
         ensureSpecialValues(context, vos, QUERY);
         return vos;

+ 56 - 4
src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java

@@ -191,8 +191,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             request.setRelationTo(relationTo);
         }else if(StrUtil.isEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId())){
         }
-
-        AdmResponse response = doQuery(AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        AdmResponse response = query(request);
         //空间需要补充分类名称属性
         ensureSpecialValues(context, (List<AdmSpace>) response.getContent());
         return response;
@@ -238,7 +237,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         AdmQueryCriteria request = new AdmQueryCriteria();
         request.setName(AdmSpace.OBJ_TYPE);
         request.resetRelationCond(false, "ArchSubset", "Sh2Sp", spaceType, shaftId, true);
-        AdmResponse rs = doQuery(context, request, AdmSpace.class);
+        AdmResponse rs = query(request);
         return (List<AdmSpace>) rs.getContent();
     }
 
@@ -247,7 +246,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         AdmQueryCriteria request = new AdmQueryCriteria();
         request.setName(AdmSpace.OBJ_TYPE);
         request.resetRelationCond(false, "ArchSubset", "Bd2Sp", spaceType, buildingId, true);
-        AdmResponse rs = doQuery(context, request, AdmSpace.class);
+        AdmResponse rs = query(request);
         return (List<AdmSpace>) rs.getContent();
     }
 
@@ -329,6 +328,59 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         spaceCriteria.setCascade(CollUtil.newArrayList(floorCriteria));
         return super.doQuery(AdmContextUtil.toDmpContext(), spaceCriteria, AdmSpace.class);
     }
+    /***
+     * Description: 根据查询条件查询空间统计数据
+     * @param request : 请求参数
+     * @return : com.persagy.proxy.adm.request.AdmResponse
+     * @author : lijie
+     * @date :2021/10/28 21:07
+     * Update By lijie 2021/10/28 21:07
+     */
+    @Override
+    public AdmResponse query(AdmQueryCriteria request) {
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        AdmResponse response = super.doQuery(AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        // 系统需要补充分类名称属性
+        ensureSpecialValues(context, (List<AdmSpace>) response.getContent());
+        return response;
+    }
+
+    /***
+     * Description: 子类重写,以便处理带buildingId
+     * @param dmpRequest : 中台查询参数
+     * @return : void
+     * @author : lijie
+     * @date :2021/10/28 20:25
+     * Update By lijie 2021/10/28 20:25
+     */
+    @Override
+    protected void processDmpCriteria(QueryCriteria dmpRequest) {
+        ObjectNode criteria = dmpRequest.getCriteria();
+        if (null==criteria){
+            return;
+        }
+        if (criteria.has("floorId")){
+            // 有建筑id过滤
+            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+            ObjectNode relationTo = objectMapper.createObjectNode();
+            relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
+            relationTo.put("relCode", RelCodeEnum.Fl2Sp.name());
+            relationTo.set("objFrom",criteria.get("floorId"));
+            criteria.set("relationTo",relationTo);
+            criteria.remove("floorId");
+            return;
+        }
+        if (criteria.has("buildingId")){
+            // 有建筑id过滤
+            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+            ObjectNode relationTo = objectMapper.createObjectNode();
+            relationTo.put("graphCode", GraphCodeEnum.ArchSubset.name());
+            relationTo.put("relCode", RelCodeEnum.Bd2Sp.name());
+            relationTo.set("objFrom",criteria.get("buildingId"));
+            criteria.set("relationTo",relationTo);
+            criteria.remove("buildingId");
+        }
+    }
 
     /***
      * Description: 获得多建筑楼层下的空间的查询条件

+ 1 - 1
src/main/java/com/persagy/proxy/relation/controller/RelationFlAndBuController.java

@@ -90,7 +90,7 @@ public class RelationFlAndBuController {
         String filter = " id in ('" + StrUtil.join("','", idList) + "') ";
         AdmQueryCriteria criteria = new AdmQueryCriteria();
         criteria.setFilters(filter);
-        AdmResponse rs = spaceService.doQuery(AdmContextUtil.toDmpContext(), criteria, AdmSpace.class);
+        AdmResponse rs = spaceService.query(criteria);
         List<AdmSpace> spaces = (List<AdmSpace>) rs.getContent();
         Map<String, AdmSpace> admSpaceMap = spaces.stream().collect(Collectors.toMap(AdmSpace::getId, Function.identity()));
         List<AdmSpace> updateSpace = new ArrayList<>();

+ 0 - 1
src/main/java/com/persagy/proxy/relation/controller/RelationShContainSpBaseController.java

@@ -280,7 +280,6 @@ public class RelationShContainSpBaseController {
 
     /**
      * 查询空间类型和名称
-     * @param projectId projectId
      * @param shaftId shaftId 竖井id
      * @param param param
      * @return {@link AdmResponse}

+ 4 - 6
src/main/java/com/persagy/proxy/report/controller/AdmEquipFloorController.java

@@ -6,6 +6,7 @@ import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.object.service.IAdmFloorService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
@@ -17,13 +18,11 @@ import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/floor")
+@RequiredArgsConstructor
 public class AdmEquipFloorController {
 
-    @Autowired
-    private IAdmFloorService service;
+    private final IAdmFloorService service;
 
-    @Value("${middleware.group.code}")
-    private String groupCode;
     /**
      * 查询楼层信息
      * 查询楼层信息,以及使用同一个模型文件处理情况
@@ -31,8 +30,7 @@ public class AdmEquipFloorController {
      */
     @PostMapping("/query")
     public AdmResponse query(@RequestBody AdmQueryCriteria criteria) {
-        InstanceUrlParam context = AdmContextUtil.toDmpContext();
         criteria.setName(AdmFloor.OBJ_TYPE);
-        return service.doQuery(context, criteria, AdmFloor.class);
+        return service.query(criteria);
     }
 }

+ 1 - 1
src/main/java/com/persagy/proxy/report/controller/AdmEquipShaftController.java

@@ -68,7 +68,7 @@ public class AdmEquipShaftController {
         request.setName(AdmEquipment.OBJ_TYPE);
         // 设置关系条件
         request.resetRelationCond(true, "MechInArch", "Eq2Sh", shaftId, false);
-        return equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+        return equipmentService.query(request);
     }
 
     /**

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

@@ -86,7 +86,7 @@ public class AdmReportEquipController {
         cascadeSys.setName("linkSystem");
         cascade.add(cascadeSys);
         request.setCascade(cascade);
-        AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+        AdmResponse admResponse = equipmentService.query(request);
         List<AdmEquipment> equipmentList = (List<AdmEquipment>) admResponse.getContent();
         if(CollUtil.isNotEmpty(equipmentList)){
             equipmentList.stream().forEach(equip -> {
@@ -669,7 +669,7 @@ public class AdmReportEquipController {
             filter =  filter + ";id in "+arrayNode.toString();
             request.setFilters(filter);
 
-           AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+           AdmResponse admResponse = equipmentService.query(request);
            if(CollUtil.isNotEmpty(admResponse.getContent())){
                //处理数据
                List<ObjectNode> objectNodeList = (List<ObjectNode>) admResponse.getContent();
@@ -770,7 +770,7 @@ public class AdmReportEquipController {
             admQueryCriteriaObj.setName(AdmEquipment.OBJ_TYPE);
 
             admQueryCriteriaObj.setProjection(Arrays.asList("id", "name", "localId", "localName", "cadId", "bimId", "bimLocation", "infos", "classCode", "equipSerial", "bimFamilyName", "bimFamilySymbol"));
-            AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteriaObj, AdmEquipment.class);
+            AdmResponse admResponse = equipmentService.query(admQueryCriteriaObj);
 
             Map<String, Integer> hashMap = new HashMap<>();
             List<AdmEquipment> admEquipmentList = (List<AdmEquipment>) admResponse.getContent();
@@ -781,7 +781,7 @@ public class AdmReportEquipController {
             if (page >= 2) {
                 for (long i = 2; i <= page; i++) {
                     admQueryCriteriaObj.setPageNumber(Integer.parseInt(String.valueOf(i)));
-                    admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteriaObj, AdmEquipment.class);
+                    admResponse = equipmentService.query(admQueryCriteriaObj);
                     admEquipmentList = (List<AdmEquipment>) admResponse.getContent();
                     projectEquipment = JsonNodeUtils.toListNode(admEquipmentList, null, null);
                     calculate(dynamicInfoPointCodes, staticInfoPointCodes, projectEquipment, 0, hashMap);
@@ -834,7 +834,7 @@ public class AdmReportEquipController {
             admQueryCriteriaObj.setName(AdmEquipment.OBJ_TYPE);
 
             admQueryCriteriaObj.setProjection(Arrays.asList("id","name","localId","localName","cadId","bimId","bimLocation","infos","classCode","equipSerial","bimFamilyName","bimFamilySymbol"));
-            AdmResponse admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteriaObj, AdmEquipment.class);
+            AdmResponse admResponse = equipmentService.query(admQueryCriteriaObj);
 
             Map<String,Integer> hashMap = new HashMap<>();
             List<AdmEquipment> admEquipmentList = (List<AdmEquipment>) admResponse.getContent();
@@ -845,7 +845,7 @@ public class AdmReportEquipController {
             if(page >= 2){
                 for(long i = 2; i <= page; i++){
                     admQueryCriteriaObj.setPageNumber(Integer.parseInt(String.valueOf(i)));
-                    admResponse = equipmentService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteriaObj, AdmEquipment.class);
+                    admResponse = equipmentService.query(admQueryCriteriaObj);
                     admEquipmentList = (List<AdmEquipment>) admResponse.getContent();
                     projectEquipment = JsonNodeUtils.toListNode(admEquipmentList,null,null);
                     calculate(gatherDynamicInfoCode, gatherStaticInfoCode, projectEquipment,0, hashMap);

+ 3 - 3
src/main/java/com/persagy/proxy/report/controller/AdmSpaceInfoController.java

@@ -156,11 +156,11 @@ public class AdmSpaceInfoController {
 		StringBuilder sb = new StringBuilder();
 		// 补充filter条件
 		if(StrUtil.isNotBlank(request.getFilters())) {
-			sb.append(request.getFilters() + ";");
+			sb.append(request.getFilters()).append(";");
 		}
 		// 补充楼层条件
 		if(StrUtil.isNotBlank(request.getFloorId())) {
-			sb.append("floorId = '" + request.getFloorId()+"';");
+			sb.append("floorId = '").append(request.getFloorId()).append("';");
 		}
 		if(sb.length() > 0) {
 			request.setFilters(sb.substring(0, sb.length() - 1));
@@ -175,7 +175,7 @@ public class AdmSpaceInfoController {
 		request.setName(AdmEquipment.OBJ_TYPE);
 		// 设置关系条件
 		request.resetRelationCond(true, graphCode, "Eq2Sp", type, spaceId, false);
-		return equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
+		return equipmentService.query(request);
 	}
 
 }

+ 1 - 1
src/main/java/com/persagy/proxy/report/controller/ComponentBuildingController.java

@@ -87,7 +87,7 @@ public class ComponentBuildingController {
 			String inSql = CollUtil.join(modelIds, StrUtil.COMMA,"'","'");
 			floorCriteria.setFilters(" modelId in (" + inSql + ") ");
 			floorCriteria.setOnlyCount(true);
-			AdmResponse floorRs = floorService.doQuery(context, floorCriteria, AdmFloor.class);
+			AdmResponse floorRs = floorService.query(floorCriteria);
 			// 设置次数
 			building.setCount(floorRs.getCount());
 		}

+ 1 - 1
src/main/java/com/persagy/proxy/report/controller/ComponentStatisticsController.java

@@ -193,7 +193,7 @@ public class ComponentStatisticsController {
 		AdmQueryCriteria criteria = new AdmQueryCriteria();
 		criteria.setName(AdmEquipment.OBJ_TYPE);
 		criteria.setOnlyCount(true);
-		AdmResponse rs = equipmentService.doQuery(context, criteria, AdmEquipment.class);
+		AdmResponse rs = equipmentService.query(criteria);
 		long equipCount = rs.getCount() == null ? 0L : rs.getCount().longValue();
 		// 查询关系数量
 		long relCount = relationReportService.countRelationObject(context.getGroupCode(), context.getProjectId(),

+ 6 - 3
src/main/java/com/persagy/proxy/report/service/impl/AdmLabslServiceImpl.java

@@ -179,9 +179,11 @@ public class AdmLabslServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> im
         });
         String filters = StrUtil.sub(stringBuilder.toString(),0, -1);
         request.setFilters("id in ["+filters+"]");
-        AdmResponse equipResponse = equipmentService.doQuery(context, request, AdmEquipment.class);
+        AdmResponse equipResponse = equipmentService.query(request);
         if(CollUtil.isEmpty(equipResponse.getContent())){
-            throw new Exception("设备不存在");
+            log.info("设备不存在");
+            return AdmResponse.success(new ArrayList<>());
+
         }
         List<AdmEquipment> equipments = (List<AdmEquipment>)equipResponse.getContent();
         Set<String> classCodes = equipments.stream().map(k -> k.getClassCode()).collect(Collectors.toSet());
@@ -195,7 +197,8 @@ public class AdmLabslServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> im
         dictCriteria.setCriteria(node);
         AdmResponse dictResponse = doQueryObjectType(context, dictCriteria, clazz);
         if(CollUtil.isEmpty(dictResponse.getContent())){
-            throw new Exception("项目下没有设备类型");
+            log.info("项目下没有设备类型");
+            return AdmResponse.success(new ArrayList<>());
         }
 
         //获取设备类对应的专业编码