Sfoglia il codice sorgente

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

zhangqiankun 3 anni fa
parent
commit
7b72e8adb9

+ 137 - 34
src/main/java/com/persagy/proxy/dictionary/service/impl/AdmPlanarServiceImpl.java

@@ -5,6 +5,9 @@ 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.digital.entity.ObjectRelation;
+import com.persagy.proxy.adm.request.AdmQueryCriteria;
+import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.service.impl.AbstractAdmBaseServiceImpl;
 import com.persagy.proxy.object.model.AdmEquipment;
 import com.persagy.proxy.dictionary.model.AdmPlanarEquipRequests;
@@ -14,6 +17,7 @@ import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.dictionary.service.IAdmPlanarService;
 import com.persagy.proxy.object.service.IAdmSpaceService;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,6 +25,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 import java.util.stream.Collectors;
 /**
  * @ClassName AdmPlanarServiceImpl
@@ -30,6 +35,7 @@ import java.util.stream.Collectors;
  * @Version V1.0
  **/
 @Service
+@Slf4j
 public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implements IAdmPlanarService {
 
     @Autowired
@@ -37,7 +43,10 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
 
     @Autowired
     private IAdmEquipmentService equipmentService;
-    
+
+    @Autowired
+    private IAdmRelationService relationService;
+
     /**
      * 查询平面图设备信息
      * @param context
@@ -48,15 +57,110 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
      */
     @Override
     public AdmResponse queryPlanarEquip(InstanceUrlParam context, AdmPlanarEquipRequests requests, Class<AdmEquipment> clazz) throws Exception {
-        List<AdmSpace> spaces = new ArrayList<>();
+
+       if(CollUtil.isEmpty(requests.getZoneTypes()) && CollUtil.isEmpty(requests.getSpaceIds()) && CollUtil.isEmpty(requests.getFuncTypes())){
+           //查询建筑楼层下的所有设备(或指定类型下的设备)
+             return queryAdmEquip(context,requests,clazz);
+       }else{
+           //查询空间下的设备
+           return queryAdmEquipInSpace(context,requests,clazz);
+       }
+    }
+
+    /**
+     * 查询ADM设备信息
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    private AdmResponse queryAdmEquip(InstanceUrlParam context, AdmPlanarEquipRequests request,Class<AdmEquipment> clazz){
+        //增加过滤条件
+        StringBuilder filters = new StringBuilder();
+        filters.append("buildingId = "+ request.getBuildingId() +";");
+        if(StringUtils.isNotEmpty(request.getFloorId())){
+            filters.append("floorId = "+ request.getFloorId() +";");
+        }
+        if(CollUtil.isNotEmpty(request.getEquipTypes())){
+            filters.append("classCode in "+"(\'" + java.lang.String.join("\',\'", request.getEquipTypes()) + "\')");
+        }
+        AdmQueryCriteria equipQueryCriteria = new AdmQueryCriteria();
+        equipQueryCriteria.setFilters(filters.toString());
+        equipQueryCriteria.setOrders("createTime desc, id desc");
+
+        //级联查询建筑楼层
+       /* List<AdmQueryCriteria> cascades = new ArrayList<>();
+        AdmQueryCriteria buildCascade = new AdmQueryCriteria();
+        buildCascade.setName("building");
+        cascades.add(buildCascade);
+        AdmQueryCriteria floorCascade = new AdmQueryCriteria();
+        floorCascade.setName("floor");
+        cascades.add(floorCascade);
+        equipQueryCriteria.setCascade(cascades);*/
+
+        log.info(equipQueryCriteria.toString());
+        return equipmentService.doQuery(context, equipQueryCriteria, clazz);
+    }
+
+
+    /**
+     * 查询ADM设备信息
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    private AdmResponse queryAdmSpace(InstanceUrlParam context, AdmPlanarEquipRequests request,Class<AdmSpace> clazz){
+        //增加过滤条件
+        StringBuilder filters = new StringBuilder();
+        filters.append("buildingId = "+ request.getBuildingId() +";");
+        if(StringUtils.isNotEmpty(request.getFloorId())){
+            filters.append("floorId = "+ request.getFloorId() +";");
+        }
+        if(CollUtil.isNotEmpty(request.getZoneTypes())){
+            filters.append("classCode in "+"(\'" + java.lang.String.join("\',\'", request.getZoneTypes()) + "\')");
+        }
+        if(CollUtil.isNotEmpty(request.getSpaceIds())){
+            filters.append("id in "+"(\'" + java.lang.String.join("\',\'", request.getSpaceIds()) + "\')");
+        }
+        if(CollUtil.isNotEmpty(request.getFuncTypes())){
+            filters.append("roomFuncType in "+"(\'" + java.lang.String.join("\',\'", request.getFuncTypes()) + "\')");
+        }
+        AdmQueryCriteria equipQueryCriteria = new AdmQueryCriteria();
+        equipQueryCriteria.setFilters(filters.toString());
+        equipQueryCriteria.setOrders("createTime desc, id desc");
+
+        //级联查询建筑楼层-测试用
+       /* List<AdmQueryCriteria> cascades = new ArrayList<>();
+        AdmQueryCriteria buildCascade = new AdmQueryCriteria();
+        buildCascade.setName("building");
+        cascades.add(buildCascade);
+        AdmQueryCriteria floorCascade = new AdmQueryCriteria();
+        floorCascade.setName("floor");
+        cascades.add(floorCascade);
+        equipQueryCriteria.setCascade(cascades);*/
+        log.info(equipQueryCriteria.toString());
+        return spaceService.doQuery(context, equipQueryCriteria, clazz);
+    }
+
+    /**
+     * 查询ADM空间下的设备信息
+     * @param context
+     * @param requests
+     * @param clazz
+     * @return
+     */
+    private AdmResponse queryAdmEquipInSpace(InstanceUrlParam context, AdmPlanarEquipRequests requests,Class<AdmEquipment> clazz){
         //获取空间信息
-        if(CollUtil.isEmpty(requests.getSpaceIds())){
+        /*if(CollUtil.isEmpty(requests.getSpaceIds())){
             //查询建筑/楼层下的空间信息
             spaces = querySpInFl(context, requests, AdmSpace.class);
         }else{
             //根据空间功能类型等过滤空间信息
             spaces = queryDmpSpace(context, requests, AdmSpace.class);
-        }
+        }*/
+        AdmResponse admSpaceResponse = queryAdmSpace(context, requests, AdmSpace.class);
+        List<AdmSpace> spaces = (List<AdmSpace>) admSpaceResponse.getContent();
         if(CollUtil.isEmpty(spaces)){
             return AdmResponse.success(new ArrayList<>());
         }
@@ -68,7 +172,6 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
         response.setTotal(result == null ? 0 : Long.valueOf(result.size()));
         return response;
     }
-
     /**
      * 查询平面图空间
      * @param context
@@ -79,7 +182,7 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
      */
     @Override
     public AdmResponse queryPlanarSpace(InstanceUrlParam context, AdmPlanarEquipRequests requests, Class<AdmSpace> clazz) throws Exception {
-        List<AdmSpace> spaces = new ArrayList<>();
+       /* List<AdmSpace> spaces = new ArrayList<>();
         //获取空间信息
         if(CollUtil.isEmpty(requests.getSpaceIds())){
             //查询建筑/楼层下的空间信息
@@ -87,10 +190,8 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
         }else{
             //根据空间功能类型等过滤空间信息
             spaces = queryDmpSpace(context, requests, AdmSpace.class);
-        }
-        AdmResponse response = AdmResponse.success(spaces);
-        response.setTotal(spaces == null ? 0 : Long.valueOf(spaces.size()));
-        return response;
+        }*/
+        return queryAdmSpace(context, requests, clazz);
     }
 
     /**
@@ -100,11 +201,14 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
      * @return
      */
     private List<AdmSpace> querySpInFl(InstanceUrlParam context, AdmPlanarEquipRequests requests, Class<AdmSpace> clazz){
+        if(CollUtil.isEmpty(requests.getZoneTypes()) && CollUtil.isNotEmpty(requests.getFuncTypes())){
+            return new ArrayList<>();
+        }
 
         //设置空间基础查询条件
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
         if(CollUtil.isNotEmpty(requests.getZoneTypes())){
-            ArrayNode array = criteria.putObject("objType").putArray("$in");
+            ArrayNode array = criteria.putObject("classCode").putArray("$in");
             requests.getZoneTypes().forEach(code -> array.add(code));
         }
 
@@ -112,11 +216,6 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
             ArrayNode array = criteria.putObject("roomFuncType").putArray("$in");
             requests.getFuncTypes().forEach(code -> array.add(code));
         }
-        if(CollUtil.isNotEmpty(requests.getEquipTypes())){
-            ArrayNode array = criteria.putObject("classCode").putArray("$in");
-            requests.getEquipTypes().forEach(code -> array.add(code));
-        }
-
         //设置空间关系查询条件
         QueryCriteria dmpRequest = new QueryCriteria();
         if(StringUtils.isEmpty(requests.getFloorId())){
@@ -142,20 +241,28 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
         if(CollUtil.isEmpty(spaceIds)){
             return new ArrayList<>();
         }
-        //默认业务空间数量不会太多,若多的话后期进行优化
-        List<AdmEquipment> result = new ArrayList<>();
-        for (String spaceId : spaceIds) {
-            ObjectNode criteria = JsonNodeFactory.instance.objectNode();
-            //设置设备关系查询条件
-            QueryCriteria dmpRequest = transDmpRelationCriteria(criteria,"MechInArch", "Eq2Sp", spaceId, 1);
-            //查询物理世界对象信息
-            AdmResponse response = equipmentService.doQuery(context, dmpRequest, clazz);
-            List<AdmEquipment> content = (List<AdmEquipment>) response.getContent();
-            if(CollUtil.isNotEmpty(content)){
-                result.addAll(content);
-            }
-        }
-        return result;
+        //查询关系数据
+        QueryCriteria queryCriteria = new QueryCriteria();
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        criteria.put("graphCode","MechInArch");
+        criteria.put("relCode","Eq2Sp");
+        ArrayNode objNode = criteria.putArray("objTo");
+        spaceIds.forEach(id -> objNode.add(id));
+        queryCriteria.setCriteria(criteria);
+        List<ObjectRelation> relationList = relationService.queryByCondition(context, queryCriteria);
+        Set<String> equipIds = relationList.stream().map(ObjectRelation::getObjFrom).collect(Collectors.toSet());
+
+        //查询设备信息
+        QueryCriteria equipQueryCriteria = new QueryCriteria();
+        ObjectNode equipCriteria = JsonNodeFactory.instance.objectNode();
+        ArrayNode idNode = equipCriteria.putArray("id");
+        equipIds.forEach(id -> idNode.add(id));
+        ArrayNode classCodeNode = equipCriteria.putArray("classCode");
+        requests.getEquipTypes().forEach(classCode -> classCodeNode.add(classCode));
+        equipQueryCriteria.setCriteria(equipCriteria);
+        AdmResponse admResponse = equipmentService.doQuery(context, equipQueryCriteria, clazz);
+
+        return (List<AdmEquipment>) admResponse.getContent();
     }
 
     /**
@@ -178,10 +285,6 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
             ArrayNode array = criteria.putObject("objType").putArray("$in");
             requests.getZoneTypes().forEach(code -> array.add(code));
         }
-        if(CollUtil.isNotEmpty(requests.getEquipTypes())){
-            ArrayNode array = criteria.putObject("classCode").putArray("$in");
-            requests.getEquipTypes().forEach(code -> array.add(code));
-        }
         QueryCriteria dmpRequest = new QueryCriteria();
         dmpRequest.setCriteria(criteria);
 

+ 8 - 1
src/main/java/com/persagy/proxy/object/service/IAdmShaftService.java

@@ -1,8 +1,9 @@
 package com.persagy.proxy.object.service;
 
+import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.proxy.adm.service.IAdmBaseService;
-import com.persagy.proxy.object.model.AdmShaft;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmShaft;
 
 import java.util.List;
 
@@ -13,4 +14,10 @@ import java.util.List;
  */
 public interface IAdmShaftService extends IAdmBaseService<AdmShaft> {
     void ensureSpecialValues(InstanceUrlParam context, List<AdmShaft> vos);
+    /***
+     * Description: 子类重写,以便处理带buildingId
+     * @param dmpRequest : 中台查询参数
+     * @return : void
+     */
+    void processDmpCriteria(QueryCriteria dmpRequest);
 }

+ 8 - 1
src/main/java/com/persagy/proxy/object/service/IAdmSystemService.java

@@ -1,8 +1,9 @@
 package com.persagy.proxy.object.service;
 
+import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.proxy.adm.service.IAdmBaseService;
-import com.persagy.proxy.object.model.AdmSystem;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmSystem;
 
 import java.util.List;
 
@@ -19,4 +20,10 @@ public interface IAdmSystemService extends IAdmBaseService<AdmSystem> {
      * @param vos
      */
     void ensureSpecialValues(InstanceUrlParam context, List<AdmSystem> vos);
+    /***
+     * Description: 子类重写,以便处理带buildingId
+     * @param dmpRequest : 中台查询参数
+     * @return : void
+     */
+    void processDmpCriteria(QueryCriteria dmpRequest);
 }

+ 4 - 5
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -22,7 +22,6 @@ 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;
@@ -114,9 +113,7 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
 
     @Override
     public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmEquipment> clazz) {
-        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
-        processDmpCriteria(queryCriteria);
-        AdmResponse response = super.doQuery(context, queryCriteria, clazz);
+        AdmResponse response = super.doQuery(context, request, clazz);
         // 系统需要补充分类名称属性
         ensureSpecialValues(context, (List<AdmEquipment>) response.getContent());
         return response;
@@ -158,7 +155,7 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
      */
     @Override
     public AdmResponse query(AdmQueryCriteria admQueryCriteria) {
-        AdmResponse response = this.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmEquipment.class);
+        AdmResponse response = super.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmEquipment.class);
         // 系统需要补充分类名称属性
         ensureSpecialValues(AdmContextUtil.toDmpContext(), (List<AdmEquipment>) response.getContent());
         return response;
@@ -179,6 +176,8 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
             relationFrom.set("objTo",criteria.get("floorId"));
             criteria.set("relationFrom",relationFrom);
             criteria.remove("floorId");
+            if (criteria.has("buildingId"))
+                criteria.remove("buildingId");
             return;
         }
         if (criteria.has("buildingId")){

+ 29 - 4
src/main/java/com/persagy/proxy/object/service/impl/AdmShaftServiceImpl.java

@@ -1,16 +1,22 @@
 package com.persagy.proxy.object.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+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.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.common.entity.InstanceUrlParam;
 import com.persagy.proxy.object.model.AdmEquipment;
 import com.persagy.proxy.object.model.AdmShaft;
-import com.persagy.proxy.adm.request.AdmQueryCriteria;
-import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.object.model.AdmSystem;
 import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.object.service.IAdmShaftService;
-import com.persagy.proxy.adm.utils.AdmContextUtil;
-import com.persagy.proxy.common.entity.InstanceUrlParam;
 import com.persagy.proxy.object.service.IAdmSystemService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -49,6 +55,25 @@ public class AdmShaftServiceImpl extends AbstractAdmBaseServiceImpl<AdmShaft> im
         equipmentService.ensureSpecialValues(AdmContextUtil.toDmpContext(), equipmentList);
         systemService.ensureSpecialValues(AdmContextUtil.toDmpContext(), systemList);
     }
+
+    @Override
+    public 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.Bd2Sh.name());
+            relationTo.set("objFrom",criteria.get("buildingId"));
+            criteria.set("relationTo",relationTo);
+            criteria.remove("buildingId");
+        }
+    }
+
     @Override
     public AdmResponse doQuery(InstanceUrlParam context, AdmQueryCriteria request, Class<AdmShaft> clazz) {
         AdmResponse response = super.doQuery(context, request, clazz);

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

@@ -29,7 +29,6 @@ import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.service.impl.AbstractAdmBaseServiceImpl;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
-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;
@@ -344,9 +343,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
     @Override
     public AdmResponse query(AdmQueryCriteria request) {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
-        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
-        processDmpCriteria(queryCriteria);
-        AdmResponse response = super.doQuery(context, queryCriteria, AdmSpace.class);
+        AdmResponse response = super.doQuery(context, request, AdmSpace.class);
         // 系统需要补充分类名称属性
         ensureSpecialValues(context, (List<AdmSpace>) response.getContent());
         return response;

+ 37 - 0
src/main/java/com/persagy/proxy/object/service/impl/AdmSystemServiceImpl.java

@@ -1,6 +1,12 @@
 package com.persagy.proxy.object.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+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.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.impl.AbstractAdmBaseServiceImpl;
@@ -76,4 +82,35 @@ public class AdmSystemServiceImpl extends AbstractAdmBaseServiceImpl<AdmSystem>
         // 对象扩展属性赋值
         equipmentService.ensureSpecialValues(context, equipmentList);
     }
+
+    @Override
+    public 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.Sy2Fl.name());
+            relationFrom.set("objTo",criteria.get("floorId"));
+            criteria.set("relationFrom",relationFrom);
+            criteria.remove("floorId");
+            if (criteria.has("buildingId"))
+                criteria.remove("buildingId");
+            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.Sy2Bd.name());
+            relationFrom.set("objTo",criteria.get("buildingId"));
+            criteria.set("relationFrom",relationFrom);
+            criteria.remove("buildingId");
+        }
+    }
 }