Browse Source

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

lijie 3 years ago
parent
commit
96c866ffd4
32 changed files with 428 additions and 145 deletions
  1. 6 6
      src/main/java/com/persagy/proxy/adm/controller/AdmBuildingController.java
  2. 2 2
      src/main/java/com/persagy/proxy/adm/controller/AdmComponentController.java
  3. 2 2
      src/main/java/com/persagy/proxy/adm/controller/AdmEquipmentController.java
  4. 8 7
      src/main/java/com/persagy/proxy/adm/controller/AdmFloorController.java
  5. 2 4
      src/main/java/com/persagy/proxy/adm/controller/AdmISpaceController.java
  6. 1 1
      src/main/java/com/persagy/proxy/adm/controller/AdmProjectController.java
  7. 277 35
      src/main/java/com/persagy/proxy/adm/controller/AdmShaftController.java
  8. 6 7
      src/main/java/com/persagy/proxy/adm/controller/AdmSpaceController.java
  9. 9 9
      src/main/java/com/persagy/proxy/adm/controller/AdmSystemController.java
  10. 3 3
      src/main/java/com/persagy/proxy/adm/controller/AdmTenantController.java
  11. 21 4
      src/main/java/com/persagy/proxy/adm/controller/RelationReportController.java
  12. 3 5
      src/main/java/com/persagy/proxy/adm/model/AdmBuilding.java
  13. 2 3
      src/main/java/com/persagy/proxy/adm/model/AdmComponent.java
  14. 2 4
      src/main/java/com/persagy/proxy/adm/model/AdmEquipment.java
  15. 3 4
      src/main/java/com/persagy/proxy/adm/model/AdmFloor.java
  16. 3 4
      src/main/java/com/persagy/proxy/adm/model/AdmISpace.java
  17. 1 0
      src/main/java/com/persagy/proxy/adm/model/AdmProject.java
  18. 2 2
      src/main/java/com/persagy/proxy/adm/model/AdmProperty.java
  19. 4 4
      src/main/java/com/persagy/proxy/adm/model/AdmShaft.java
  20. 2 3
      src/main/java/com/persagy/proxy/adm/model/AdmSpace.java
  21. 2 4
      src/main/java/com/persagy/proxy/adm/model/AdmSystem.java
  22. 2 3
      src/main/java/com/persagy/proxy/adm/model/AdmTenant.java
  23. 13 1
      src/main/java/com/persagy/proxy/adm/service/IRelationReportService.java
  24. 2 6
      src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmDictBaseServiceImpl.java
  25. 1 1
      src/main/java/com/persagy/proxy/adm/service/impl/AdmComponentServiceImpl.java
  26. 1 1
      src/main/java/com/persagy/proxy/adm/service/impl/AdmEquipmentServiceImpl.java
  27. 5 5
      src/main/java/com/persagy/proxy/adm/service/impl/AdmSpaceServiceImpl.java
  28. 31 5
      src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java
  29. 5 5
      src/main/java/com/persagy/proxy/adm/strategy/RelationObjectContext.java
  30. 3 3
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractReportRelationObject.java
  31. 4 2
      src/main/java/com/persagy/proxy/adm/utils/AdmQueryCriteriaHelper.java
  32. BIN
      src/main/resources/template/relation-template.xlsx

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

@@ -92,23 +92,23 @@ public class AdmBuildingController {
         filters+= "]";
 
         admQueryCriteria.setFilters(filters);
-        admQueryCriteria.setName("floor");
+        admQueryCriteria.setName(AdmFloor.OBJ_TYPE);
         AdmResponse admResponseF = floorService.doQuery(context, admQueryCriteria, AdmFloor.class);
         if(DmpResult.SUCCESS.equals(admResponseF.getResult()) && CollUtil.isNotEmpty(admResponseF.getContent())){
             return AdmResponse.failure(msg);
         }
-        admQueryCriteria.setName("space");
+        admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
         AdmResponse admResponseSpace = spaceService.doQuery(context, admQueryCriteria, AdmSpace.class);
         if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
-        admQueryCriteria.setName("ispace");
+        admQueryCriteria.setName(AdmISpace.OBJ_TYPE);
         AdmResponse admResponseISpace = iAdmISpaceService.doQuery(context, admQueryCriteria, AdmISpace.class);
         if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseISpace.getContent())){
             return AdmResponse.failure(msg);
         }
 
-        admQueryCriteria.setName("equipment");
+        admQueryCriteria.setName(AdmEquipment.OBJ_TYPE);
         AdmResponse admResponseEuip = equipmentService.doQuery(context, admQueryCriteria, AdmEquipment.class);
         if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
@@ -161,7 +161,7 @@ public class AdmBuildingController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("building");
+        request.setName(AdmBuilding.OBJ_TYPE);
         return service.doQuery(context, request, AdmBuilding.class);
     }
 
@@ -177,7 +177,7 @@ public class AdmBuildingController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("building");
+        request.setName(AdmBuilding.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmBuilding.class);
     }

+ 2 - 2
src/main/java/com/persagy/proxy/adm/controller/AdmComponentController.java

@@ -44,7 +44,7 @@ public class AdmComponentController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("component");
+        request.setName(AdmComponent.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmComponent.class);
     }
@@ -104,7 +104,7 @@ public class AdmComponentController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("component");
+        request.setName(AdmComponent.OBJ_TYPE);
         return service.doQuery(context, request, AdmComponent.class);
     }
 }

+ 2 - 2
src/main/java/com/persagy/proxy/adm/controller/AdmEquipmentController.java

@@ -42,7 +42,7 @@ public class AdmEquipmentController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("equipment");
+        request.setName(AdmEquipment.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmEquipment.class);
     }
@@ -105,7 +105,7 @@ public class AdmEquipmentController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("equipment");
+        request.setName(AdmEquipment.OBJ_TYPE);
         return service.doQuery(context, request, AdmEquipment.class);
     }
 

+ 8 - 7
src/main/java/com/persagy/proxy/adm/controller/AdmFloorController.java

@@ -59,7 +59,7 @@ public class AdmFloorController {
     public AdmResponse create(@RequestBody AdmCreateRequest<AdmFloor> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        List<AdmFloor> vos = service.doInsert(context, AdmFloor.class, createRequest.getContent());
+        List<AdmFloor> vos = createRequest.getContent();
         for(AdmFloor floor : vos){
             if(StrUtil.isEmpty(floor.getName())){
                 floor.setName(ObjectNameUtil.objectName("楼层-"));
@@ -94,7 +94,8 @@ public class AdmFloorController {
                 }
             }
         }
-        return AdmResponse.success(vos);
+        List<AdmFloor> admFloors = service.doInsert(context, AdmFloor.class, createRequest.getContent());
+        return AdmResponse.success(admFloors);
     }
 
     /**
@@ -122,17 +123,17 @@ public class AdmFloorController {
         admQueryCriteria.setFilters(filters);
         admQueryCriteria.setOnlyCount(true);
 
-        admQueryCriteria.setName("space");
+        admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
         AdmResponse admResponseSpace = spaceService.doQuery(context, admQueryCriteria, AdmSpace.class);
         if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
-        admQueryCriteria.setName("ispace");
+        admQueryCriteria.setName(AdmISpace.OBJ_TYPE);
         AdmResponse admResponseISpace = iAdmISpaceService.doQuery(context, admQueryCriteria, AdmISpace.class);
         if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseISpace.getContent())){
             return AdmResponse.failure(msg);
         }
-        admQueryCriteria.setName("equipment");
+        admQueryCriteria.setName(AdmEquipment.OBJ_TYPE);
         AdmResponse admResponseEuip = equipmentService.doQuery(context, admQueryCriteria, AdmEquipment.class);
         if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
@@ -240,7 +241,7 @@ public class AdmFloorController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("floor");
+        request.setName(AdmFloor.OBJ_TYPE);
         return service.doQuery(context, request, AdmFloor.class);
     }
 
@@ -257,7 +258,7 @@ public class AdmFloorController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("floor");
+        request.setName(AdmFloor.OBJ_TYPE);
         return service.doQueryOutLine(context, request, AdmFloor.class);
     }
 

+ 2 - 4
src/main/java/com/persagy/proxy/adm/controller/AdmISpaceController.java

@@ -1,14 +1,12 @@
 package com.persagy.proxy.adm.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.alibaba.fastjson.JSONArray;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.model.AdmISpace;
 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.adm.service.IAdmISpaceService;
-import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -46,7 +44,7 @@ public class AdmISpaceController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("ispace");
+        request.setName(AdmISpace.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmISpace.class);
     }
@@ -106,7 +104,7 @@ public class AdmISpaceController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("ispace");
+        request.setName(AdmISpace.OBJ_TYPE);
         return service.doQuery(context, request, AdmISpace.class);
     }
 

+ 1 - 1
src/main/java/com/persagy/proxy/adm/controller/AdmProjectController.java

@@ -41,7 +41,7 @@ public class AdmProjectController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("project");
+        request.setName(AdmProject.OBJ_TYPE);
         return service.doQuery(context, request, AdmProject.class);
     }
 

+ 277 - 35
src/main/java/com/persagy/proxy/adm/controller/AdmShaftController.java

@@ -1,22 +1,41 @@
 package com.persagy.proxy.adm.controller;
 
 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.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+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.basic.utils.JsonNodeUtils;
+import com.persagy.dmp.common.model.entity.BaseEntity;
+import com.persagy.dmp.define.client.DigitalObjectInfoFacade;
+import com.persagy.dmp.define.entity.ObjectInfoDefine;
+import com.persagy.dmp.digital.client.DigitalObjectFacade;
+import com.persagy.dmp.digital.client.DigitalObjectSimpleFacade;
+import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
-import com.persagy.proxy.adm.model.AdmShaft;
+import com.persagy.proxy.adm.model.*;
 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.adm.service.IAdmBuildingService;
+import com.persagy.proxy.adm.service.IAdmDictBaseService;
+import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.service.IAdmShaftService;
+import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
+import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.common.entity.RelationDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.ws.rs.QueryParam;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * Adm 竖井 API
@@ -29,6 +48,12 @@ import java.util.List;
 public class AdmShaftController {
     @Autowired
     private IAdmShaftService service;
+    @Autowired
+    private IAdmRelationService relationService;
+    @Autowired
+    private IAdmBuildingService buildingService;
+    @Autowired
+    private IAdmDictBaseService dictBaseService;
     @Value("${middleware.group.code}")
     private String groupCode;
 
@@ -61,7 +86,38 @@ public class AdmShaftController {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
         List<AdmShaft> vos = CollUtil.newArrayList(createRequest.getContent());
+        vos.stream().forEach(admShaft -> {
+            if (StrUtil.isEmpty(admShaft.getName())) {
+                admShaft.setName(ObjectNameUtil.objectName("竖井-"));
+            }
+        });
         vos = service.doInsert(context, AdmShaft.class, vos);
+
+        //TODO 创建竖井和建筑的关系
+        /*if (!entity.buildingList.isNullOrEmpty()){
+            for (building in entity.buildingList!!) {
+                try {
+                    val rShInBd = RShInBd()
+                    rShInBd.buildingId = building.id
+                    rShInBd.shaftId = entity.id
+                    rShInBd.projectId = entity.projectId
+                    rShInBd.type = "bd2sh"
+                    val insert = rShInBdService.insert(rShInBd)
+                    if (insert) {
+                        try {
+                            *//** 发送消息 *//*
+                            RService.rabbitMqService.sendRel(Opt.projectId!!, "sh2bd","11",rShInBd.buildingId!!,rShInBd.shaftId!!)
+                        } catch (e: Exception) {
+                            e.printStackTrace()
+                        }
+                    }
+                } catch (e: Exception) {
+                    e.printStackTrace()
+                }
+            }
+        }*/
+
+
         return AdmResponse.success(vos);
     }
 
@@ -111,15 +167,17 @@ public class AdmShaftController {
     }
 
     /**
-     * 查询项目下已有的竖井类型
+     * 查询竖井信息-包含统计信息
      * 此方法可能会弃用
+     *
+     * 暂不实现
      * @param projectId
      * @param request
      * @return
      * @throws Exception
      */
-    @PostMapping("/query-shaft-functype")
-    public AdmResponse queryShFuncType(@QueryParam("projectId") String projectId,
+    @PostMapping("/query-with-count")
+    public AdmResponse queryWithCount(@QueryParam("projectId") String projectId,
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
@@ -128,37 +186,118 @@ public class AdmShaftController {
     }
 
     /**
-     * 查询竖井信息-包含统计信息
-     * 此方法可能会弃用
+     * 查询关联元空间
+     * 可能移至关系
      * @param projectId
      * @param request
      * @return
      * @throws Exception
      */
-    @PostMapping("/query-with-count")
-    public AdmResponse queryWithCount(@QueryParam("projectId") String projectId,
-                             @RequestBody AdmQueryCriteria request) throws Exception {
+    @PostMapping("/relate-space")
+    public AdmResponse queryRelateSp(@QueryParam("projectId") String projectId,
+                             @RequestBody JSONObject request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("shaft");
-        return service.doQuery(context, request, AdmShaft.class);
+        //Sh2Sp
+        // 先取消后重新建立
+        if(JSONUtil.isNull(request)){
+            return AdmResponse.failure("参数为空");
+        }
+        String shaftId = request.getString("shaftId");
+        String spaceId = request.getString("spaceId");
+        // 组装条件
+        QueryCriteria criteria = new QueryCriteria();
+        if(!StrUtil.isAllNotEmpty(shaftId,spaceId)) {
+            return AdmResponse.failure("必填项:shaftId(竖井id)、spaceId(空间id)");
+        }
+        ObjectNode node = JsonNodeFactory.instance.objectNode();
+        node.put("graphCode", "ArchSubset");
+        node.put("relCode", "Sh2Sp");
+        node.put("objFrom", shaftId);
+        criteria.setCriteria(node);
+        relationService.doDelete(context, criteria);
+
+        List<String> spaceIds = Arrays.asList(spaceId.split(","));
+        Set<String> existsIds = spaceExists(context, spaceIds);
+        List<String> failureList = null;
+        if(CollUtil.isNotEmpty(existsIds)){
+            failureList = spaceIds.stream().filter(isId -> !existsIds.contains(isId)).collect(Collectors.toList());
+            List<RelationDTO> relationDTOS = new ArrayList<>();
+            existsIds.stream().forEach(spId -> {
+                RelationDTO relationDTO = new RelationDTO();
+                relationDTO.setGraphCode("ArchSubset");
+                relationDTO.setObjFrom(shaftId);
+                relationDTO.setRelCode("Sh2Sp");
+                relationDTO.setObjTo(spId);
+                relationDTOS.add(relationDTO);
+            });
+            List<ObjectNode> nodeList = JsonNodeUtils.toListNode(relationDTOS, null, null);
+            DigitalRelationFacade.create(context.getGroupCode(), context.getProjectId(),context.getAppId(), null, nodeList);
+        }else{
+            failureList = spaceIds;
+        }
+
+        if(CollUtil.isNotEmpty(failureList))
+            return AdmResponse.failure("元空间 " +failureList.stream().collect(Collectors.joining(","))+ " 不存在");
+        else
+            return AdmResponse.success();
     }
 
     /**
-     * 查询关联元空间
-     * 可能移至关系
+     * 查询项目下已有的竖井类型
+     * 此方法可能会弃用
+     * {
+     *     "id":"shaftFuncType",
+     *     "name":"竖井功能"
+     * }
      * @param projectId
-     * @param request
      * @return
      * @throws Exception
      */
-    @PostMapping("/relate-space")
-    public AdmResponse queryRelateSp(@QueryParam("projectId") String projectId,
-                             @RequestBody AdmQueryCriteria request) throws Exception {
+    @PostMapping("/query-shaft-functype")
+    public AdmResponse queryShFuncType(@QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("shaft");
-        return service.doQuery(context, request, AdmShaft.class);
+        if(StrUtil.isNotEmpty(projectId)){
+            AdmResponse admResponse = AdmResponse.success();
+            //查询参数请求查询的类型是否存在
+            AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
+            StringBuilder filters = new StringBuilder(" code = '");
+            filters.append("shaftFuncType").append("';");
+            filters.append(" classCode ='").append("shaft").append(" '");
+            admQueryCriteria.setFilters(filters.toString());
+            QueryCriteria dmpRequest = AdmQueryCriteriaHelper.toDmpCriteria(admQueryCriteria);
+            List<ObjectInfoDefine> defineList = DigitalObjectInfoFacade.query(context.getGroupCode(),context.getProjectId(),context.getAppId(),null,dmpRequest);
+            //是否有该类型的竖井信息
+            if(CollUtil.isNotEmpty(defineList)){
+                //查询中台项目实际使用该信息点的竖井
+                RequestData requestData = new RequestData();
+                requestData.setObjType(AdmShaft.OBJ_TYPE);
+                requestData.setGroups(Arrays.asList("shaftFuncType"));
+                List<Map<String, Object>> listInfos = DigitalObjectSimpleFacade.queryObjectCountByObjInfos(context.getGroupCode(),context.getAppId(),null, requestData);
+
+                if(CollUtil.isNotEmpty(listInfos)){
+                    ArrayNode datasource = defineList.get(0).getDataSource();
+                    List<HashMap> datasourceList = JSONUtil.toList(datasource.toString(), HashMap.class);
+                    Map<String, String> datasourceMap = new HashMap<>(datasourceList.size());
+                    for (HashMap map : datasourceList){
+                        datasourceMap.put(map.get("code").toString(),map.get("name").toString());
+                    }
+                    Map<String, String> datasourceMapUsed = new HashMap<>(datasourceMap.size());
+                    listInfos.stream().forEach(map -> {
+                        if(!datasourceMapUsed.containsKey(map.get("shaftFuncType")) || datasourceMap.containsKey(map.get("shaftFuncType"))){
+                            datasourceMapUsed.put(map.get("shaftFuncType").toString(),datasourceMap.get(map.get("shaftFuncType").toString()));
+                        }
+                    });
+                    if(CollUtil.isNotEmpty(datasourceMapUsed)){
+                        admResponse = AdmResponse.success(Arrays.asList(datasourceMapUsed.entrySet().toArray()));
+                    }
+                }
+            }
+            return admResponse;
+        }else{
+            return AdmResponse.failure("项目Id为空");
+        }
     }
 
     /**
@@ -170,29 +309,89 @@ public class AdmShaftController {
      * @throws Exception
      */
     @PostMapping("/shaft-zoneSpaceBaseTable")
-    public AdmResponse queryZoneSp(@QueryParam("projectId") String projectId,
+    public AdmResponse queryZoneSp(@QueryParam("projectId") String projectId, @RequestParam String shaftId,
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("shaft");
-        return service.doQuery(context, request, AdmShaft.class);
+        // 组装条件
+        QueryCriteria queryCriteria = new QueryCriteria();
+        if(!StrUtil.isAllNotEmpty(shaftId,projectId)) {
+            return AdmResponse.failure("必填项:shaftId(竖井id)、projectId(项目id)");
+        }
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        ObjectNode relationTO = JsonNodeFactory.instance.objectNode();
+        relationTO.put("relCode", "Sh2Sp");
+        relationTO.put("objFrom", shaftId);
+        criteria.putPOJO("relationTo", relationTO);
+        criteria.put("objType", AdmSpace.OBJ_TYPE);
+        queryCriteria.setCriteria(relationTO);
+
+        List<ObjectNode> spaceList = DigitalObjectFacade.query(context.getGroupCode(), context.getProjectId(), context.getAppId(), null, queryCriteria);
+        if(CollUtil.isNotEmpty(spaceList)){
+            List<AdmSpace> vos = JSONUtil.toList(spaceList.toString(), AdmSpace.class);
+            return AdmResponse.success(spaceList);
+        }else{
+            return AdmResponse.success();
+        }
     }
 
     /**
      * 查询和当前竖井有关联的业务空间所在建筑及楼层信息
      * shaftId 为竖井id
      * @param projectId
-     * @param request
      * @return
      * @throws Exception
      */
     @PostMapping("/shaft-zoneSpaceBaseTable-building")
-    public AdmResponse queryZoneSpBd(@QueryParam("projectId") String projectId,
-                             @RequestBody AdmQueryCriteria request) throws Exception {
+    public AdmResponse queryZoneSpBd(@QueryParam("projectId") String projectId, @RequestParam String shaftId,
+             @RequestParam String objectType) throws Exception {
+        if(!StrUtil.isAllNotEmpty(shaftId,projectId)) {
+            return AdmResponse.failure("必填项:shaftId(竖井id)、projectId(项目id)");
+        }
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("shaft");
-        return service.doQuery(context, request, AdmShaft.class);
+        // 组装条件 查询竖井下的空间
+        AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
+        admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
+        if(StrUtil.isNotEmpty(objectType)){
+            admQueryCriteria.setFilters(" classCode = '"+objectType+"'");
+        }
+        //转化为中台的查询条件
+        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(admQueryCriteria);
+
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        ObjectNode relationTO = JsonNodeFactory.instance.objectNode();
+        relationTO.put("relCode", "Sh2Sp");
+        relationTO.put("objFrom", shaftId);
+        criteria.putPOJO("relationTo", relationTO);
+        criteria.put("objType", AdmSpace.OBJ_TYPE);
+        queryCriteria.setCriteria(criteria);
+
+        List<ObjectNode> spaceList = DigitalObjectFacade.query(context.getGroupCode(), context.getProjectId(), context.getAppId(), null, queryCriteria);
+        if(CollUtil.isNotEmpty(spaceList)){
+            AdmQueryCriteria queryCriteriaBd = new AdmQueryCriteria();
+            queryCriteriaBd.setName(AdmBuilding.OBJ_TYPE);
+            queryCriteriaBd.setProjection(Arrays.asList("id","name","localName","floor"));
+            //建筑级联楼层
+            List<AdmQueryCriteria> cascade = new ArrayList<>(1);
+            AdmQueryCriteria cascadeFloor = new AdmQueryCriteria();
+            cascadeFloor.setName(AdmFloor.OBJ_TYPE);
+            cascadeFloor.setProjection(Arrays.asList("id","name","localName"));
+            cascade.add(cascadeFloor);
+            cascadeFloor.setOrders("floorSequenceId desc");
+            queryCriteriaBd.setCascade(cascade);
+
+            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);
+            AdmResponse response =  buildingService.doQuery(context, queryCriteriaBd, AdmBuilding.class);
+            return response;
+        }else{
+            return AdmResponse.success();
+        }
     }
 
     /**
@@ -204,11 +403,54 @@ public class AdmShaftController {
      * @throws Exception
      */
     @PostMapping("/un-shaft-zoneSpaceBaseTable")
-    public AdmResponse queryUnZoneSp(@QueryParam("projectId") String projectId,
+    public AdmResponse queryUnZoneSp(@QueryParam("projectId") String projectId, @RequestParam String shaftId,
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("shaft");
-        return service.doQuery(context, request, AdmShaft.class);
+        // 组装条件
+        QueryCriteria queryCriteria = new QueryCriteria();
+        if(!StrUtil.isAllNotEmpty(shaftId,projectId)) {
+            return AdmResponse.failure("必填项:shaftId(竖井id)、projectId(项目id)");
+        }
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        ObjectNode relationTO = JsonNodeFactory.instance.objectNode();
+        ArrayNode arrayNode = relationTO.putObject("objFrom").putArray("$notcontains");
+        arrayNode.add(shaftId);
+        relationTO.put("relCode", "Sh2Sp");
+        criteria.putPOJO("relationTo", relationTO);
+
+        criteria.put("objType", "space");
+        queryCriteria.setCriteria(relationTO);
+        List<ObjectNode> spaceList = DigitalObjectFacade.query(context.getGroupCode(), context.getProjectId(), context.getAppId(), null, queryCriteria);
+        if(CollUtil.isNotEmpty(spaceList)){
+            List<AdmSpace> vos = JSONUtil.toList(spaceList.toString(), AdmSpace.class);
+            return AdmResponse.success(spaceList);
+        }else{
+            return AdmResponse.success();
+        }
+    }
+
+    /**
+     * 元空间是否存在
+     *
+     * @param       spaceIds       failureList
+     * @return      是否存在
+     */
+    private Set<String> spaceExists(InstanceUrlParam context, List<String> spaceIds) {
+        QueryCriteria queryCriteria = new QueryCriteria();
+        ObjectNode node = JsonNodeFactory.instance.objectNode();
+        ArrayNode arrayNode = node.putObject("id").putArray("$in");
+        spaceIds.stream().forEach(spaceId -> arrayNode.add(spaceId));
+        node.put("objType","ispace");
+        queryCriteria.setCriteria(node);
+        List<ObjectNode> ispaces = DigitalObjectFacade.query(context.getGroupCode(),context.getProjectId(),context.getAppId(),context.getAppId(),queryCriteria);
+        if(CollUtil.isNotEmpty(ispaces)){
+            List<AdmISpace> iSpaceList = JSONUtil.toList(JSONUtil.parseArray(ispaces.toString()), AdmISpace.class);
+            Map<String, AdmISpace> admISpaceMap = CollUtil.fieldValueMap(iSpaceList, BaseEntity.PROP_ID);
+            return admISpaceMap.keySet();
+        }else{
+            return null;
+        }
     }
+
 }

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

@@ -27,7 +27,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.ws.rs.QueryParam;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -157,7 +156,7 @@ public class AdmSpaceController {
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
         request.setName("building");
         AdmQueryCriteria criteriaFloor = new AdmQueryCriteria();
-        criteriaFloor.setName("floor");
+        criteriaFloor.setName(AdmFloor.OBJ_TYPE);
 
         AdmQueryCriteria criteriaSpace = new AdmQueryCriteria();
         criteriaSpace.setName("spaceList");
@@ -215,7 +214,7 @@ public class AdmSpaceController {
             if(StrUtil.isNotEmpty(id)){
                 if(id.startsWith("Fl") && StrUtil.isNotEmpty(spaceId)){
                     AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
-                    admQueryCriteria.setName("floor");
+                    admQueryCriteria.setName(AdmFloor.OBJ_TYPE);
                     AdmResponse admResponseFl = floorService.doQuery(context, admQueryCriteria, AdmFloor.class);
                     if(CollUtil.isNotEmpty(admResponseFl.getContent())){
                         AdmFloor floor = JSONUtil.toBean(admResponseFl.getContent().get(0).toString(), AdmFloor.class);
@@ -236,7 +235,7 @@ public class AdmSpaceController {
                             //更新实体
                             AdmSpace space = new AdmSpace();
                             space.setId(spaceId);
-                            space.setObjectType("space");
+                            space.setObjectType(AdmSpace.OBJ_TYPE);
                             space.setZoneType(type);
                             space.setClassCode(type);
                             space.setBuildingId(floor.getBuildingId());
@@ -255,7 +254,7 @@ public class AdmSpaceController {
                     //更新实体
                     AdmSpace space = new AdmSpace();
                     space.setId(spaceId);
-                    space.setObjectType("space");
+                    space.setObjectType(AdmSpace.OBJ_TYPE);
                     space.setZoneType(type);
                     space.setClassCode(type);
                     space.setBuildingId(id);
@@ -298,7 +297,7 @@ public class AdmSpaceController {
                                       @RequestBody AdmDCSQueryRequest request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("space");
+        request.setName(AdmSpace.OBJ_TYPE);
         request.setProjection(null);
         List<String> list = new ArrayList<>();
         list.add("id");
@@ -356,7 +355,7 @@ public class AdmSpaceController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("space");
+        request.setName(AdmSpace.OBJ_TYPE);
         return service.doQuery(context, request, AdmSpace.class);
     }
 

+ 9 - 9
src/main/java/com/persagy/proxy/adm/controller/AdmSystemController.java

@@ -42,7 +42,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmSystem.class);
     }
@@ -119,7 +119,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -150,7 +150,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -168,7 +168,7 @@ public class AdmSystemController {
                                 @QueryParam("floorId") String floorId, @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -185,7 +185,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -202,7 +202,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -220,7 +220,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -238,7 +238,7 @@ public class AdmSystemController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 
@@ -256,7 +256,7 @@ public class AdmSystemController {
                                      @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("system");
+        request.setName(AdmSystem.OBJ_TYPE);
         return service.doQuery(context, request, AdmSystem.class);
     }
 }

+ 3 - 3
src/main/java/com/persagy/proxy/adm/controller/AdmTenantController.java

@@ -46,7 +46,7 @@ public class AdmTenantController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("virtual");
+        request.setName(AdmTenant.OBJ_TYPE);
         request.setOnlyCount(true);
         return service.doQuery(context, request, AdmTenant.class);
     }
@@ -112,7 +112,7 @@ public class AdmTenantController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("virtual");
+        request.setName(AdmTenant.OBJ_TYPE);
         return service.doQuery(context, request, AdmTenant.class);
     }
 
@@ -129,7 +129,7 @@ public class AdmTenantController {
                              @RequestBody AdmQueryCriteria request) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
-        request.setName("virtual");
+        request.setName(AdmTenant.OBJ_TYPE);
         return service.doQuery(context, request, AdmTenant.class);
     }
 

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

@@ -30,6 +30,7 @@ import com.alibaba.excel.ExcelWriter;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.Lists;
+import com.persagy.dmp.define.client.DigitalGraphDefineFacade;
 import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -37,6 +38,7 @@ import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IRelationReportService;
 import com.persagy.proxy.adm.strategy.RelationObjectContext;
 
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
 
@@ -72,7 +74,6 @@ public class RelationReportController {
 	public AdmResponse queryCount(HttpServletRequest request) {
 		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
 		String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
-		// 获取所有的图类型
 		
 		JSONObject result = new JSONObject();
 		result.put("count", 0);
@@ -327,7 +328,7 @@ public class RelationReportController {
 		    // 获取识别码的属性
 		    String code = sheet.getRow(2).getCell(1).toString();
 		    int lastRowNum = sheet.getLastRowNum();
-		    for (int i = 4; i < lastRowNum; i++) {
+		    for (int i = 5; i <= lastRowNum; i++) {
 		    	XSSFRow xssfRow = sheet.getRow(i);
 		    	if (xssfRow == null) {
 					continue;
@@ -371,6 +372,18 @@ public class RelationReportController {
 					relationObjects.clear();
 				}
 			}
+		    // 最后一次遗留数据录入
+		    if (CollectionUtil.isNotEmpty(relationObjects)) {
+		    	boolean objects = this.relationObjectContext.saveRelationObjects(relationObjects, groupCode, projectId, relType);
+				if (objects) {
+					successNum += relationObjects.size();
+				} else {
+					failurNum += relationObjects.size();
+					for (int rowNum : rowNums) {
+						sheet.getRow(rowNum).createCell(16).setCellValue("调用中台,存储失败");
+					}
+				}
+			}
 		    
         	try {
         		// 调用中台存储完成之后,此文件存储至本地
@@ -453,9 +466,13 @@ public class RelationReportController {
 	 * @throws IOException 
 	 */
 	private File createTemplateFile(String uploadFile) throws IOException {
-		String path = AdmCommonConstant.SERVER_ROOT_PATH + "/template/" + uploadFile;
+		String path = AdmCommonConstant.SERVER_ROOT_PATH + "/template";
 		File file = new File(path);
-		if (file == null || !file.exists()) {
+		if (!file.exists()) {
+			file.mkdirs();
+		}
+		file = new File(path + "/" + uploadFile);
+		if (!file.exists()) {
 			file.createNewFile();
 		}
 		return file;

+ 3 - 5
src/main/java/com/persagy/proxy/adm/model/AdmBuilding.java

@@ -4,9 +4,7 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 建筑 实体
@@ -16,7 +14,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class AdmBuilding extends AdmSBaseEntity<AdmBuilding>{
-
+    public static final String OBJ_TYPE = "building";
     /** 名称 */
     private String name;
     /** 本地编码 */
@@ -30,7 +28,7 @@ public class AdmBuilding extends AdmSBaseEntity<AdmBuilding>{
     /** 建筑二维码图片 */
     private String buildQRCode;
     /** 对象类型 */
-    private String objectType = "building";
+    private String objectType = OBJ_TYPE;
 
     /** 级联-项目 */
     @CascadeColumn(graphCode = "ArchSubset", relCode = "Pj2Bd", selectToObj = false)
@@ -40,5 +38,5 @@ public class AdmBuilding extends AdmSBaseEntity<AdmBuilding>{
     private List<AdmFloor> floor;
 
     /** 建筑类型code */
-    private String classCode = "building";
+    private String classCode;
 }

+ 2 - 3
src/main/java/com/persagy/proxy/adm/model/AdmComponent.java

@@ -4,9 +4,7 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 组件 实体 ==> Equipment
@@ -17,6 +15,7 @@ import java.util.Map;
 @EqualsAndHashCode(callSuper = true)
 public class AdmComponent extends AdmSBaseEntity<AdmComponent>{
 
+        public static final String OBJ_TYPE = "component";
         /** 部件名称 */
         private String name;
         /** 本地编码 */
@@ -85,7 +84,7 @@ public class AdmComponent extends AdmSBaseEntity<AdmComponent>{
         /** 二维码图片 */
         private String qrcodePic;
         /** 对象类型 */
-        private String objectType = "component";
+        private String objectType;
 
         /** 资产信息实体类   资产对应部件设施关系 资产→部件设施*/
         @CascadeColumn(graphCode = "Property2Mech", relCode = "Pe2Eq", selectToObj = false)

+ 2 - 4
src/main/java/com/persagy/proxy/adm/model/AdmEquipment.java

@@ -4,9 +4,7 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 设备 实体
@@ -16,7 +14,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class AdmEquipment extends AdmSBaseEntity<AdmEquipment>{
-
+    public static final String OBJ_TYPE = "equipment";
     /** 设备名称 */
     private String name;
     /** 本地编码 */
@@ -107,7 +105,7 @@ public class AdmEquipment extends AdmSBaseEntity<AdmEquipment>{
     private String qrcodePic;
 
     /** 对象类型 */
-    private String objectType = "equipment";
+    private String objectType;
 
     /** 资产信息实体类   资产对应设备设施关系 资产→设备设施*/
     @CascadeColumn(graphCode = "Property2Mech", relCode = "Pe2Eq", selectToObj = false)

+ 3 - 4
src/main/java/com/persagy/proxy/adm/model/AdmFloor.java

@@ -5,7 +5,6 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -17,7 +16,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class AdmFloor extends AdmSBaseEntity<AdmFloor>{
-
+    public static final String OBJ_TYPE = "floor";
     /** 名称 */
     private String name;
     /** 本地编码 */
@@ -70,9 +69,9 @@ public class AdmFloor extends AdmSBaseEntity<AdmFloor>{
 
 
     /** 对象类型 */
-    private String objectType = "floor";
+    private String objectType = OBJ_TYPE;
     /** 楼层类型code */
-    private String classCode = "floor";
+    private String classCode;
 
 
     /** 空间列表 非中台信息*/

+ 3 - 4
src/main/java/com/persagy/proxy/adm/model/AdmISpace.java

@@ -1,11 +1,9 @@
 package com.persagy.proxy.adm.model;
 
-import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -16,6 +14,7 @@ import java.util.Map;
 @Data
 public class AdmISpace {
 
+    public static final String OBJ_TYPE = "ispace";
     /** 空间ID */
     private String id;
     /** 名称 */
@@ -70,13 +69,13 @@ public class AdmISpace {
     /** 信息点 */
     private Map<String, Object> infos;
     /** 对象类型 */
-    private String objectType = "ispace";
+    private String objectType;
 
     /** 轮廓线 */
     private ArrayList<ArrayList<AdmPointPosition>> outline;
 
     /** 对象类型code */
-    private String classCode = "ispace";
+    private String classCode;
     /** 创建时间 */
     private Date createTime;
 

+ 1 - 0
src/main/java/com/persagy/proxy/adm/model/AdmProject.java

@@ -12,6 +12,7 @@ import java.util.Map;
  */
 @Data
 public class AdmProject {
+    public static final String OBJ_TYPE = "project";
     /** 项目ID */
     private String id;
     /** 项目名称 */

+ 2 - 2
src/main/java/com/persagy/proxy/adm/model/AdmProperty.java

@@ -16,7 +16,7 @@ import java.util.Map;
 
 @Data
 public class AdmProperty {
-
+    public static final String OBJ_TYPE = "property";
     /** 资产id */
     private String id;
     /** 资产名称 */
@@ -54,7 +54,7 @@ public class AdmProperty {
     /** 信息点 */
     private Map<String, Object> infos;
     /** 对象类型 */
-    private String objectType = "property";
+    private String objectType;
     /** 位置信息 */
     private String position;
     /** 贴码状态 */

+ 4 - 4
src/main/java/com/persagy/proxy/adm/model/AdmShaft.java

@@ -1,12 +1,11 @@
 package com.persagy.proxy.adm.model;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 竖井 实体
@@ -16,7 +15,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class AdmShaft extends AdmSBaseEntity<AdmShaft>{
-
+    public static final String OBJ_TYPE = "shaft";
     /** 竖井名称 */
     private String name;
     /** 竖井本地编码 */
@@ -26,6 +25,7 @@ public class AdmShaft extends AdmSBaseEntity<AdmShaft>{
     /** BIM模型中编码 */
     private String bimId;
     /** 设计图纸中编码 */
+    @JSONField(name = "cADID")
     private String cadId;
     /** 二维码图片 */
     private String qRCodePic;
@@ -44,7 +44,7 @@ public class AdmShaft extends AdmSBaseEntity<AdmShaft>{
     /** BIM模型中轮廓坐标 */
     private List<AdmPointPosition> outline;
     /** 对象类型 */
-    private String objectType = "shaft";
+    private String objectType;
     /** 级联-竖井内的设备 */
     @CascadeColumn(graphCode = "MechInArch", relCode = "Eq2Sh", selectToObj = false)
     private List<AdmEquipment> equipmentList;

+ 2 - 3
src/main/java/com/persagy/proxy/adm/model/AdmSpace.java

@@ -5,9 +5,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 空间 实体
@@ -18,6 +16,7 @@ import java.util.Map;
 @EqualsAndHashCode(callSuper = true)
 public class AdmSpace extends AdmSBaseEntity<AdmSpace>{
 
+    public static final String OBJ_TYPE = "space";
     /** 名称 */
     private String name;
     /** 本地编码 */
@@ -127,7 +126,7 @@ public class AdmSpace extends AdmSBaseEntity<AdmSpace>{
     /** 空间轮廓线 未使用 */
     //private T spaceOutline;
     /** 对象类型 */
-    private String objectType = "space";
+    private String objectType = OBJ_TYPE;
 
     public String getZoneType(){
         return zoneType;

+ 2 - 4
src/main/java/com/persagy/proxy/adm/model/AdmSystem.java

@@ -4,9 +4,7 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 系统实体
@@ -16,7 +14,7 @@ import java.util.Map;
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class AdmSystem extends AdmSBaseEntity<AdmSystem> {
-
+    public static final String OBJ_TYPE = "system";
     /** 名称 */
     private String name;
     /** 本地编码 */
@@ -45,7 +43,7 @@ public class AdmSystem extends AdmSBaseEntity<AdmSystem> {
     private AdmSystemCategory categoryNames;
 
     /** 对象类型 */
-    private String objectType = "system";
+    private String objectType = OBJ_TYPE;
 
     /** 级联-设备 */
     @CascadeColumn(graphCode = "MechSubset", relCode = "Sy2Eq")

+ 2 - 3
src/main/java/com/persagy/proxy/adm/model/AdmTenant.java

@@ -4,9 +4,7 @@ import com.persagy.proxy.adm.annotations.CascadeColumn;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * ADM 租户 实体
@@ -17,6 +15,7 @@ import java.util.Map;
 @EqualsAndHashCode(callSuper = true)
 public class AdmTenant extends AdmSBaseEntity<AdmTenant>{
 
+    public static final String OBJ_TYPE = "virtual";
     /** 租户名称 */
     private String name;
     /** 租户本地编码 */
@@ -40,6 +39,6 @@ public class AdmTenant extends AdmSBaseEntity<AdmTenant>{
     private List<AdmSpace> zoneGeneraltList;
 
     /** 租户  */
-    private String classCode = "VOTn";
+    private String classCode;
 
 }

+ 13 - 1
src/main/java/com/persagy/proxy/adm/service/IRelationReportService.java

@@ -3,6 +3,8 @@ package com.persagy.proxy.adm.service;
 import java.util.List;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.persagy.dmp.define.entity.GraphDefine;
+import com.persagy.dmp.define.entity.RelationDefine;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.proxy.adm.model.AdmRelationObject;
 
@@ -20,10 +22,20 @@ public interface IRelationReportService {
 	 * 根据条件查询对应的边类型数据
 	 * 
 	 * @param groupCode
+	 * @param projectId
+	 * @param graphCode
+	 */
+	List<GraphDefine> getGraphDefine(String groupCode, String projectId, String graphCode);
+	
+	/**
+	 * 根据条件查询对应的边类型数据
+	 * 
+	 * @param groupCode
+	 * @param projectId
 	 * @param graphCode
 	 * @param relCode
 	 */
-	void getGraphRelDefine(String groupCode, String graphCode, String relCode);
+	List<RelationDefine> getRelationDefine(String groupCode, String projectId, String graphCode, String relCode);
 	
 	/**
 	 * 获取项目计算关系

+ 2 - 6
src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmDictBaseServiceImpl.java

@@ -2,12 +2,10 @@ package com.persagy.proxy.adm.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
-
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.utils.JsonNodeUtils;
 import com.persagy.dmp.common.utils.JsonHelper;
@@ -32,8 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * @ClassName AbstractAdmDictBaseServiceImpl
@@ -126,9 +122,9 @@ public class AbstractAdmDictBaseServiceImpl<T> implements IAdmDictBaseService<T>
         }
         // 调用中台查询
         DmpResult<JSONArray> dmpResult = rwdClient.queryObjectInfo(context, para);
-        List<T> admVOs = AdmEntityTransferUtil.toAdmMultiEntity(dmpResult.getData(), request.getProjection(), clazz);
+        List<AdmObjectInfo> admVOs = AdmEntityTransferUtil.toAdmMultiEntity(dmpResult.getData(), request.getProjection(), AdmObjectInfo.class);
         // BDTP信息点格式与ADM兼容处理
-        handleObjectInfoResult((List<AdmObjectInfo>) admVOs);
+        handleObjectInfoResult(admVOs);
         // 设置返回值
         AdmResponse response = AdmResponse.success(admVOs);
         Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();

+ 1 - 1
src/main/java/com/persagy/proxy/adm/service/impl/AdmComponentServiceImpl.java

@@ -43,7 +43,7 @@ public class AdmComponentServiceImpl extends AbstractAdmBaseServiceImpl<AdmCompo
         }
         Set<String> classCodes = voList.stream().map(AdmComponent::getClassCode).collect(Collectors.toSet());
         //查询定义类型
-        QueryCriteria criteriaObject = getDmpCriteria(context, classCodes, "component");
+        QueryCriteria criteriaObject = getDmpCriteria(context, classCodes, AdmComponent.OBJ_TYPE);
         JSONObject paraPe = null;
         try {
             String paraStr = objectMapper.writeValueAsString(criteriaObject);

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

@@ -56,7 +56,7 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
         }
         Set<String> classCodes = voList.stream().map(AdmEquipment::getClassCode).collect(Collectors.toSet());
         //查询定义类型
-        QueryCriteria criteriaObject = getDmpCriteria(context, classCodes, "equipment");
+        QueryCriteria criteriaObject = getDmpCriteria(context, classCodes, AdmEquipment.OBJ_TYPE);
         JSONObject paraPe = null;
         try {
             String paraStr = objectMapper.writeValueAsString(criteriaObject);

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

@@ -95,7 +95,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             querySpaceByFl(dmpRequest,context, spaceArray, zoneTypeList, request.getFloorId(), "Fl2Sp");
 
         }else if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isNotEmpty(request.getFloorId()) && request.getFloorId().equals("isnull")){
-            QueryCriteria queryFloor = ensureQueryCommParm(dmpRequest,context, Arrays.asList("floor"), "floor");
+            QueryCriteria queryFloor = ensureQueryCommParm(dmpRequest,context, Arrays.asList("floor"), AdmFloor.OBJ_TYPE);
             ObjectNode criteriaFl = queryFloor.getCriteria();
             criteriaFl.put("buildingId", request.getBuildingId());
             queryFloor.setCriteria(criteriaFl);
@@ -104,7 +104,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             Map<String, AdmFloor> floorMap = CollUtil.fieldValueMap(floorList, BaseEntity.PROP_ID);
 
             if(CollUtil.isNotEmpty(floorMap)){
-                QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, "space");
+                QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, AdmSpace.OBJ_TYPE);
                 ObjectNode criteriaPe = queryCriteria.getCriteria();
                 JSONArray jsonArray = new JSONArray();
                 floorMap.keySet().forEach(floorId -> jsonArray.add(floorId));
@@ -171,7 +171,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
      * @param relCode
      */
     private void querySpaceByFl(QueryCriteria dmpRequest, InstanceUrlParam context, List spaceArray, List<String> zoneTypeList, String objFrom, String relCode){
-        QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest,context, zoneTypeList, "space");
+        QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest,context, zoneTypeList, AdmSpace.OBJ_TYPE);
         addRelationTo(queryCriteria,objFrom,relCode);
         DmpResult<JSONArray> dmpResult = queryObj(context, queryCriteria);
         if(CollUtil.isNotEmpty(dmpResult.getData())){
@@ -240,7 +240,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
     }
 
     private JSONArray queryAndDealObjs(InstanceUrlParam context, Set<String> codes){
-        QueryCriteria criteriaObject = ensureQueryCommParm(new QueryCriteria(), context, codes,"space");
+        QueryCriteria criteriaObject = ensureQueryCommParm(new QueryCriteria(), context, codes,AdmSpace.OBJ_TYPE);
         criteriaObject.setSize(50L);
         DmpResult<JSONArray> dmpResult = queryObj(context, criteriaObject);
         if(CollUtil.isEmpty(dmpResult.getData())){
@@ -260,7 +260,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         Map<String, String> codeNameMap = null;
         ObjectNode criteriaEq = JsonNodeFactory.instance.objectNode();
         criteriaEq.put("projectId", context.getProjectId());
-        criteriaEq.put("objType", "space");
+        criteriaEq.put("objType", AdmSpace.OBJ_TYPE);
         DmpResult<JSONArray> resultDef = queryDefineType(context, criteriaEq);
         if(resultDef.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(resultDef.getData())){
             List<ObjectTypeDefine> defineList = JSONUtil.toList(resultDef.getData().toString(), ObjectTypeDefine.class);

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

@@ -12,6 +12,10 @@ import com.google.common.collect.Lists;
 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.define.client.DigitalGraphDefineFacade;
+import com.persagy.dmp.define.client.DigitalRelationDefineFacade;
+import com.persagy.dmp.define.entity.GraphDefine;
+import com.persagy.dmp.define.entity.RelationDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.client.DigitalRelationProjectCalFacade;
@@ -27,6 +31,7 @@ import com.persagy.proxy.adm.strategy.relationdata.RelationObjectStrategy;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
+import net.minidev.json.JSONObject;
 
 /**
  * 报表/模板下载
@@ -45,9 +50,22 @@ public class RelationReportService implements IRelationReportService {
 
 	@Autowired
 	private RelationObjectContext relationObjectContext;
+
+	@Override
+	public List<GraphDefine> getGraphDefine(String groupCode, String projectId, String graphCode) {
+		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
+		QueryCriteria queryCriteria = new QueryCriteria();
+		ObjectNode criteria = objectMapper.createObjectNode();
+		if (StrUtil.isNotBlank(graphCode)) {
+			criteria.put("code", graphCode);
+		}
+		queryCriteria.setCriteria(criteria);
+		List<GraphDefine> graphDefines = DigitalGraphDefineFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return graphDefines;
+	}
 	
 	@Override
-	public void getGraphRelDefine(String groupCode, String graphCode, String relCode) {
+	public List<RelationDefine> getRelationDefine(String groupCode, String projectId, String graphCode, String relCode) {
 		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
 		QueryCriteria queryCriteria = new QueryCriteria();
 		ObjectNode criteria = objectMapper.createObjectNode();
@@ -55,9 +73,11 @@ public class RelationReportService implements IRelationReportService {
 			criteria.put("graphCode", graphCode);
 		}
 		if (StrUtil.isNotBlank(relCode)) {
-			criteria.put("relCode", relCode);
+			criteria.put("code", relCode);
 		}
 		queryCriteria.setCriteria(criteria);
+		List<RelationDefine> relationDefines = DigitalRelationDefineFacade.query(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
+		return relationDefines;
 	}
 	
 	@Override
@@ -75,14 +95,20 @@ public class RelationReportService implements IRelationReportService {
 			objectNode.put("relationType", relType);
 			
 			// 获取此图类型和边类型对应的数据记录
+			List<RelationDefine> relationDefines = this.getRelationDefine(groupCode, projectId, relationTypeEnum.getGraphCode(), relationTypeEnum.getRelCode());
+			if (CollectionUtil.isNotEmpty(relationDefines)) {
+				RelationDefine relationDefine = relationDefines.get(0);
+				objectNode.put("conneObject", relationDefine.getTargetObjs());
+				objectNode.put("relationTypeCode", relationDefine.getCode());
+				objectNode.put("relationTypeName", relationDefine.getName());
+				objectNode.put("automatic", (null == relationDefine.getAutomaticFlag() || 0 == relationDefine.getAutomaticFlag()) ? false : true);
+			}
 			
 			String prefix = ObjTypeMapping.getRelCodePrefix(relationTypeEnum.getRelCode());
 			String suffix = ObjTypeMapping.getRelCodeSuffix(relationTypeEnum.getRelCode());
 			objectNode.put("mainObject", ObjTypeMapping.PREFIX_NAME.get(prefix));
 			objectNode.put("fromObject", ObjTypeMapping.PREFIX_NAME.get(suffix));
-			objectNode.put("relationTypeCode", relationTypeEnum.getRelCode());
-			boolean automatic = objectNode.get("automaticFlag") == null ? false : objectNode.get("automaticFlag").asBoolean(false);
-			objectNode.put("automatic", automatic);
+			objectNode.putPOJO("statistics", new JSONObject());
 		}
 		
 		return objectNode;

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

@@ -56,7 +56,7 @@ public class RelationObjectContext {
 		if (relationTypeEnum == null) {
 			return Lists.newArrayList();
 		}
-		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelationType();
+		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelCode();
 		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(className);
 		return strategy == null ? Lists.newArrayList() : strategy.findRelationObject(groupCode, projectId);
 	}
@@ -74,7 +74,7 @@ public class RelationObjectContext {
 		if (relationTypeEnum == null) {
 			return "未知类型";
 		}
-		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelationType();
+		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelCode();
 		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(className);
 		if (strategy == null) {
 			return "不存在此策略类";
@@ -97,7 +97,7 @@ public class RelationObjectContext {
 		if (relationTypeEnum == null) {
 			return false;
 		}
-		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelationType();
+		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelCode();
 		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(className);
 		if (strategy == null) {
 			return false;
@@ -119,7 +119,7 @@ public class RelationObjectContext {
 		if (relationTypeEnum == null) {
 			return 0;
 		}
-		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelationType();
+		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelCode();
 		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(className);
 		if (strategy == null) {
 			return 0;
@@ -143,7 +143,7 @@ public class RelationObjectContext {
 		if (relationTypeEnum == null) {
 			return masterObjs;
 		}
-		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelationType();
+		String className = relationTypeEnum.getGraphCode() + AdmCommonConstant.UNDERLINE + relationTypeEnum.getRelCode();
 		RelationObjectStrategy strategy = this.relationObjectStrategyMap.get(className);
 		if (strategy == null) {
 			return masterObjs;

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

@@ -153,7 +153,7 @@ public abstract class AbstractReportRelationObject extends AbstractRelationObjec
 		if (StrUtil.isBlank(masterObjType)) {
 			return "边类型错误";
 		}
-		String slaveObjType = ObjTypeMapping.PREFIX_FULLNAME.get(ObjTypeMapping.getRelCodePrefix(relCode));
+		String slaveObjType = ObjTypeMapping.PREFIX_FULLNAME.get(ObjTypeMapping.getRelCodeSuffix(relCode));
 		if (StrUtil.isBlank(slaveObjType)) {
 			return "边类型错误";
 		}
@@ -190,8 +190,8 @@ public abstract class AbstractReportRelationObject extends AbstractRelationObjec
 			if ("Sp".equals(relCodePrefix)) {
 				objectNode.put("relValue", masterClassCode);
 			}
-			objectNode.put("objFrom", relationObject.getMasterId());
-			objectNode.put("objTo", relationObject.getSlaveId());
+			objectNode.put("objFrom", master.get("id").asText());
+			objectNode.put("objTo", slave.get("id").asText());
 			return objectNode;
 		}
 		

+ 4 - 2
src/main/java/com/persagy/proxy/adm/utils/AdmQueryCriteriaHelper.java

@@ -26,6 +26,8 @@ public class AdmQueryCriteriaHelper {
 
     /** 条件匹配字符串 */
     private static final String[] COND_STR = {" = "," != "," > "," >= "," < "," <= "," in "," isnull "," contain "," startwith "," endwith "};
+    /** 条件匹配字符串 根据ADM实际调用查看,去掉空格*/
+    private static final String[] COND_STR_TRIM = {"=","!=",">",">=","<","<=","in","isnull","contain","startwith","endwith"};
     /** 需要替换的字段对照 Map<AdmQueryCriteria.name, Map<AdmFieldName, DmpFieldName> */
     private static Map<String, Map<String, String>> RENAME_MAP = new HashMap<>(16);
     /** 与数据中台的操作参数对照 */
@@ -186,7 +188,7 @@ public class AdmQueryCriteriaHelper {
      * @param express
      */
     private static void ensureAndExpress(String name, ObjectNode criteria, String express) {
-        String cond = StrUtil.getContainsStr(express, COND_STR);
+        String cond = StrUtil.isBlank(StrUtil.getContainsStr(express, COND_STR)) ? StrUtil.getContainsStr(express, COND_STR_TRIM) : StrUtil.getContainsStr(express, COND_STR);
         if(StrUtil.isBlank(cond)) {
             return;
         }
@@ -227,7 +229,7 @@ public class AdmQueryCriteriaHelper {
             ObjectNode node = criteria.putObject(column);
             node.set(OPERATOR_MAP.get(operator), getJsonNode(node, value));
         }
-    }
+     }
 
     /**
      * 取Json值对象

BIN
src/main/resources/template/relation-template.xlsx