Browse Source

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

lijie 3 years ago
parent
commit
78fa38b4d3
33 changed files with 332 additions and 164 deletions
  1. 19 40
      src/main/java/com/persagy/proxy/adm/request/AdmCreateResponse.java
  2. 9 0
      src/main/java/com/persagy/proxy/adm/service/IAdmBaseService.java
  3. 31 0
      src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmBaseServiceImpl.java
  4. 10 0
      src/main/java/com/persagy/proxy/common/client/DmpRwdClient.java
  5. 5 0
      src/main/java/com/persagy/proxy/common/constant/DmpUrlConstant.java
  6. 2 5
      src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java
  7. 12 0
      src/main/java/com/persagy/proxy/dictionary/service/IAdmDictService.java
  8. 54 0
      src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java
  9. 3 2
      src/main/java/com/persagy/proxy/object/controller/AdmBuildingController.java
  10. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmComponentController.java
  11. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmDoorController.java
  12. 51 9
      src/main/java/com/persagy/proxy/object/controller/AdmEquipmentController.java
  13. 10 9
      src/main/java/com/persagy/proxy/object/controller/AdmFloorController.java
  14. 3 2
      src/main/java/com/persagy/proxy/object/controller/AdmISpaceController.java
  15. 6 6
      src/main/java/com/persagy/proxy/object/controller/AdmLocationPointController.java
  16. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmPropertyController.java
  17. 3 2
      src/main/java/com/persagy/proxy/object/controller/AdmShaftController.java
  18. 15 13
      src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java
  19. 7 6
      src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java
  20. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmTenantController.java
  21. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmVirtualWallController.java
  22. 5 4
      src/main/java/com/persagy/proxy/object/controller/AdmWindowController.java
  23. 3 3
      src/main/java/com/persagy/proxy/object/model/AdmComponent.java
  24. 3 3
      src/main/java/com/persagy/proxy/object/model/AdmEquipment.java
  25. 1 1
      src/main/java/com/persagy/proxy/object/model/AdmFloor.java
  26. 6 6
      src/main/java/com/persagy/proxy/object/model/AdmISpace.java
  27. 1 1
      src/main/java/com/persagy/proxy/object/model/AdmShaft.java
  28. 13 14
      src/main/java/com/persagy/proxy/object/model/AdmSpace.java
  29. 9 0
      src/main/java/com/persagy/proxy/object/service/IAdmEquipmentService.java
  30. 12 0
      src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java
  31. 1 1
      src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java
  32. 9 7
      src/main/java/com/persagy/proxy/relation/controller/RelationSpInSiController.java
  33. 4 10
      src/main/java/com/persagy/proxy/report/controller/AdmSpaceInfoController.java

+ 19 - 40
src/main/java/com/persagy/proxy/adm/request/AdmCreateResponse.java

@@ -1,8 +1,6 @@
 package com.persagy.proxy.adm.request;
 
-import com.alibaba.fastjson.JSONArray;
-import com.persagy.proxy.adm.utils.AdmEntityTransferUtil;
-import com.persagy.proxy.common.entity.DmpResult;
+import cn.hutool.core.collection.CollUtil;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -18,53 +16,34 @@ import java.util.List;
 @Data
 @NoArgsConstructor
 @AllArgsConstructor
-public class AdmCreateResponse {
+public class AdmCreateResponse extends AdmResponse {
     private final static String SUCCESS = "success";
     private final static String FAILURE = "failure";
-    /** 结果 */
-    private String result;
-    /** 消息 */
-    private String message;
     /** 错误数据主从对象 1 主对象  2 从对象 */
     private String errorType;
-    /** 查询到的数据列表 */
+    /**
+     * 查询到的数据列表
+     */
     private List<?> entityList;
 
-    public static AdmCreateResponse success() {
-        return new AdmCreateResponse(SUCCESS, null, null, null);
+    public AdmCreateResponse(String result, String message, Long total, Long count, Integer pageNumber, Integer pageSize, List<?> content, String floorId, String zoneType, List<?> entityList, String errorType) {
+        super(result, message, total, count, pageNumber, pageSize, content, floorId, zoneType);
+        this.entityList = entityList;
+        this.errorType = errorType;
     }
-
-    public static AdmCreateResponse success(String message) {
-        return new AdmCreateResponse(SUCCESS, message, null, null);
-    }
-
     public static AdmCreateResponse failure(String message) {
-        return new AdmCreateResponse(FAILURE, message, null, new ArrayList<>());
+        return new AdmCreateResponse(FAILURE, message, null, null, null, null, null, null, null, null, null);
     }
-
     public static AdmCreateResponse failure(String message,String errorType) {
-        return new AdmCreateResponse(FAILURE, message, errorType, new ArrayList<>());
+        return new AdmCreateResponse(FAILURE, message,null, null, null, null, null, null, null, new ArrayList<>(), errorType);
     }
-
-    public static AdmCreateResponse success(List<?> content) {
-        return new AdmCreateResponse(SUCCESS, null, null, content);
+    public static AdmCreateResponse success() {
+        return new AdmCreateResponse(SUCCESS, "", 0L,null, 1, 500, null,null,null,null,null);
     }
-
-    /**
-     * 从数据中台结果转换
-     * @param admRequest
-     * @param dmpResult
-     * @param clazz
-     * @param <T>
-     * @return
-     */
-    public static <T> AdmCreateResponse fromDmp(AdmQueryCriteria admRequest, DmpResult<JSONArray> dmpResult, Class<T> clazz) {
-        if(!DmpResult.SUCCESS.equals(dmpResult.getResult())) {
-            return failure("调用中台查询接口出错:" + dmpResult.getMessage());
-        }
-        // 转换为结果
-        List<T> admVOs = AdmEntityTransferUtil.toAdmMultiEntity(dmpResult.getData(), admRequest.getProjection(), clazz);
-        Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
-        return new AdmCreateResponse(SUCCESS, null, null, admVOs);
+    public static AdmCreateResponse success(String message) {
+        return new AdmCreateResponse(SUCCESS, message, 0L,null, 1, 500, null,null,null,null,null);
+    }
+    public static AdmCreateResponse success(List<?> content) {
+        return new AdmCreateResponse(SUCCESS, "", CollUtil.isEmpty(content) ? 0L :content.size()*1L,null, 1, 50,null ,null,null,CollUtil.isEmpty(content) ? new ArrayList(1): content,null);
     }
-}
+}

+ 9 - 0
src/main/java/com/persagy/proxy/adm/service/IAdmBaseService.java

@@ -73,4 +73,13 @@ public interface IAdmBaseService<T> {
      * @return
      */
     List<T> doUpdateRelationProjectCal(InstanceUrlParam context, Class<T> clazz, List<T> voList);
+
+    /**
+     * 查询对象类型
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    AdmResponse queryObjectClassCode(InstanceUrlParam context, AdmQueryCriteria request, Class<T> clazz);
 }

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

@@ -508,4 +508,35 @@ public class AbstractAdmBaseServiceImpl<T> implements IAdmBaseService<T> {
         return AdmEntityTransferUtil.toAdmMultiEntity(response.getData(), null, clazz);
     }
 
+
+    /**
+     * 查询对象类型
+     * @param request
+     * @return
+     */
+    @Override
+    public AdmResponse queryObjectClassCode(InstanceUrlParam context, AdmQueryCriteria request, Class<T> clazz) {
+        // 转换为数据中台查询条件
+        QueryCriteria dmpRequest = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        //重置分页,查询所有
+        dmpRequest.setSize(null);
+        // 提供一个钩子方法用于处理已封装好的中台查询参数(因传参有buildingId而处理)
+        processDmpCriteria(dmpRequest);
+        // 转换参数
+        JSONObject para = null;
+        try {
+            para = JsonHelper.toJsonObject(dmpRequest);
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+            return AdmResponse.failure("参数格式有误");
+        }
+        log.info("request:{},dmpRequest:{}, dmp-param: {}", request.toString(), dmpRequest.toString(), para.toString());
+        // 调用中台查询
+        DmpResult<List<String>> dmpResult = rwdClient.queryObjectClassCode(context, para);
+        // 设置返回值
+        AdmResponse response = AdmResponse.success(dmpResult.getData());
+        Long total = dmpResult.getCount() == null ? null : dmpResult.getCount().longValue();
+        response.setTotal(total);
+        return response;
+    }
 }

+ 10 - 0
src/main/java/com/persagy/proxy/common/client/DmpRwdClient.java

@@ -204,4 +204,14 @@ public interface DmpRwdClient {
     @PostMapping(DmpUrlConstant.DEF_FUNCID_COLLECT_SET)
     DmpResult batchUpdateObjectInfoCollect(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONArray objectArr);
 
+
+    /**
+     * 查询对象下已有的类型
+     * @param objectUrlParam
+     * @param criteria
+     * @return
+     */
+    @PostMapping(DmpUrlConstant.QUERY_OBJECT_CLASS_CODE)
+    DmpResult<List<String>> queryObjectClassCode(@SpringQueryMap InstanceUrlParam objectUrlParam, @RequestBody JSONObject criteria);
+
 }

+ 5 - 0
src/main/java/com/persagy/proxy/common/constant/DmpUrlConstant.java

@@ -159,4 +159,9 @@ public class DmpUrlConstant {
     public final static String DEF_FUNCID_COLLECT_SET = "/rwd/def/funcid/collect/updateBatch";
 
 
+    /**
+     * 查询对象下已有的类型
+     */
+    public static final String QUERY_OBJECT_CLASS_CODE = "/rwd/instance/object/queryObjectClassCode";
+
 }

+ 2 - 5
src/main/java/com/persagy/proxy/dictionary/controller/AdmDictController.java

@@ -155,11 +155,8 @@ public class AdmDictController {
      */
     @PostMapping("/system/equip/category")
     @Deprecated
-    public AdmResponse querySystemEquipCategory(@RequestBody AdmDict request) throws Exception {
-        // 组装上下文条件
-        InstanceUrlParam context = AdmContextUtil.toDmpContext();
-        request.setType(AdmDictCategoryEnum.SYSTEM_EQUIP.getValue());
-        return service.queryCategory(context,request,AdmObjectType.class);
+    public AdmResponse querySystemEquipTree(@RequestBody AdmDictQueryCriteria request) throws Exception {
+        return service.querySystemEquipTree(AdmContextUtil.toDmpContext(),request,AdmObjectType.class);
     }
 
     /**

+ 12 - 0
src/main/java/com/persagy/proxy/dictionary/service/IAdmDictService.java

@@ -75,4 +75,16 @@ public interface IAdmDictService<T> extends IAdmDictBaseService<T>{
      * @return
      */
     AdmResponse queryDictDeliveredInfos(InstanceUrlParam context, AdmDictDeliverieInfosRequest request, Class<T> clazz);
+
+
+    /**
+     * 查询项目下已有的系统设备类型树
+     * @param context
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    AdmResponse querySystemEquipTree(InstanceUrlParam context , AdmDictQueryCriteria request, Class<T> clazz) throws Exception;
+
+
 }

+ 54 - 0
src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -55,6 +55,7 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
     @Autowired
     private IAdmShaftService shaftService;
 
+
     /**
      * 字典类型查询:所有设备类型、部件类型、系统类型、专业类型
      * 查询类型:输入设备类型:equipment,输入部件类型:component,输入系统类型:system,输入专业类型:major,业务空间类型 space ,资产 property,
@@ -745,6 +746,59 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         return AdmResponse.success(deliveredInfos);
     }
 
+    /**
+     * 查询项目下已有的系统设备类型树
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public AdmResponse querySystemEquipTree(InstanceUrlParam context, AdmDictQueryCriteria request, Class<T> clazz) throws Exception {
+        //查询项目下已有的设备类型
+        request.setName("equipment");
+        AdmResponse dictResponse = equipmentService.queryEquipClassCode(context, request, AdmEquipment.class);
+        List<String> classCodes = (List<String>)dictResponse.getContent();
+        if(CollUtil.isEmpty(classCodes)){
+            return AdmResponse.success(new ArrayList<>());
+        }
+        Map<String, List<String>> classCodeMap = classCodes.stream().collect(Collectors.groupingBy(item->item.substring(0,4),Collectors.toList()));
+        //查询系统设备类树
+        AdmDict admDict = new AdmDict();
+        admDict.setType(AdmDictCategoryEnum.SYSTEM_EQUIP.getValue());
+        AdmResponse categoryResponse = queryCategory(context, admDict, clazz);
+        List<AdmObjectType> objectTypes = (List<AdmObjectType>) categoryResponse.getContent();
+        if(CollUtil.isEmpty(objectTypes)){
+            return AdmResponse.success(new ArrayList<>());
+        }
+        //过滤设备实体中不存在的类型
+        Iterator<AdmObjectType> it = objectTypes.iterator();
+        while(it.hasNext()){
+            //过滤系统
+            AdmObjectType objectType = it.next();
+            List<String> objTypes = classCodeMap.get(objectType.getCode());
+            if(CollUtil.isEmpty(objTypes)){
+               it.remove();
+               continue;
+            }
+            //过滤子级:设备类型
+            List<AdmObjectType> children = objectType.getChildren();
+            if(CollUtil.isEmpty(children)){
+                it.remove();
+                continue;
+            }
+            Iterator<AdmObjectType> chidIterator = children.iterator();
+            while (chidIterator.hasNext()){
+                AdmObjectType next = chidIterator.next();
+                if(!objTypes.contains(next.getCode())){
+                    chidIterator.remove();
+                }
+            }
+        }
+        return AdmResponse.success(objectTypes);
+    }
+
 
     /**
      * 组装通用对象查询条件

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

@@ -5,6 +5,7 @@ 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;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
@@ -49,7 +50,7 @@ public class AdmBuildingController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmBuilding> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmBuilding> createRequest) throws Exception {
         List<AdmBuilding> vos = CollUtil.newArrayList(createRequest.getContent());
         vos.stream().forEach(admBuilding -> {
             if (StrUtil.isEmpty(admBuilding.getName())){
@@ -62,7 +63,7 @@ public class AdmBuildingController {
             }
         });
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmBuilding.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

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

@@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
@@ -61,10 +62,10 @@ public class AdmComponentController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmComponent> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmComponent> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         List<AdmComponent> vos = CollUtil.newArrayList(createRequest.getContent());
         if(CollUtil.isEmpty(vos)){
-            return AdmResponse.success();
+            return AdmCreateResponse.success();
         }
         // 查询所有设备类型
         AdmDict dictCond = AdmDict.builder().type(AdmDictCategoryEnum.COMPONENT.getValue()).build();
@@ -107,10 +108,10 @@ public class AdmComponentController {
             }
         }
         if(CollUtil.isEmpty(filterVOs)){
-            return AdmResponse.success();
+            return AdmCreateResponse.success();
         }
         filterVOs = service.doInsert(AdmContextUtil.toDmpContext(), AdmComponent.class, filterVOs);
-        return AdmResponse.success(filterVOs);
+        return AdmCreateResponse.success(filterVOs);
     }
 
     /**

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

@@ -1,13 +1,14 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.proxy.object.model.AdmDoor;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmDoorService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmDoor;
+import com.persagy.proxy.object.service.IAdmDoorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -38,11 +39,11 @@ public class AdmDoorController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmDoor> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmDoor> createRequest) throws Exception {
         // 组装上下文条件
         List<AdmDoor> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmDoor.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

+ 51 - 9
src/main/java/com/persagy/proxy/object/controller/AdmEquipmentController.java

@@ -25,7 +25,6 @@ import com.persagy.dmp.common.helper.SpringHelper;
 import com.persagy.dmp.common.model.entity.BaseEntity;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.define.client.DigitalDefineFacade;
-import com.persagy.dmp.define.client.DigitalObjectInfoFacade;
 import com.persagy.dmp.define.entity.ObjectInfoDefine;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
@@ -35,6 +34,7 @@ import com.persagy.proxy.adm.constant.AdmCommonConstant;
 import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmRelationService;
@@ -50,7 +50,8 @@ import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.report.service.IRelationReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
+import org.apache.poi.xssf.usermodel.XSSFColor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -103,10 +104,10 @@ public class AdmEquipmentController {
 	 * @throws Exception
 	 */
 	@PostMapping("/create")
-	public AdmResponse create(@RequestBody AdmCreateRequest<AdmEquipment> createRequest) throws Exception {
+	public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmEquipment> createRequest) throws Exception {
 		List<AdmEquipment> vos = CollUtil.newArrayList(createRequest.getContent());
 		if(CollUtil.isEmpty(vos)){
-			return AdmResponse.success();
+			return AdmCreateResponse.success();
 		}
 		// 查询所有设备类型
 		AdmDict dictCond = AdmDict.builder().type(AdmDictCategoryEnum.EQUIPMENT.getValue()).build();
@@ -149,10 +150,12 @@ public class AdmEquipmentController {
 			}
 		}
 		if(CollUtil.isEmpty(filterVOs)){
-			return AdmResponse.success();
+			return AdmCreateResponse.success();
 		}
 		filterVOs = service.doInsert(AdmContextUtil.toDmpContext(), AdmEquipment.class, filterVOs);
-		return AdmResponse.success(filterVOs);
+		//处理关系
+        processRelations(filterVOs);
+		return AdmCreateResponse.success(filterVOs);
 	}
 
 	/**
@@ -165,6 +168,12 @@ public class AdmEquipmentController {
 	public AdmResponse delete( @RequestBody List<AdmEquipment> vos) throws Exception {
 		// 组装上下文条件
 		service.doDelete(AdmContextUtil.toDmpContext(), vos);
+        QueryCriteria queryCriteria = new QueryCriteria();
+        vos.forEach(vo -> {
+            /** 清除空间和建筑楼层的的数据 */
+            dealRelation(vo.getId(), queryCriteria, AdmRelationTypeEnum.EQ2BD.getRelCode());
+            dealRelation(vo.getId(), queryCriteria, AdmRelationTypeEnum.EQ2FL.getRelCode());
+        });
 		return AdmResponse.success();
 	}
 
@@ -351,10 +360,10 @@ public class AdmEquipmentController {
 	 * @throws Exception
 	 */
 	@PostMapping("/creat-equip-pro")
-	public AdmResponse createExt(@RequestBody AdmCreateRequest<AdmEquipment> admEquipment) throws Exception {
+	public AdmCreateResponse createExt(@RequestBody AdmCreateRequest<AdmEquipment> admEquipment) throws Exception {
 		List<AdmEquipment> vos = admEquipment.getContent();
 		if(CollUtil.isEmpty(vos)){
-			return AdmResponse.success();
+			return AdmCreateResponse.success();
 		}
 		//创建设备
 		vos.stream().forEach(equipment -> {
@@ -388,7 +397,7 @@ public class AdmEquipmentController {
 			reVos.addAll(vosR);
 		});
 		relationService.doSave(AdmContextUtil.toDmpContext(),relationDTOS);
-		return AdmResponse.success(reVos);
+		return AdmCreateResponse.success(reVos);
 	}
 
 	/**
@@ -1105,4 +1114,37 @@ public class AdmEquipmentController {
 		this.setColor(workbook,56,94,15,createCell);
 	}
 
+    /**
+     * 添加绑定关系
+     */
+    private void processRelations(List<AdmEquipment> vosR){
+        if(CollUtil.isNotEmpty(vosR)) {
+            List<RelationDTO> relationDTOS = new ArrayList<>(vosR.size());
+            vosR.forEach(admEquipment -> {
+                if (StrUtil.isNotEmpty(admEquipment.getBuildingId())) {
+                    relationDTOS.add(new RelationDTO(null, AdmRelationTypeEnum.EQ2BD.getGraphCode(), AdmRelationTypeEnum.EQ2BD.getRelCode(), admEquipment.getClassCode(), admEquipment.getId(), admEquipment.getBuildingId()));
+                }
+                if (StrUtil.isNotEmpty(admEquipment.getFloorId())) {
+                    relationDTOS.add(new RelationDTO(null, AdmRelationTypeEnum.EQ2FL.getGraphCode(), AdmRelationTypeEnum.EQ2FL.getRelCode(), admEquipment.getClassCode(), admEquipment.getId(),admEquipment.getFloorId()));
+                }
+            });
+            if (CollUtil.isNotEmpty(relationDTOS)) {
+                relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOS);
+            }
+        }
+    }
+
+    /**
+     * 删除关系
+     * @param euipId
+     * @param queryCriteria
+     * @param relCode
+     */
+    private void dealRelation(String euipId, QueryCriteria queryCriteria, String relCode){
+        ObjectNode rBd = JsonNodeFactory.instance.objectNode();
+        rBd.put("objFrom",euipId);
+        rBd.put("relCode",relCode);
+        queryCriteria.setCriteria(rBd);
+        relationService.doDelete(AdmContextUtil.toDmpContext(), queryCriteria);
+    }
 }

+ 10 - 9
src/main/java/com/persagy/proxy/object/controller/AdmFloorController.java

@@ -3,18 +3,19 @@ package com.persagy.proxy.object.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import com.persagy.dmp.common.model.entity.BaseEntity;
-import com.persagy.proxy.object.model.AdmEquipment;
-import com.persagy.proxy.object.model.AdmFloor;
-import com.persagy.proxy.object.model.AdmISpace;
-import com.persagy.proxy.object.model.AdmSpace;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.adm.service.*;
+import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.RelationDTO;
+import com.persagy.proxy.object.model.AdmEquipment;
+import com.persagy.proxy.object.model.AdmFloor;
+import com.persagy.proxy.object.model.AdmISpace;
+import com.persagy.proxy.object.model.AdmSpace;
 import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.object.service.IAdmFloorService;
 import com.persagy.proxy.object.service.IAdmISpaceService;
@@ -57,7 +58,7 @@ public class AdmFloorController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmFloor> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmFloor> createRequest) throws Exception {
         List<AdmFloor> vos = createRequest.getContent();
         service.ensureSpecialValues(AdmContextUtil.toDmpContext(), vos, AdmFloorServiceImpl.CREAT_UPDATE);
         for(AdmFloor floor : vos){
@@ -65,7 +66,7 @@ public class AdmFloorController {
                 floor.setName(ObjectNameUtil.objectName("楼层-"));
             }
             if(floor.getFloorSequenceID() == null){
-                return AdmResponse.failure("楼层顺序号不可以为空或类型错误");
+                return AdmCreateResponse.failure("楼层顺序号不可以为空或类型错误");
             }
         }
         Map<String, AdmFloor> admFloorMap = CollUtil.fieldValueMap(vos, "buildingId");
@@ -88,7 +89,7 @@ public class AdmFloorController {
                         AdmFloor admFloorNew = admFloorMap.get(admFloorOld.getBuildingId());
                         //楼层序列号相同
                         if(admFloorOld.getFloorSequenceID() !=null && admFloorNew.getFloorSequenceID().equals(admFloorOld.getFloorSequenceID())){
-                           return AdmResponse.failure("楼层顺序号不可以重复");
+                           return AdmCreateResponse.failure("楼层顺序号不可以重复");
                         }
                     }
                 }
@@ -108,7 +109,7 @@ public class AdmFloorController {
             relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOS);
         }
 
-        return AdmResponse.success(admFloors);
+        return AdmCreateResponse.success(admFloors);
     }
 
     /**

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

@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.persagy.dmp.common.utils.JsonHelper;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
@@ -54,11 +55,11 @@ public class AdmISpaceController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmISpace> AdmISpace) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmISpace> AdmISpace) throws Exception {
         List<AdmISpace> vos = CollUtil.newArrayList(AdmISpace.getContent());
         ensureDataInfos(vos);
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmISpace.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

+ 6 - 6
src/main/java/com/persagy/proxy/object/controller/AdmLocationPointController.java

@@ -1,16 +1,16 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.proxy.object.model.AdmLocationPoint;
-
-import com.persagy.proxy.object.model.AdmPointImage;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmLocationPointService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.DmpResult;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmLocationPoint;
+import com.persagy.proxy.object.model.AdmPointImage;
+import com.persagy.proxy.object.service.IAdmLocationPointService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -85,13 +85,13 @@ public class AdmLocationPointController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmLocationPoint> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmLocationPoint> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
         List<AdmLocationPoint> vos = CollUtil.newArrayList(createRequest.getContent());
         log.info("创建条件"+vos.toString());
         vos = service.doInsert(context, AdmLocationPoint.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
 

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

@@ -1,12 +1,13 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.proxy.object.model.AdmProperty;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmPropertyService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
+import com.persagy.proxy.object.model.AdmProperty;
+import com.persagy.proxy.object.service.IAdmPropertyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -35,10 +36,10 @@ public class AdmPropertyController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmProperty> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmProperty> createRequest) throws Exception {
         List<AdmProperty> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmProperty.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

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

@@ -17,6 +17,7 @@ import com.persagy.dmp.digital.client.DigitalObjectFacade;
 import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmRelationService;
@@ -74,7 +75,7 @@ public class AdmShaftController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmShaft> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmShaft> createRequest) throws Exception {
         List<AdmShaft> vos = CollUtil.newArrayList(createRequest.getContent());
         List<AdmShaft> unRelationShaft = new ArrayList<>();
         List<AdmShaft> admShafts = new ArrayList<>(vos.size());
@@ -103,7 +104,7 @@ public class AdmShaftController {
             List shaftList = service.doInsert(AdmContextUtil.toDmpContext(), AdmShaft.class, unRelationShaft);
             admShafts.addAll(shaftList);
         }
-        return AdmResponse.success(admShafts);
+        return AdmCreateResponse.success(admShafts);
     }
 
     /**

+ 15 - 13
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -3,7 +3,6 @@ package com.persagy.proxy.object.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 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.model.QueryCriteria;
@@ -71,7 +70,7 @@ public class AdmSpaceController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public ObjectNode create(@RequestBody AdmCreateRequest<AdmSpace> createRequest) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmSpace> createRequest) throws Exception {
         List<AdmSpace> vos = CollUtil.newArrayList(createRequest.getContent());
         String msg = null;
         for (AdmSpace admSpace : vos) {
@@ -85,13 +84,10 @@ public class AdmSpaceController {
         }
         if(StrUtil.isEmpty(msg)){
             vos = service.doInsertExt(AdmContextUtil.toDmpContext(), AdmSpace.class, vos);
-            AdmResponse admResponse = AdmResponse.success(vos);
-            ObjectNode admResponseObj = JsonNodeUtils.toObjectNode(admResponse, null,null);
-            ArrayNode arrayNode = JsonNodeUtils.toArrayNode(vos,null,null);
-            admResponseObj.putPOJO("entityList",arrayNode);
+            AdmCreateResponse admResponseObj = AdmCreateResponse.success(vos);
             return admResponseObj;
         }else{
-            return JsonNodeUtils.toObjectNode(AdmResponse.failure(msg), null,null);
+            return AdmCreateResponse.failure(msg);
         }
 
     }
@@ -108,8 +104,9 @@ public class AdmSpaceController {
         QueryCriteria queryCriteria = new QueryCriteria();
         vos.forEach(vo -> {
             /** 清除空间和建筑楼层的的数据 */
-            dealRelation(vo.getId(), queryCriteria,"Bd2Sp");
-            dealRelation(vo.getId(), queryCriteria,"Fl2Sp");
+            dealRelation(vo.getId(), queryCriteria,"Bd2Sp", false);
+            dealRelation(vo.getId(), queryCriteria,"Fl2Sp", false);
+            dealRelation(vo.getId(), queryCriteria,"Sp2Si", true);
         });
         return AdmResponse.success();
     }
@@ -279,8 +276,8 @@ public class AdmSpaceController {
             String type = requestData.getType();//classCode
 
             /** 清除空间和建筑楼层的的数据 */
-            dealRelation(spaceId, queryCriteria,"Bd2Sp");
-            dealRelation(spaceId, queryCriteria,"Fl2Sp");
+            dealRelation(spaceId, queryCriteria,"Bd2Sp", false);
+            dealRelation(spaceId, queryCriteria,"Fl2Sp", false);
 
             if(StrUtil.isNotEmpty(id)){
                 if(id.startsWith("Fl") && StrUtil.isNotEmpty(spaceId)){
@@ -450,9 +447,14 @@ public class AdmSpaceController {
     }
 
 
-    private void dealRelation(String spaceId, QueryCriteria queryCriteria, String relCode){
+    private void dealRelation(String spaceId, QueryCriteria queryCriteria, String relCode, Boolean isObjFrom){
         ObjectNode rBd = JsonNodeFactory.instance.objectNode();
-        rBd.put("objTo",spaceId);
+        if(isObjFrom){
+            rBd.put("objFrom",spaceId);
+        }else{
+            rBd.put("objTo",spaceId);
+        }
+
         rBd.put("relCode",relCode);
         queryCriteria.setCriteria(rBd);
         relationService.doDelete( AdmContextUtil.toDmpContext(), queryCriteria);

+ 7 - 6
src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -17,6 +17,7 @@ import com.persagy.dmp.digital.client.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
 import com.persagy.proxy.adm.service.IAdmRelationService;
@@ -74,10 +75,10 @@ public class AdmSystemController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmSystem> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmSystem> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         List<AdmSystem> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmSystem.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**
@@ -87,7 +88,7 @@ public class AdmSystemController {
      * @throws Exception
      */
     @PostMapping("/create-bd-fl")
-    public AdmResponse createBdFl(@RequestBody AdmCreateRequest<AdmSystem> createRequest) throws Exception {
+    public AdmCreateResponse createBdFl(@RequestBody AdmCreateRequest<AdmSystem> createRequest) throws Exception {
         List<AdmSystem> vos = CollUtil.newArrayList(createRequest.getContent());
 
         Map<String, AdmSystem> admSystemMap = CollUtil.fieldValueMap(vos, "classCode");
@@ -137,7 +138,7 @@ public class AdmSystemController {
             List<AdmSystem> systemList = service.doInsert(AdmContextUtil.toDmpContext(), AdmSystem.class, unRelationSys);
             admSystemList.addAll(systemList);
         }
-        return AdmResponse.success(admSystemList);
+        return AdmCreateResponse.success(admSystemList);
     }
 
     /**
@@ -183,7 +184,7 @@ public class AdmSystemController {
      * @throws Exception
      */
     @PostMapping("/link-equip")
-    public AdmResponse createRelateEquip(@RequestBody JsonObject createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse createRelateEquip(@RequestBody JsonObject createRequest, @QueryParam("projectId") String projectId) throws Exception {
         String sysId = createRequest.get("sysId").toString();
         List<String> equipIdList = (List<String>)createRequest.get("equipIdList");
         List<ObjectNode> relations = new ArrayList<>(equipIdList.size());
@@ -195,7 +196,7 @@ public class AdmSystemController {
             objectNode.put("objTo", euipId);
         });
         List<ObjectRelation> list = DigitalRelationFacade.create(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, relations);
-        return AdmResponse.success(list);
+        return AdmCreateResponse.success(list);
     }
 
     /**

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

@@ -2,13 +2,14 @@ package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
-import com.persagy.proxy.object.model.AdmTenant;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmTenantService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
+import com.persagy.proxy.object.model.AdmTenant;
+import com.persagy.proxy.object.service.IAdmTenantService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -50,7 +51,7 @@ public class AdmTenantController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmTenant> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmTenant> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         List<AdmTenant> vos = CollUtil.newArrayList(createRequest.getContent());
         vos.stream().forEach(admTenant -> {
             if (StrUtil.isEmpty(admTenant.getName())){
@@ -58,7 +59,7 @@ public class AdmTenantController {
             }
         });
         vos = service.doInsert(AdmContextUtil.toDmpContext(), AdmTenant.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

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

@@ -1,13 +1,14 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.proxy.object.model.AdmVirtualWall;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmVirtualWallService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmVirtualWall;
+import com.persagy.proxy.object.service.IAdmVirtualWallService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -54,13 +55,13 @@ public class AdmVirtualWallController {
      * @throws Exception
      */
     @PostMapping("/create_ignore")
-    public AdmResponse createIgnore(@RequestBody AdmCreateRequest<AdmVirtualWall> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse createIgnore(@RequestBody AdmCreateRequest<AdmVirtualWall> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
         createRequest.getContent().forEach(it->{
             //TODO
         });
-        return AdmResponse.success();
+        return AdmCreateResponse.success();
     }
 
     /**

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

@@ -1,13 +1,14 @@
 package com.persagy.proxy.object.controller;
 
 import cn.hutool.core.collection.CollUtil;
-import com.persagy.proxy.object.model.AdmWindow;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
-import com.persagy.proxy.object.service.IAdmWindowService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
 import com.persagy.proxy.common.entity.InstanceUrlParam;
+import com.persagy.proxy.object.model.AdmWindow;
+import com.persagy.proxy.object.service.IAdmWindowService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -39,12 +40,12 @@ public class AdmWindowController {
      * @throws Exception
      */
     @PostMapping("/create")
-    public AdmResponse create(@RequestBody AdmCreateRequest<AdmWindow> createRequest, @QueryParam("projectId") String projectId) throws Exception {
+    public AdmCreateResponse create(@RequestBody AdmCreateRequest<AdmWindow> createRequest, @QueryParam("projectId") String projectId) throws Exception {
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
         List<AdmWindow> vos = CollUtil.newArrayList(createRequest.getContent());
         vos = service.doInsert(context, AdmWindow.class, vos);
-        return AdmResponse.success(vos);
+        return AdmCreateResponse.success(vos);
     }
 
     /**

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

@@ -58,7 +58,7 @@ public class AdmComponent extends AdmBaseEntity<AdmComponent> {
         /** Revit族类型 */
         private String bimFamilySymbol;
         /** 部件序号 */
-        private Double equipSerial;
+        private String equipSerial;
 
         /** 部件关联部件的id */
         private String parentId;
@@ -67,11 +67,11 @@ public class AdmComponent extends AdmBaseEntity<AdmComponent> {
         /** 项目自定义类型 */
         private String customCategory;
         /** 任务状态 */
-        private Integer taskState;
+        private String taskState;
         /** 模型id */
         private String modelId;
         /** 贴码状态 */
-        private Integer codeType;
+        private String codeType;
         /** 备注 */
         private String note;
 

+ 3 - 3
src/main/java/com/persagy/proxy/object/model/AdmEquipment.java

@@ -83,7 +83,7 @@ public class AdmEquipment extends AdmBaseEntity<AdmEquipment> {
     /** Revit族类型 */
     private String bimFamilySymbol;
     /** 设备序号 */
-    private Double equipSerial;
+    private String equipSerial;
 
     /** 部件关联设备的id */
     private String parentId;
@@ -92,11 +92,11 @@ public class AdmEquipment extends AdmBaseEntity<AdmEquipment> {
     /** 项目自定义类型 */
     private String customCategory;
     /** 任务状态 */
-    private Integer taskState;
+    private String taskState;
     /** 模型id */
     private String modelId;
     /** 贴码状态 */
-    private Integer codeType  = 1;
+    private String codeType  = "1";
     /** 备注 */
     private String note;
 

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

@@ -40,7 +40,7 @@ public class AdmFloor extends AdmBaseEntity<AdmFloor> {
     /** 楼层顺序号 */
     private Integer floorSequenceID;
     /** 楼层常驻人数 */
-    private Integer permanentPeopleNum;
+    private Double permanentPeopleNum;
     /** 楼层编码 */
     private String floorIdentity;
 

+ 6 - 6
src/main/java/com/persagy/proxy/object/model/AdmISpace.java

@@ -42,15 +42,15 @@ public class AdmISpace {
     private String funcType;
 
     /** 井深 */
-    private Float depth;
+    private Double depth;
     /** 面宽 */
-    private Float width;
+    private Double width;
     /** 建筑面积 */
-    private Float buildArea;
+    private Double buildArea;
     /** 使用面积 */
-    private Float netArea;
+    private Double netArea;
     /** 高 */
-    private Float height;
+    private Double height;
 
     /** 图片 */
     private ArrayNode pic;
@@ -60,7 +60,7 @@ public class AdmISpace {
     private Integer permanentPeopleNum;
 
     /** 配电容量 */
-    private Float elecCap;
+    private Double elecCap;
     /** 污染等级 */
     private String pollutionDegree;
 

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

@@ -38,7 +38,7 @@ public class AdmShaft extends AdmBaseEntity<AdmShaft> {
     /** BIM模型中坐标 */
     private String bimLocation;
     /** 竖井顺序码 */
-    private Integer shaftSequenceId;
+    private String shaftSequenceId;
     /** 功能类型 */
     private String shaftfunctype;
 

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

@@ -8,7 +8,6 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 /**
@@ -46,26 +45,26 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     /** 图片 - 信息点里已存在的信息点不应在实体中重复定义为其他格式 */
     private ArrayNode pic;
     /** 空间是否受影响 */
-    private Integer state;
+    private String state;
     /** 空间常驻人数 */
-    private Integer permanentPeopleNum;
+    private Double permanentPeopleNum;
 
     /** 井深 */
-    private Float depth;
+    private Double depth;
     /** 面宽 */
-    private Float width;
+    private Double width;
     /** 建筑面积 */
-    private Float buildArea;
+    private Double buildArea;
     /** 使用面积 */
-    private Float netArea;
+    private Double netArea;
     /** 高 */
-    private Float height;
+    private Double height;
     /** 备注文字 */
     private String intro;
     /** 设计供冷功率 */
-    private Float ratedCoolingp;
+    private Double ratedCoolingp;
     /** 设计供热功率 */
-    private Float ratedHeatingp;
+    private Double ratedHeatingp;
     /** 空调形式 */
     private String acType;
     /** 空间朝向 */
@@ -74,19 +73,19 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     private String roomFuncType;
 
     /** 空间序号 */
-    private Float roomSerial;
+    private String roomSerial;
     /** 项目空间功能区类型 */
     private String projRoomFuncType;
     /** 设计照明功率 */
-    private Float ratedLightp;
+    private Double ratedLightp;
     /** 内外区分类 */
     private String zoneType;
     /** 租赁业态类型 */
-    private Integer tenantType;
+    private String tenantType;
     /** 所属租户 */
     private String tenant;
     /** 配电容量 */
-    private Float elecCap;
+    private Double elecCap;
     /** 污染等级 */
     private String pollutionDegree;
 

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

@@ -59,4 +59,13 @@ public interface IAdmEquipmentService extends IAdmBaseService<AdmEquipment> {
      * Update By lijie 2021/10/29 11:42
      */
     AdmResponse query(AdmQueryCriteria admQueryCriteria);
+
+    /**
+     * 查询对象设备类型
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    AdmResponse queryEquipClassCode(InstanceUrlParam context,AdmQueryCriteria request,Class<AdmEquipment> clazz);
 }

+ 12 - 0
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -342,4 +342,16 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
         }
         return isDealDataSucc;
     }
+
+    /**
+     * 查询对象设备类型
+     * @param context
+     * @param request
+     * @param clazz
+     * @return
+     */
+    @Override
+    public AdmResponse queryEquipClassCode(InstanceUrlParam context,AdmQueryCriteria request,Class<AdmEquipment> clazz){
+        return queryObjectClassCode(context,request,clazz);
+    }
 }

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

@@ -611,7 +611,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
                 	String height = node.get("height").asText();
                 	if (StrUtil.isNotBlank(height)) {
                         for (AdmSpace admSpace : spaces) {
-                            admSpace.setHeight(Float.parseFloat(height));
+                            admSpace.setHeight(Double.parseDouble(height));
                             resultList.add(admSpace);
                         }
 					}

+ 9 - 7
src/main/java/com/persagy/proxy/relation/controller/RelationSpInSiController.java

@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.CommonConstant;
 import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
+import com.persagy.proxy.adm.request.AdmCreateResponse;
 import com.persagy.proxy.relation.model.SiInSpBase;
 import com.persagy.proxy.relation.model.SiInSpBaseList;
 import com.persagy.proxy.adm.request.AdmCreateRequest;
@@ -81,26 +82,26 @@ public class RelationSpInSiController {
      * @return 创建的结果信息
      */
     @PostMapping("/link-sp")
-    public AdmResponse createSp(@RequestParam(value = "type", required = false) String type,
-                                @RequestBody SiInSpBaseList siInSpBaseList) {
+    public AdmCreateResponse createSp(@RequestParam(value = "type", required = false) String type,
+                                      @RequestBody SiInSpBaseList siInSpBaseList) {
         List<String> ispaceIdList = siInSpBaseList.getIspaceIdList();
         String spaceId = siInSpBaseList.getSpaceId();
         if (StrUtil.isEmpty(spaceId) || CollectionUtils.isEmpty(ispaceIdList)) {
            // return AdmResponse.failure("必填项:ispaceIdList(元空间id)、spaceId(空间id)");
-            return AdmResponse.success();
+            return AdmCreateResponse.success();
         }
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
         AdmRelationTypeEnum typeEnum = AdmRelationTypeEnum.SP2SI;
         String graphCode = typeEnum.getGraphCode();
         String relCode = typeEnum.getRelCode();
-        deleteBySpaceId(spaceId, context, typeEnum);
+        deleteBySpaceId(spaceId, context, typeEnum, type);
         List<RelationDTO> voList = new ArrayList<>();
         for (String ispaceId : ispaceIdList) {
-            RelationDTO relation = new RelationDTO(null, graphCode, relCode, siInSpBaseList.getZoneType(), spaceId, ispaceId);
+            RelationDTO relation = new RelationDTO(null, graphCode, relCode, type, spaceId, ispaceId);
             voList.add(relation);
         }
         service.doSave(context, voList);
-        return AdmResponse.success();
+        return AdmCreateResponse.success(voList);
     }
 
     /**
@@ -110,12 +111,13 @@ public class RelationSpInSiController {
      * @param context
      * @param typeEnum
      */
-    private void deleteBySpaceId(String spaceId, InstanceUrlParam context, AdmRelationTypeEnum typeEnum) {
+    private void deleteBySpaceId(String spaceId, InstanceUrlParam context, AdmRelationTypeEnum typeEnum, String zoneType) {
         QueryCriteria criteria = new QueryCriteria();
         ObjectNode node = JsonNodeFactory.instance.objectNode();
         node.put("graphCode", typeEnum.getGraphCode());
         node.put("relCode", typeEnum.getRelCode());
         node.put("objFrom", spaceId);
+        node.put("relValue", zoneType);
         criteria.setCriteria(node);
         service.doDelete(context, criteria);
     }

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

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.common.constant.ResponseCode;
+import com.persagy.proxy.adm.constant.AdmRelationTypeEnum;
 import com.persagy.proxy.adm.request.AdmDCSQueryRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -142,18 +143,11 @@ public class AdmSpaceInfoController {
 
 		request.setName(AdmISpace.OBJ_TYPE);
 		// 设置关系条件
-		request.resetRelationCond(false, null, "Sp2Si", objectType, null, false);
-		StringBuilder sb = new StringBuilder();
-		// 补充filter条件
-		if(StrUtil.isNotBlank(request.getFilters())) {
-			sb.append(request.getFilters()).append("; ");
-		}
+        AdmRelationTypeEnum typeEnum = AdmRelationTypeEnum.SP2SI;
+		request.resetRelationCond(false, null, typeEnum.getRelCode(), objectType, null, false);
 		// 补充楼层条件
 		if(StrUtil.isNotBlank(request.getFloorId())) {
-			sb.append("bimId startwith '").append(floor.getBimIdPre()).append("'; ");
-		}
-		if(sb.length() > 0) {
-			request.setFilters(sb.substring(0, sb.length() - 1));
+            request.addFilters("bimId startwith '"+floor.getBimIdPre()+"' ");
 		}
 		AdmResponse responseIspace = ispaceService.doQuery(AdmContextUtil.toDmpContext(),request, AdmISpace.class);
 		// 按照楼层轮廓线计算出不在轮廓线内的空间