Browse Source

增加设备设施/楼层统计接口

linhuili 2 years ago
parent
commit
b82afbce02

+ 1 - 0
src/main/java/com/persagy/dmp/middleware/constant/enums/ClassCodeEnum.java

@@ -8,6 +8,7 @@ package com.persagy.dmp.middleware.constant.enums;
  **/
 public enum ClassCodeEnum {
 
+    WEGMMP("WEGMMP", "机械车位"),
     CFPKPS("CFPKPS", "停车位"),
     FIREZONE("FireZone", "防火分区");
 

+ 19 - 2
src/main/java/com/persagy/dmp/middleware/controller/EquipController.java

@@ -15,6 +15,7 @@ import com.persagy.dmp.middleware.service.IEquipService;
 import com.persagy.dmp.middleware.utils.EntityTransferUtil;
 import com.persagy.dmp.middleware.utils.SortUtil;
 import org.apache.commons.lang.StringUtils;
+import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -24,6 +25,8 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.ws.rs.QueryParam;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @ClassName ObjectInstanceController
@@ -58,7 +61,7 @@ public class EquipController {
         if(StringUtils.isEmpty(request.getBuildId())){
             throw new Exception("建筑ID不能为空");
         }
-        //查询设备空间信息
+        //查询设备,空间信息
         List<JSONObject> content = equipService.query(context, request);
         //对相同系统编码,相同类型名称 bimTypeId不一样的对象数据,类型合并
         content = EntityTransferUtil.combineData(content);
@@ -70,6 +73,21 @@ public class EquipController {
         return  response;
     }
 
+
+    private void setFloorId(List<JSONObject> content,CommonRequestDTO requestDTO){
+        if(CollUtil.isEmpty(content)){
+            return;
+        }
+        if(StringUtils.isNotEmpty(requestDTO.getFloorId())){
+            //直接设置对象所属楼层id
+            content.forEach(item->{
+                item.put("floorId",requestDTO.getFloorId());
+            });
+            return;
+        }
+        Set<String> spaceIds = content.stream().map(k->k.getString("id")).collect(Collectors.toSet());
+
+    }
     /**
      *  查询设备设施-暖通系统-全局-3D原理图相关的设备/阀门
      * @param projectId
@@ -264,5 +282,4 @@ public class EquipController {
     }
 
 
-
 }

+ 84 - 46
src/main/java/com/persagy/dmp/middleware/controller/FloorController.java

@@ -15,8 +15,10 @@ import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
 import com.persagy.dmp.middleware.entity.dto.FloorDTO;
 import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
 import com.persagy.dmp.middleware.entity.response.CommonResult;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
 import com.persagy.dmp.middleware.service.IBaseService;
 import com.persagy.dmp.middleware.service.IFloorService;
+import com.persagy.dmp.middleware.service.IObjectCountService;
 import com.persagy.dmp.middleware.service.ISpaceService;
 import com.persagy.dmp.middleware.utils.EntityTransferUtil;
 import com.persagy.dmp.middleware.utils.SortUtil;
@@ -52,6 +54,9 @@ public class FloorController {
     @Autowired
     private ISpaceService spaceService;
 
+    @Autowired
+    private IObjectCountService objectCountService;
+
     /**
      * 查询建筑下的楼层列表
      * @param projectId
@@ -82,13 +87,51 @@ public class FloorController {
     }
 
     /**
-     * 编辑楼层信息
+     * 查询楼层下的空间列表
      * @param projectId
      * @param list
      * @return
      * @throws Exception
      */
-    @PostMapping("/save")
+    @PostMapping("/queryFloorSpaceList")
+    public CommonResult queryFloorUnSpaceList(@QueryParam("groupCode") String groupCode,@QueryParam("projectId") String projectId,
+                                              @RequestBody List<CommonRequestDTO> list) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, null);
+        if(CollUtil.isEmpty(list)){
+            return new CommonResult();
+        }
+        List<JSONObject> result = new ArrayList<>();
+        for (CommonRequestDTO commonRequestDTO : list) {
+            if(StringUtils.isEmpty(commonRequestDTO.getFloorId())){
+                throw new Exception("楼层ID不能为空");
+            }
+            List<JSONObject> content = floorService.queryFloorUnSpaceList(context, commonRequestDTO);
+            JSONObject floorSpace = new JSONObject();
+            floorSpace.put("floorId",commonRequestDTO.getFloorId());
+            if(CollUtil.isNotEmpty(content)){
+                //类型名称相同的合并处理
+                content = EntityTransferUtil.combineData(content);
+                //按首字母,对象数量为0放后的规则进行排序
+                content = SortUtil.sortByCharacter(content, CommonConsant.OBJ_TYPE, CommonConsant.CLASS_NAME);
+            }
+            floorSpace.put("spaceInfos",content);
+            result.add(floorSpace);
+        }
+        //设置返回值
+        CommonResult<List<JSONObject>> response = CommonResult.success(result);
+        response.setCount(result == null ? 0 : Long.valueOf(result.size()));
+        return  response;
+    }
+
+    /**
+     * 编辑楼层基础信息
+     * @param projectId
+     * @param list
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/update")
     public CommonResult update(@QueryParam("groupCode") String groupCode,@QueryParam("projectId") String projectId,
                                   @RequestBody List<FloorDTO> list) throws Exception {
         // 组装上下文条件
@@ -100,26 +143,37 @@ public class FloorController {
         return  response;
     }
 
-
     /**
-     * 结果集处理
-     * @param content
+     * 保存楼层统计信息
+     * @param projectId
+     * @param list
      * @return
+     * @throws Exception
      */
-    private void handleResultList(List<JSONObject> content){
-        if(CollUtil.isEmpty(content)){
-           return ;
+    @PostMapping("/count/save")
+    public CommonResult countSave(@QueryParam("groupCode") String groupCode,@QueryParam("projectId") String projectId,
+                                  @RequestBody List<WdObjectCount> list) throws Exception {
+        // 组装上下文条件
+        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, null);
+        CommonResult<Object> response = new CommonResult<>();
+        if(CollUtil.isEmpty(list)){
+            return CommonResult.success(new ArrayList<>());
         }
-        for (JSONObject node : content) {
-            Double area = node.getDouble("area");
-            if(area == null){
-                node.put("area",0);
+        for (WdObjectCount wdObjectCount : list) {
+            if(StringUtils.isEmpty(wdObjectCount.getBuildId())){
+                throw new Exception("建筑id不能为空");
             }
-            Double height = node.getDouble("height");
-            if(height == null){
-                node.put("height",0);
+            if(StringUtils.isEmpty(wdObjectCount.getSystemCode())){
+                throw new Exception("系统编码不能为空");
+            }
+            if(StringUtils.isEmpty(wdObjectCount.getBimTypeId())){
+                throw new Exception("bimTypeId不能为空");
             }
         }
+        //保存楼层信息
+        objectCountService.save(context,list);
+        response.setContent(list);
+        return  response;
     }
 
     /**
@@ -143,6 +197,7 @@ public class FloorController {
         return  response;
     }
 
+
     /**
      *  查询/统计楼层下的设备,空间,阀门
      * @param projectId
@@ -172,43 +227,26 @@ public class FloorController {
         return  response;
     }
 
-
-
     /**
-     * 查询楼层下的空间列表
-     * @param projectId
-     * @param list
+     * 结果集处理
+     * @param content
      * @return
-     * @throws Exception
      */
-    @PostMapping("/queryFloorSpaceList")
-    public CommonResult queryFloorUnSpaceList(@QueryParam("groupCode") String groupCode,@QueryParam("projectId") String projectId,
-                                            @RequestBody List<CommonRequestDTO> list) throws Exception {
-        // 组装上下文条件
-        InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, null);
-        if(CollUtil.isEmpty(list)){
-            return new CommonResult();
+    private void handleResultList(List<JSONObject> content){
+        if(CollUtil.isEmpty(content)){
+            return ;
         }
-        List<JSONObject> result = new ArrayList<>();
-        for (CommonRequestDTO commonRequestDTO : list) {
-            if(StringUtils.isEmpty(commonRequestDTO.getFloorId())){
-                throw new Exception("楼层ID不能为空");
+        for (JSONObject node : content) {
+            Double area = node.getDouble("area");
+            if(area == null){
+                node.put("area",0);
             }
-            List<JSONObject> content = floorService.queryFloorUnSpaceList(context, commonRequestDTO);
-            JSONObject floorSpace = new JSONObject();
-            floorSpace.put("floorId",commonRequestDTO.getFloorId());
-            if(CollUtil.isNotEmpty(content)){
-                //类型名称相同的合并处理
-                content = EntityTransferUtil.combineData(content);
-                //按首字母,对象数量为0放后的规则进行排序
-                content = SortUtil.sortByCharacter(content, CommonConsant.OBJ_TYPE, CommonConsant.CLASS_NAME);
+            Double height = node.getDouble("height");
+            if(height == null){
+                node.put("height",0);
             }
-            floorSpace.put("spaceInfos",content);
-            result.add(floorSpace);
         }
-        //设置返回值
-        CommonResult<List<JSONObject>> response = CommonResult.success(result);
-        response.setCount(result == null ? 0 : Long.valueOf(result.size()));
-        return  response;
     }
+
+
 }

+ 16 - 0
src/main/java/com/persagy/dmp/middleware/dao/WdObjectCountMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.dmp.middleware.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @ClassName DefineTypeRelMapper
+ * @Description: 广联达关系映射DAO
+ * @Author linhuili
+ * @Date 2021/9/9 10:24
+ * @Version V1.0
+ **/
+@Mapper
+public interface WdObjectCountMapper extends BaseMapper<WdObjectCount> {
+}

+ 61 - 0
src/main/java/com/persagy/dmp/middleware/entity/vo/WdObjectCount.java

@@ -0,0 +1,61 @@
+package com.persagy.dmp.middleware.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @ClassName DefineTypeRel
+ * @Description: 对象统计
+ * @Author linhuili
+ * @Date 2022/4/19 15:01
+ * @Version V1.0
+ **/
+@Data
+@TableName(value = "wd_object_count", autoResultMap = true)
+public class WdObjectCount {
+
+    /** id */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /** 集团编码 */
+    private String groupCode;
+
+    /** 项目id */
+    private String projectId;
+
+    /** 建筑id */
+    private String buildId;
+
+    /** 楼层id */
+    private String floorId;
+
+
+    /** 系统编码 */
+    private String systemCode;
+
+    /** BIM构建编码 */
+    private String bimTypeId;
+
+    /** 类型名称 */
+    private String className;
+
+    /** 对象数量 */
+    private Integer count;
+
+    /** 对象面积 */
+    private Integer area;
+
+    /** 创建时间 */
+    private Date create_time;
+
+    /** 修改时间 */
+    private Date update_time;
+
+    /** 有效标示 1-有效 0-无效 */
+    private Integer valid;
+}

+ 9 - 0
src/main/java/com/persagy/dmp/middleware/service/IFloorService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
 import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
 import com.persagy.dmp.middleware.entity.response.CommonResult;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
 
 import java.util.List;
 
@@ -39,4 +40,12 @@ public interface IFloorService{
      * @return
      */
     List<JSONObject> queryFloorUnSpaceList(InstanceUrlParam context, CommonRequestDTO requestDTO);
+
+    /**
+     * 处理楼层统计数量
+     * @param requestDTO
+     * @param query
+     * @param objList
+     */
+    void handleFloorCountNum(CommonRequestDTO requestDTO, List<WdObjectCount> query, List<JSONObject> objList);
 }

+ 19 - 0
src/main/java/com/persagy/dmp/middleware/service/IObjectCountService.java

@@ -0,0 +1,19 @@
+package com.persagy.dmp.middleware.service;
+
+import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
+
+import java.util.List;
+
+/**
+ * 统计保存
+ *
+ * @author:linhuili
+ * @date:2022/4/20
+ */
+public interface IObjectCountService {
+
+    void save(InstanceUrlParam context ,List<WdObjectCount> wdObjectCounts);
+
+    List<WdObjectCount> query(InstanceUrlParam context,WdObjectCount wdObjectCount);
+}

+ 29 - 5
src/main/java/com/persagy/dmp/middleware/service/impl/EquipServiceImpl.java

@@ -14,10 +14,8 @@ import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
 import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
 import com.persagy.dmp.middleware.entity.response.CommonResult;
 import com.persagy.dmp.middleware.entity.vo.WdDefineTypeRel;
-import com.persagy.dmp.middleware.service.IBaseService;
-import com.persagy.dmp.middleware.service.IEquipService;
-import com.persagy.dmp.middleware.service.ISpaceService;
-import com.persagy.dmp.middleware.service.IWdDefineTypeRelService;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
+import com.persagy.dmp.middleware.service.*;
 import com.persagy.dmp.middleware.utils.EntityTransferUtil;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +43,12 @@ public class EquipServiceImpl implements IEquipService {
     @Autowired
     private IWdDefineTypeRelService iWdDefineTypeRelService;
 
+    @Autowired
+    private IObjectCountService objectCountService;
+
+    @Autowired
+    private IFloorService floorService;
+
     /**
      * 查询设备设施模块下的设备/阀门
      * @param context
@@ -53,16 +57,26 @@ public class EquipServiceImpl implements IEquipService {
      */
     @Override
     public List<JSONObject> query(InstanceUrlParam context, CommonRequestDTO request) {
+        //查询楼层统计信息
+        WdObjectCount wdObjectCount = new WdObjectCount();
+        wdObjectCount.setBuildId(request.getBuildId());
+        wdObjectCount.setFloorId(request.getFloorId());
+        List<WdObjectCount> query = objectCountService.query(context, wdObjectCount);
+
         //查询设备设施模块下的设备/阀门
         List<JSONObject> result = new ArrayList<>();
         //查询系统下的设备
         List<JSONObject> equipList = querySystemEquipList(context, request);
         if(CollUtil.isNotEmpty(equipList)){
+            //处理统计数量
+            floorService.handleFloorCountNum(request,query,equipList);
             result.addAll(equipList);
         }
         //查询系统下的阀门
         List<JSONObject> materiaList = querySystemMateriaList(context, request);
         if(CollUtil.isNotEmpty(materiaList)){
+            //处理统计数量
+            floorService.handleFloorCountNum(request,query,materiaList);
             result.addAll(materiaList);
         }
         return  result;
@@ -98,12 +112,22 @@ public class EquipServiceImpl implements IEquipService {
         queryCriteria.setCriteria(objectNode);
         CommonResult commonResult = baseService.doQuery(context, queryCriteria, JSONObject.class);
         List<JSONObject> spaceList = (List<JSONObject>) commonResult.getContent();
-
+        //查询关系
+        WdDefineTypeRel defineTypeRelSpace = new WdDefineTypeRel();
+        defineTypeRelSpace.setBimTypeId(CommonConsant.ACCCOT_SPACE_BIMTYPEID);
+        defineTypeRelSpace.setWdSystemCode(CommonConsant.WD_HAVC_SYSTEM_CODE);
+        List<WdDefineTypeRel> spaceDefineTypeRels = iWdDefineTypeRelService.query(context,defineTypeRelSpace);
+        List<JSONObject> spaceContent = combineQueryEquipResultData(spaceDefineTypeRels, spaceList, CommonConsant.ROOM_LOCAL_FUNC_TYPE_ID);
+        if(CollUtil.isNotEmpty(spaceContent)){
+            result.addAll(spaceContent);
+        }
+        /*result.addAll(spaceList);*/
         if(CollUtil.isNotEmpty(spaceList)){
             Set<String> spaceIds = spaceList.stream().map(k->k.getString("id")).collect(Collectors.toSet());
             request.setSpaceIds(spaceIds);
         }
 
+
         //3.查询空间下的设备/阀门
         List<JSONObject> content = spaceService.queryEquipInSpace(context, request, CommonConsant.ACCCOT_SPACE_BIMTYPEID);
         if(CollUtil.isNotEmpty(content)){

+ 212 - 10
src/main/java/com/persagy/dmp/middleware/service/impl/FloorServiceImpl.java

@@ -2,7 +2,6 @@ package com.persagy.dmp.middleware.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 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;
@@ -15,14 +14,16 @@ import com.persagy.dmp.middleware.entity.dto.CommonRequestDTO;
 import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
 import com.persagy.dmp.middleware.entity.response.CommonResult;
 import com.persagy.dmp.middleware.entity.vo.WdDefineTypeRel;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
 import com.persagy.dmp.middleware.service.*;
 import com.persagy.dmp.middleware.utils.EntityTransferUtil;
+import com.persagy.dmp.middleware.utils.SortUtil;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
-import java.util.stream.Collectors;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * @ClassName FloorServiceImpl
@@ -46,6 +47,9 @@ public class FloorServiceImpl implements IFloorService {
     @Autowired
     private IWdDefineTypeRelService iWdDefineTypeRelService;
 
+    @Autowired
+    private IObjectCountService objectCountService;
+
     /**
      * 统计楼层下各信息
      * @param context
@@ -54,19 +58,220 @@ public class FloorServiceImpl implements IFloorService {
      */
     @Override
     public CommonResult count(InstanceUrlParam context, CommonRequestDTO request) throws Exception {
-        ArrayNode result = JsonNodeFactory.instance.arrayNode();
+        List<JSONObject> result = new ArrayList<>();
+        JSONObject content = new JSONObject();
+
+        //1. 查询楼层统计信息
+        WdObjectCount wdObjectCount = new WdObjectCount();
+        wdObjectCount.setBuildId(request.getBuildId());
+        wdObjectCount.setFloorId(request.getFloorId());
+        List<WdObjectCount> query = objectCountService.query(context, wdObjectCount);
+
+        //2. 获取楼层基本信息
+        getFloorBaseInfo(context,request,content);
+        //处理统计数量
+        handleFloorBaseCountNum(request,query,content);
+
+        //3.查询楼层下的空间信息
+        List<JSONObject> spaceList = queryFloorSpaceList(context, request);
+        //处理统计数量
+        handleFloorCountNum(request,query,spaceList);
+        //类型名称相同的合并处理
+        spaceList = EntityTransferUtil.combineData(spaceList);
+        //按首字母,对象数量为0放后的规则进行排序
+        spaceList = SortUtil.sortByCharacter(spaceList, CommonConsant.OBJ_TYPE, CommonConsant.CLASS_NAME);
+        content.put("spaceInfos",spaceList);
+
+        //4.返回结果
+        result.add(content);
+        return CommonResult.success(content);
+    }
+
 
+    /**
+     *  处理楼层基本信息
+     * @param requestDTO
+     * @param query
+     * @param spaceList
+     */
+    @Override
+    public void handleFloorCountNum(CommonRequestDTO requestDTO,List<WdObjectCount> query,List<JSONObject> spaceList){
+        if(CollUtil.isEmpty(query) || CollUtil.isEmpty(spaceList)){
+            return;
+        }
+        if(StringUtils.isEmpty(requestDTO.getFloorId())){
+            //处理全楼层的
+            handleBuildCount(requestDTO,query,spaceList);
+            return;
+        }
+        //处理单层的
+        handleSingleFloorCount(requestDTO,query,spaceList);
+    }
+
+
+    /**
+     * 处理单楼层统计情况
+     * @param requestDTO
+     * @param query
+     * @param spaceList
+     */
+    private void handleBuildCount(CommonRequestDTO requestDTO,List<WdObjectCount> query,List<JSONObject> spaceList){
+        if(CollUtil.isEmpty(query)){
+            return;
+        }
+
+        //获取全局楼层统计情况,<buildId+"-"+systemCode+"-"+"bimTypeId",全集>
+        Map<String, List<WdObjectCount>> countMap = getWdObjectCount(query);
+        if(CollUtil.isEmpty(countMap)){
+            return;
+        }
+        String buildId = requestDTO.getBuildId();
+        for (JSONObject object : spaceList) {
+            String systemCode = object.getString("systemCode");
+            String bimTypeId = object.getString("bimTypeId");
+            List<WdObjectCount> wdObjectCounts = countMap.get(buildId + "-" + systemCode + "-" + bimTypeId);
+            if(CollUtil.isEmpty(wdObjectCounts)){
+                continue;
+            }
+            AtomicInteger allNum = new AtomicInteger();
+            wdObjectCounts.forEach(item->{
+                Integer count = item.getCount();
+                if(count == null){
+                    return;
+                }
+                allNum.addAndGet(count.intValue());
+
+            });
+            object.put("count", allNum == null ? 0 : allNum);
+        }
+    }
+
+    /**
+     * 获取万达统计情况
+     * @param query
+     * @return
+     */
+    private Map<String, List<WdObjectCount>>  getWdObjectCount(List<WdObjectCount> query){
+        Map<String, List<WdObjectCount>> countMap = new HashMap<>();
+        query.forEach(item->{
+            if(CollUtil.isEmpty(countMap)){
+                List<WdObjectCount> list = new ArrayList<>();
+                list.add(item);
+                countMap.put(item.getBuildId()+"-"+item.getSystemCode()+"-"+item.getBimTypeId(),list);
+                return;
+            }
+            List<WdObjectCount> wdObjectCounts = countMap.get(item.getBuildId() + "-" + item.getSystemCode() + "-" + item.getBimTypeId());
+            if(CollUtil.isEmpty(wdObjectCounts)){
+                wdObjectCounts = new ArrayList<>();
+            }
+            wdObjectCounts.add(item);
+            countMap.put(item.getBuildId()+"-"+item.getSystemCode()+"-"+item.getBimTypeId(),wdObjectCounts);
+        });
+        return countMap;
+    }
+
+    /**
+     * 处理单楼层统计情况
+     * @param requestDTO
+     * @param query
+     * @param spaceList
+     */
+    private void handleSingleFloorCount(CommonRequestDTO requestDTO,List<WdObjectCount> query,List<JSONObject> spaceList){
+        if(CollUtil.isEmpty(query)){
+            return;
+        }
+        Map<String, WdObjectCount> countMap = new HashMap<>();
+        query.forEach(item->{
+            countMap.put(item.getBuildId()+"-"+item.getFloorId()+"-"+item.getSystemCode()+"-"+item.getBimTypeId(),item);
+        });
+        String buildId = requestDTO.getBuildId();
+        String floorId = requestDTO.getFloorId();
+        for (JSONObject object : spaceList) {
+            String systemCode = object.getString("systemCode");
+            String bimTypeId = object.getString("bimTypeId");
+            WdObjectCount wdObjectCount = countMap.get(buildId + "-" + floorId + "-" + systemCode + "-" + bimTypeId);
+            if(wdObjectCount == null){
+                continue;
+            }
+            object.put("count",wdObjectCount.getCount());
+        }
+    }
+
+    /**
+     *  处理楼层基本信息
+     * @param requestDTO
+     * @param query
+     * @param content
+     */
+    private void handleFloorBaseCountNum(CommonRequestDTO requestDTO,List<WdObjectCount> query,JSONObject content){
+        if(CollUtil.isEmpty(query)){
+            return;
+        }
+        if(StringUtils.isEmpty(requestDTO.getFloorId())){
+            //处理全楼层的,暂时不需要统计
+            return;
+        }
+        //处理单层的
+        singleFloorBaseCount(requestDTO,query,content);
+    }
+
+    /**
+     * 处理单楼层统计情况
+     * @param requestDTO
+     * @param query
+     * @param content
+     */
+    private void singleFloorBaseCount(CommonRequestDTO requestDTO,List<WdObjectCount> query,JSONObject content){
+        if(CollUtil.isEmpty(query)){
+            return;
+        }
+        Map<String, WdObjectCount> countMap = new HashMap<>();
+        query.forEach(item->{
+            countMap.put(item.getBuildId()+"-"+item.getFloorId()+"-"+item.getSystemCode()+"-"+item.getBimTypeId(),item);
+        });
+
+        //楼层面积
+        WdObjectCount wdObjectCount = countMap.get(requestDTO.getBuildId() + "-" + requestDTO.getFloorId() + "-LC-buildArea");
+        if(wdObjectCount!= null){
+            content.put("buildArea",wdObjectCount.getArea());
+        }
+        //租赁面积
+        WdObjectCount wdObjectCountLease = countMap.get(requestDTO.getBuildId() + "-" + requestDTO.getFloorId() + "-LC-leaseArea");
+        if(wdObjectCountLease!= null){
+            content.put("leaseArea",wdObjectCountLease.getArea());
+        }
+        //该楼层各商铺数量
+        WdObjectCount wdObjectCountStoreNum = countMap.get(requestDTO.getBuildId() + "-" + requestDTO.getFloorId() + "-LC-storeNum");
+        if(wdObjectCountStoreNum!= null){
+            content.put("storeNum",wdObjectCountStoreNum.getCount());
+        }
+       //统计该楼层机动车位数量
+        WdObjectCount wdObjectCountCarNum = countMap.get(requestDTO.getBuildId() + "-" + requestDTO.getFloorId() + "-LC-countParkingCar");
+        if(wdObjectCountCarNum!= null){
+            content.put("countParkingCar",wdObjectCountCarNum.getCount());
+        }
+    }
+
+    /**
+     * 获取楼层基本信息
+     * @param context
+     * @param request
+     * @param content
+     * @throws Exception
+     */
+    private void getFloorBaseInfo(InstanceUrlParam context, CommonRequestDTO request,JSONObject content) throws Exception{
         //查询楼层信息
         List<JSONObject> floorList = queryFloorInfo(context, request);
         if(CollUtil.isEmpty(floorList)){
             throw new Exception("楼层不存在");
         }
         JSONObject floor = floorList.get(0);
-        ObjectNode content = JsonNodeFactory.instance.objectNode();
+
         //统计楼层面积
         content.put("buildArea",floor.getDouble(CommonConsant.FLOOR_AREA));
-        //统计租赁面积
-        content.put("leaseArea",floor.getDouble(CommonConsant.FLOOR_LEASE_AREA));
+        //统计租赁面积,默认返回0,不作初始化统计-20220330需求改
+        //content.put("leaseArea",floor.getDouble(CommonConsant.FLOOR_LEASE_AREA));
+        content.put("leaseArea",0);
         //统计该楼层各商铺数量
         Long storeNum = countStoreNum(context, request);
         content.put("storeNum",storeNum == null ? 0 : storeNum);
@@ -74,9 +279,6 @@ public class FloorServiceImpl implements IFloorService {
         //统计该楼层机动车位数量
         Long parkingCarNum = countParkingCar(context, request);
         content.put("countParkingCar",parkingCarNum == null ? 0 : parkingCarNum);
-
-        result.add(content);
-        return CommonResult.success(content);
     }
 
     /**
@@ -205,7 +407,7 @@ public class FloorServiceImpl implements IFloorService {
      */
     private Long countParkingCar(InstanceUrlParam context, CommonRequestDTO request){
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();
-        criteria.put(CommonConsant.CLASS_CODE, ClassCodeEnum.CFPKPS.getValue());
+        criteria.put(CommonConsant.CLASS_CODE, ClassCodeEnum.WEGMMP.getValue());
         QueryCriteria queryCriteria = EntityTransferUtil.transDmpRelationCriteria(criteria,RelationTypeEnum.MECHINARCH_EQ2FL.getGraphCode(),
                 RelationTypeEnum.MECHINARCH_EQ2FL.getRelCode(), request.getFloorId(), 1);
         CommonResult commonResult = baseService.doQuery(context, queryCriteria, JSONObject.class);

+ 115 - 0
src/main/java/com/persagy/dmp/middleware/service/impl/ObjectServiceImpl.java

@@ -0,0 +1,115 @@
+package com.persagy.dmp.middleware.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.dmp.common.constant.CommonConstant;
+import com.persagy.dmp.middleware.dao.WdObjectCountMapper;
+import com.persagy.dmp.middleware.entity.dto.InstanceUrlParam;
+import com.persagy.dmp.middleware.entity.vo.WdObjectCount;
+import com.persagy.dmp.middleware.service.IObjectCountService;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 对象统计保存
+ *
+ * @author:linhuili
+ * @date:2022/4/20
+ */
+@Service
+public class ObjectServiceImpl extends ServiceImpl<WdObjectCountMapper, WdObjectCount>  implements IObjectCountService {
+
+    @Autowired
+    private WdObjectCountMapper dao;
+
+    /**
+     * 保存统计信息
+     * @param wdObjectCounts
+     */
+    @Override
+    public void save(InstanceUrlParam context,List<WdObjectCount> wdObjectCounts) {
+        //创建默认条件
+        createDefaultValue(context,wdObjectCounts);
+
+        List<WdObjectCount> result = new ArrayList<>();
+        for (WdObjectCount objectCount : wdObjectCounts) {
+            List<WdObjectCount> content = queryWdObjectCount(objectCount);
+            if(CollUtil.isNotEmpty(content)){
+                WdObjectCount wdObjectCount = content.get(0);
+                if(objectCount.getCount()!=null){
+                    wdObjectCount.setCount(objectCount.getCount());
+                }
+                if(objectCount.getArea()!=null){
+                    wdObjectCount.setArea(objectCount.getArea());
+                }
+                result.add(wdObjectCount);
+            }else {
+                result.add(objectCount);
+            }
+        }
+        saveOrUpdateBatch(result);
+    }
+
+    /**
+     * 查询万达统计数量
+     * @param context
+     * @param wdObjectCount
+     * @return
+     */
+    @Override
+    public List<WdObjectCount> query(InstanceUrlParam context, WdObjectCount wdObjectCount) {
+        wdObjectCount.setGroupCode(context.getGroupCode());
+        wdObjectCount.setProjectId(context.getProjectId());
+        return queryWdObjectCount(wdObjectCount);
+    }
+
+    /**
+     * 查询wd统计数量
+     * @param objectCount
+     * @return
+     */
+    private List<WdObjectCount> queryWdObjectCount(WdObjectCount objectCount){
+        QueryWrapper<WdObjectCount> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("group_code",objectCount.getGroupCode());
+        queryWrapper.eq("project_id",objectCount.getProjectId());
+        queryWrapper.eq("build_id",objectCount.getBuildId());
+        if(StringUtils.isNotEmpty(objectCount.getFloorId())){
+            queryWrapper.eq("floor_id",objectCount.getFloorId());
+        }
+        if(StringUtils.isNotEmpty(objectCount.getSystemCode())){
+            queryWrapper.eq("system_code",objectCount.getSystemCode());
+        }
+        if(StringUtils.isNotEmpty(objectCount.getBimTypeId())){
+            queryWrapper.eq("bim_type_id",objectCount.getBimTypeId());
+        }
+        queryWrapper.eq("valid",1);
+       return dao.selectList(queryWrapper);
+    }
+
+
+    /**
+     * 创建默认条件
+     * @param voList
+     */
+    private void createDefaultValue(InstanceUrlParam context,List<WdObjectCount> voList){
+        String groupCode = context.getGroupCode();
+        if(StringUtils.isEmpty(groupCode)){
+            //默认集团
+            groupCode = CommonConstant.DEFAULT_ID;
+        }
+        String projectId = context.getProjectId();
+        if(StringUtils.isEmpty(projectId)){
+            //默认项目
+            projectId = CommonConstant.DEFAULT_ID;
+        }
+        for (WdObjectCount vo : voList) {
+            vo.setGroupCode(groupCode);
+            vo.setProjectId(projectId);
+        }
+    }
+}

+ 8 - 1
src/main/java/com/persagy/dmp/middleware/utils/EntityTransferUtil.java

@@ -16,6 +16,7 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.BeanUtils;
 
 import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
 /**
@@ -206,15 +207,21 @@ public class EntityTransferUtil {
 
             JSONObject wdDefineTypeRel = new JSONObject();
             JSONArray allObjects = new JSONArray();
+            int allNum =0;
             for (JSONObject object : value) {
                 wdDefineTypeRel = object;
                 JSONArray objects = object.getJSONArray("objects");
                 if(objects != null && objects.size()>0){
                     allObjects.addAll(objects);
                 }
+                Integer count = object.getInteger("count");
+                if(count == null){
+                    continue;
+                }
+                allNum += count.intValue();
             }
             wdDefineTypeRel.put("objects",allObjects);
-            wdDefineTypeRel.put("count",allObjects == null ? 0 : allObjects.size());
+            wdDefineTypeRel.put("count",allNum);
 
             result.add(wdDefineTypeRel);
         }

+ 70 - 13
src/main/resources/db.init/schema.sql

@@ -1,17 +1,71 @@
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
+CREATE TABLE IF NOT EXISTS  "wd_construct_description" (
+"id" int NOT NULL AUTO_INCREMENT,
+"wd_system_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '万达系统编码',
+"floor_id" varchar(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '楼层id',
+"remark" text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '说明',
+"group_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '集团编码',
+"project_id" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '项目id',
+"valid" int DEFAULT '1',
+"create_time" datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+"update_time" datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin;
 
-DROP TABLE IF EXISTS `define_type_rel`;
-CREATE TABLE `define_type_rel` (
-`id` int(40) NOT NULL AUTO_INCREMENT,
-`model_code` varchar(40) COLLATE utf8_bin DEFAULT NULL COMMENT '所属功能模块编码',
-`system_code` varchar(40) COLLATE utf8_bin NOT NULL COMMENT '系统编码',
-`system_name` varchar(40) COLLATE utf8_bin DEFAULT NULL COMMENT '系统名称',
-`bim_type_id` varchar(40) COLLATE utf8_bin DEFAULT NULL COMMENT 'BIM构建编码',
-`class_name` varchar(40) COLLATE utf8_bin NOT NULL COMMENT '类型名称',
-`obj_type` varchar(40) COLLATE utf8_bin DEFAULT NULL COMMENT '对象类型:space,equipment,materia',
-PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=555 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+CREATE TABLE IF NOT EXISTS  "wd_define_type_rel" (
+"id" int NOT NULL AUTO_INCREMENT,
+"wd_model_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '所属功能模块编码',
+"wd_system_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '系统编码',
+"wd_system_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '系统名称',
+"bim_type_id" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'BIM构建编码',
+"wd_class_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型名称',
+"obj_type" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '对象类型:space,equipment,materia',
+"wd_class_code" varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=1219 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin;
+
+CREATE TABLE IF NOT EXISTS "wd_equip_type_rel" (
+"id" int NOT NULL AUTO_INCREMENT,
+"system_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '系统编码',
+"system_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '系统名称',
+"bim_type_id" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'BIM构建编码',
+"class_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型名称',
+PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=731 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin;
+
+
+CREATE TABLE  IF NOT EXISTS "wd_materia_type_rel" (
+"id" int NOT NULL AUTO_INCREMENT,
+"system_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '系统编码',
+"bim_type_id" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'BIM构建编码',
+"class_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型名称',
+"class_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=4681 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin;
+
+CREATE TABLE  IF NOT EXISTS "wd_space_type_rel" (
+"id" int NOT NULL AUTO_INCREMENT,
+"model_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '所属功能模块编码',
+"system_code" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '系统编码',
+"system_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '系统名称',
+"bim_type_id" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'BIM构建编码',
+"class_name" varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型名称',
+PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=626 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin;
+
+
+CREATE TABLE  IF NOT EXISTS "wd_object_count" (
+    "id" int NOT NULL AUTO_INCREMENT COMMENT 'id',
+     "group_code" varchar(40) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '集团编码',
+    "project_id" varchar(40) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目id',
+    "build_id" varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '建筑id',
+    "floor_id" varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '楼层id',
+    "system_code" varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '系统编码',
+    "bim_type_id" varchar(200) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'BIM构建编码',
+    "class_name" varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型名称',
+    "count" int DEFAULT NULL COMMENT '对象数量',
+    "area" double(10,2) DEFAULT NULL,
+    "valid" int DEFAULT '1',
+    "create_time" datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+    "update_time" datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY ("id")
+) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

+ 195 - 142
src/main/resources/md/管理说明书接口缺失整理-后台.md

@@ -4,7 +4,7 @@
 
 注:可直接使用接口2:增加返回值(兼容工程信息化/data/plaza/floor接口的gcname字段)
 
-## 2. 楼层简介查询(楼层功能)
+## 2. 楼层简介查询(楼层功能-全局- 20220330接口增加返回参数
 
 接口名称:http://<ip>:<port>/floor/queryList?groupCode=集团编码&projectId=项目id
 
@@ -29,9 +29,9 @@
        “localId”:"#1",    //楼层本地编码
        "localName":"B2",  //楼层本地名称
        "wD_gcname":"B2",  //工程信息化楼层名称  
-       "height":50,  //高度
-       "area":120,    //面积
-       "floorIntro":"***"  //楼层简介 (20220418新增)
+       "height":50,  //楼层高度
+       "area":120,    //楼层面积
+       "floorSpaceIntro":"***"  //楼层简介 (20220330需求新增)
     }
    ]
 }
@@ -39,82 +39,133 @@
 
 注:增加信息点-楼层名称B02
 
-## 3. 查询楼层基本信息(楼层功能 - 单层)
+## 3. 查询楼层下的空间信息 -20220330需求新增
 
-接口名称:http://<ip>:<port>/floor/count?groupCode=集团编码&projectId=项目id
+接口名称:http://<ip>:<port>/floor/queryFloorSpaceList?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
 ```
-
-{
-    “buildId”:"****",   //建筑id(必传)
-    "floorId":"****",   //楼层id (必传)
-}
+[{
+    “buildId”:"****",    //建筑id(必传)
+    "floorId":"****",    //楼层id (必传),
+    "systemCode":"****", //万达系统编码
+}]
 ```
 
 返回参数:
 
 ```
 {
-
    "result":"success"
    "count":12,
-   "content":[
-    {
-        "buildArea":****,  //建筑面积㎡ ,统计各楼层面积之和
-        "leaseArea":****,  //租赁面积㎡,统计各楼层租赁面积
-        “storeNum”:****,     //商铺数量
-        “motorVehicleNum”:****, //机动车车位 
-     }  
-   ]
+   "content":【
+   { 
+     "floorId":"楼层id",
+     "spaceInfos":[
+      {
+       “bimTypeId”:"***",  //BIM构建编码
+       “className”:"***",  //类型名称
+       “systemCode”:"***", //所属系统编码
+       "count":8,          //对象数量
+       “objects”:[         //空间
+          "id":“****”,         //id
+          "name":”****“,       //名称
+          “localId”:****,      //本地编码   
+          “localName”:****,    //本地名称(展示时使用此名称)
+          “bimId":"***",       //bimID
+          "bimLocation":"-178.1,126.3,225.9", //bim坐标
+          “bimTypeId”:"***",   //BIM构建编码
+          “systemCode”:"****",  //所属系统编码
+          “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
+          “objType”:"***",     //对象类型:equipment-设备,space-空间,material-阀门
+          “classCode”:"***"    //类型编码
+       ]
+     }
+    ]
+   }
+   】
 }
 ```
+## 4. 楼层简介信息编辑(楼层功能)- (20220330需求新增)
 
-​       注:排序规则:优先按数字是否为0排序,然后按类型名称首字母排序
+接口名称:http://<ip>:<port>/floor/update?groupCode=集团编码&projectId=项目id
 
-## 2. 楼层编辑(楼层功能)
+请求参数:
 
-接口名称:http://<ip>:<port>/floor/save?groupCode=集团编码&projectId=项目id
+```
+[
+ {
+     "buildId":"建筑id", //建筑id,必传
+     "floorId": "楼层id", //保存楼层下的统计数量时,必传
+     "信息点编码":"信息点值"  //待修改点信息点
+     "$remove": [ "要清除的信息点编码" ] //待删除的信息点,或可直接将信息点值置为null
+ }
+]
+```
+注:1.楼层功能中的楼层简介信息点编码:floorSpaceIntro, 2.设备设施中的楼层描述信息点编码:floorEquipIntro 
 
-请求参数:
+返回参数:
 
 ```
 {
-     "id":"楼层id", //楼层id,必传
-     "信息点编码": "信息点值",
-    "$remove": [ "要清除的信息点编码" ]
+	"result": "00000",
+	"message": "success",
+	"content": [
+		{
+			"id": "Fl370202000241428a84a18d4d98bbe5208554a23a1b"
+		}
+	]
 }
 ```
-注:1.楼层简介信息点编码:area, 2.楼层简介信息点编码:floorIntro ,3 租赁面积信息点编码:leaseArea
+## 5. 统计编辑(楼层功能/设备设施的统计保存) -20220330需求新增
+
+接口名称:http://<ip>:<port>/floor/count/save?groupCode=集团编码&projectId=项目id
+
+请求参数:
+
+```
+[
+ {
+     "buildId":"建筑id",     //建筑id,必传
+     "floorId": "楼层id",     //保存楼层下的统计数量时,必传
+     "systemCode":"LC",      //列表返回的systemCode(若保存楼层简介中的基本信息,如:租赁面积,商铺数量等时,传"LC"),必传
+     "bimTypeId":"3.2.5.6",  //列表返回的bimTypeId(若保存楼层简介中的基本信息,传对应的信息点编码,建筑面积:buildArea ,
+                              租赁面积:leaseArea,商铺数量:storeNum,机动车位数量:countParkingCar),必传,
+     "className":"***",       //统计中的空间/设备类型名称/信息点名称(建筑面积,租赁面积,商铺数量,机动车位数量,)                         
+     "count":10  ,           //统计数量,若为楼层基本信息,机动车位数量,商铺数量时,直接传值即可         
+     "area":20                //租赁面积,建筑面积
+ }
+]
+```
 
 返回参数:
 
 ```
 {
-
-   "result":"success"
-   "count":12,
-   "content":[
-    {
-       “id”:"Fl******",   //楼层id
-       “code”:"#1",    //楼层本地编码
-       "floorIntro":"" //楼层简介
-    }
-   ]
+	"result": "00000",
+	"message": "success",
+	"content": [
+		{
+			"id": "Fl370202000241428a84a18d4d98bbe5208554a23a1b"
+		}
+	]
 }
 ```
 
-## 4. 查询/统计楼层下的设备空间(楼层功能 - 单层)
+注:具体信息点编码参考中台数据字典定义
 
-接口名称:http://<ip>:<port>/floor/query?groupCode=集团编码&projectId=项目id
+## 6. 查询楼层基本信息(楼层功能 - 单层) -20220330需求修改
+
+接口名称:http://<ip>:<port>/floor/count?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
 ```
+
 {
-    “buildId”:"****",    //建筑id(必传)
-    "floorId":"****",    //楼层id (必传,不传查全楼
+    “buildId”:"****",   //建筑id(必传)
+    "floorId":"****",   //楼层id (必传)
 }
 ```
 
@@ -122,46 +173,55 @@
 
 ```
 {
+
    "result":"success"
    "count":12,
    "content":[
-     {
-       “bimTypeId”:"***",  //BIM构建编码,设备/阀门类型的唯一编码
-       “className”:"***",  //类型名称
-       “systemCode”:"***", //所属系统编码
-       "count":8,          //对象数量
-       “objects”:[         //设备
-          "id":“****”,         //id
-          "name":”****“,       //名称
-          “localId”:****,      //本地编码   
-          “localName”:****,    //本地名称(展示时使用此名称)
-          “bimId":"***",       //bimID
-          "bimLocation":"-178.1,126.3,225.9", //bim坐标
-          “bimTypeId”:"***",   //BIM构建编码
-          “systemCode”:"****",  //所属系统编码
-          “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
-          “objType”:"***",     //对象类型:equipment-设备,space-空间,material-阀门
-          “classCode”:"***"    //类型编码
-       ]
-     }
+    {
+        "buildArea":****,  //建筑面积㎡ ,统计各楼层面积之和
+        "leaseArea":****,  //租赁面积㎡,统计各楼层租赁面积
+        “storeNum”:****,     //商铺数量
+        “motorVehicleNum”:****, //机动车车位 
+        "spaceInfos":[  //空间信息 -20220330需求新增
+         {
+           “bimTypeId”:"***",  //BIM构建编码,设备/阀门类型的唯一编码
+           “className”:"***",  //类型名称
+           “systemCode”:"***", //所属系统编码
+           "count":8,          //对象数量
+           “objects”:[         //设备
+              "id":“****”,         //id
+              "name":”****“,       //名称
+              “localId”:****,      //本地编码   
+              “localName”:****,    //本地名称(展示时使用此名称)
+              “bimId":"***",       //bimID
+              "bimLocation":"-178.1,126.3,225.9", //bim坐标
+              “bimTypeId”:"***",   //BIM构建编码
+              “systemCode”:"****",  //所属系统编码
+              “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
+              “objType”:"***",     //对象类型:equipment-设备,space-空间,material-阀门
+              “classCode”:"***"    //类型编码
+           ]
+        }
+       }]
+     }  
    ]
 }
 ```
 
-注:具体信息点编码参考中台数据字典定义
+​       注:排序规则:优先按数字是否为0排序,然后按类型名称首字母排序
 
-## 4. 查询楼层下的空间
 
-接口名称:http://<ip>:<port>/floor/queryFloorSpaceList?groupCode=集团编码&projectId=项目id
+## 7. 查询/统计楼层下的设备空间(楼层功能 - 单层)
+
+接口名称:http://<ip>:<port>/floor/query?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
 ```
-[{
+{
     “buildId”:"****",    //建筑id(必传)
-    "floorId":"****",    //楼层id (必传),
-    "systemCode":"****", //万达系统编码
-}]
+    "floorId":"****",    //楼层id (非必传,不传查全楼)
+}
 ```
 
 返回参数:
@@ -170,16 +230,13 @@
 {
    "result":"success"
    "count":12,
-   "content":【
-   { 
-     "floorId":"楼层id",
-     "spaceInfos":[
-      {
-       “bimTypeId”:"***",  //BIM构建编码
+   "content":[
+     {
+       “bimTypeId”:"***",  //BIM构建编码,设备/阀门类型的唯一编码
        “className”:"***",  //类型名称
        “systemCode”:"***", //所属系统编码
        "count":8,          //对象数量
-       “objects”:[         //空间
+       “objects”:[         //设备
           "id":“****”,         //id
           "name":”****“,       //名称
           “localId”:****,      //本地编码   
@@ -193,15 +250,13 @@
           “classCode”:"***"    //类型编码
        ]
      }
-    ]
-   }
-   】
+   ]
 }
 ```
 
-注:具体信息点编码参考中台数据字典定义
 
-## 5. 查询/统计楼层下的设备空间(设备设施(通用)-全局/单层 )
+
+## 8. 查询/统计楼层下的设备空间(设备设施(通用)-全局/单层 )
 
 接口名称:http://<ip>:<port>/equip/query?groupCode=集团编码&projectId=项目id
 
@@ -233,6 +288,7 @@
           "name":”****“,       //名称
           “localId”:****,      //本地编码   
           “localName”:****,    //本地名称(展示时使用此名称)
+          “floorId”:****,      //楼层id - 20220310需求新增   
           “bimId":"***",       //bimID
           "bimLocation":"-178.1,126.3,225.9", //bim坐标
           “bimTypeId”:"***",   //BIM构建编码
@@ -248,49 +304,15 @@
 
 注:具体信息点编码参考中台数据字典定义
 
-## 6. 修改楼层基本信息及统计数量(设备设施(通用)-全局,设备设施(通用)-单层)-暂时不做
-
-注:楼层简介中的建筑面积修改后,清理zkt-monitor 中 redis 14号索引库的缓存
-
-## 7. 通过id查询对象详情 (设备设施(通用)-单空间/单设备)
-
-接口名称:http://<ip>:<port>/space/query?groupCode=集团编码&projectId=项目id
-
-请求参数:
-
-```
-{
-   “id”:"****",     //空间id/设备id
-}
-```
+## 9. 查询设备设施-供电系统-全局-楼层电井
 
-返回参数:
+注:zkt-sdk接口已实现,需增加返回电表号字段 - 后续新增信息点
 
-```
-{
-   "result":"success"
-   "count":12,
-   "content":[
-    {
-        "id":“****”,         //id
-        "name":”****“,       //名称
-        “localId”:****,      //本地编码   
-        “localName”:****,    //本地名称(展示时使用此名称)
-        “bimId":"***",       //bimID
-        "bimLocation":"-178.1,126.3,225.9", //bim坐标
-        “bimTypeId”:"***",   //BIM构建编码
-        “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
-        “objType”:"***",     //对象类型:equipment-设备,space-空间,material-阀门
-        “classCode”:"***"    //类型编码
-         ...                 //其它信息点参考中台数据字典
-     }  
-   ]
-}
-```
+## 10. 查询设备设施- 暖通系统-全局-3D原理图相关的设备/阀门
 
-## 8. 统计空间内的设备和阀门个数(设备设施(通用)-单空间)
+注:查询冷却塔设备类下的设备,制冷机房下的空间,制冷机房空间下的设备/阀门信息,所属系统编码
 
-接口名称:http://<ip>:<port>/space/rel/query?groupCode=集团编码&projectId=项目id
+接口名称:http://<ip>:<port>/equip/havcSystem/query?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
@@ -299,7 +321,6 @@
     “buildId”:"****",    //建筑id(非必传,楼层ID为空时,必传)
     "floorId":"****",    //楼层id (非必传,不传查全楼)
     “systemCode”:"****", //系统编码(必传)
-    “spaceId”:"*****"    //空间id(必传)
 }
 ```
 
@@ -326,21 +347,17 @@
          “bimTypeId”:"***",   //BIM构建编码
          “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
          “objType”:"***",     //对象类型:equipment-设备,material-阀门
-      ]
+       ]
      }
    ]
 }
 ```
 
-## 9. 查询设备设施-供电系统-全局-楼层电井
-
-注:zkt-sdk接口已实现,需增加返回电表号字段 - 后续新增信息点
-
-## 10. 查询设备设施- 暖通系统-全局-3D原理图相关的设备/阀门
+## 11. 设备设施-暖通系统-分集水器原理图查询
 
-注:查询冷却塔设备类下的设备,制冷机房空间下的设备/阀门信息,所属系统编码
+注:查询分水器、集水器类型下的对象信息,对象信息需要增加所属系统编码
 
-接口名称:http://<ip>:<port>/equip/havcSystem/query?groupCode=集团编码&projectId=项目id
+接口名称:http://<ip>:<port>/equip/subCatchment/query?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
@@ -348,7 +365,6 @@
 {
     “buildId”:"****",    //建筑id(非必传,楼层ID为空时,必传)
     "floorId":"****",    //楼层id (非必传,不传查全楼)
-    “systemCode”:"****", //系统编码(必传)
 }
 ```
 
@@ -356,7 +372,6 @@
 
 ```
 {
-
    "result":"success"
    "count":12,
    "content":[
@@ -381,11 +396,46 @@
 }
 ```
 
-## 11. 设备设施-暖通系统-分集水器原理图查询
 
-注:查询分水器、集水器类型下的对象信息,对象信息需要增加所属系统编码
+## 12. 通过id查询对象详情 (设备设施(通用)-单空间/单设备)
 
-接口名称:http://<ip>:<port>/equip/subCatchment/query?groupCode=集团编码&projectId=项目id
+接口名称:http://<ip>:<port>/space/query?groupCode=集团编码&projectId=项目id
+
+请求参数:
+
+```
+{
+   “id”:"****",     //空间id/设备id
+}
+```
+
+返回参数:
+
+```
+{
+   "result":"success"
+   "count":12,
+   "content":[
+    {
+        "id":“****”,         //id
+        "name":”****“,       //名称
+        “localId”:****,      //本地编码   
+        “localName”:****,    //本地名称(展示时使用此名称)
+        “bimId":"***",       //bimID
+        "bimLocation":"-178.1,126.3,225.9", //bim坐标
+        “bimTypeId”:"***",   //BIM构建编码
+        “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
+        “objType”:"***",     //对象类型:equipment-设备,space-空间,material-阀门
+        “classCode”:"***"    //类型编码
+         ...                 //其它信息点参考中台数据字典
+     }  
+   ]
+}
+```
+
+## 13. 统计空间内的设备和阀门个数(设备设施(通用)-单空间)
+
+接口名称:http://<ip>:<port>/space/rel/query?groupCode=集团编码&projectId=项目id
 
 请求参数:
 
@@ -393,6 +443,8 @@
 {
     “buildId”:"****",    //建筑id(非必传,楼层ID为空时,必传)
     "floorId":"****",    //楼层id (非必传,不传查全楼)
+    “systemCode”:"****", //系统编码(必传)
+    “spaceId”:"*****"    //空间id(必传)
 }
 ```
 
@@ -400,6 +452,7 @@
 
 ```
 {
+
    "result":"success"
    "count":12,
    "content":[
@@ -418,13 +471,13 @@
          “bimTypeId”:"***",   //BIM构建编码
          “outLine”:[{"x":123.2,"y":210,"z":227.9}],  //轮廓坐标
          “objType”:"***",     //对象类型:equipment-设备,material-阀门
-       ]
+      ]
      }
    ]
 }
 ```
 
-## 12. 防火分区数量统计
+## 14. 防火分区数量统计
 
 接口名称:http://<ip>:<port>/space/fireZone/query?groupCode=集团编码&projectId=项目id
 
@@ -470,7 +523,7 @@
 
 注:统计各消防分区下的空间数量,关联的主机编号,烟感数量,温感数量等。
 
-## 13. 查询各防火分区下的空间信息(-作废,可直接复用接口12,接口12返回该空间所有信息,包括空间轮廓线等)
+## 15. 查询各防火分区下的空间信息(-作废,可直接复用接口12,接口12返回该空间所有信息,包括空间轮廓线等)
 
 注:查询各防火分区下的空间信息
 
@@ -515,11 +568,11 @@
 }
 ```
 
-## 13. 主要材料查询(设备设施-土建装饰-全局)
+## 16. 主要材料查询(设备设施-土建装饰-全局)
 
 注:确认来源,数据是否来自于工程信息化
 
-## 14. 查询土建装饰设备设施说明
+## 17. 查询土建装饰设备设施说明
 
 接口名称:http://<ip>:<port>/equip/construction/query?groupCode=集团编码&projectId=项目id
 
@@ -548,7 +601,7 @@
 }
 ```
 
-## 15. 添加土建装饰设备设施说明
+## 18. 添加土建装饰设备设施说明
 
 接口名称:http://<ip>:<port>/equip/construction/insert?groupCode=集团编码&projectId=项目id
 
@@ -580,7 +633,7 @@
 }
 ```
 
-## 16. 修改土建装饰设备设施说明
+## 19. 修改土建装饰设备设施说明
 
 接口名称:http://<ip>:<port>/equip/construction/update?groupCode=集团编码&projectId=项目id
 
@@ -614,7 +667,7 @@
 }
 ```
 
-## 17. 删除土建装饰设备实施说明
+## 20. 删除土建装饰设备实施说明
 
 接口名称:http://<ip>:<port>/equip/construction/delete?groupCode=集团编码&projectId=项目id
 
@@ -641,7 +694,7 @@
 }
 ```
 
-## 18. 根据楼层获取地板对象
+## 21. 根据楼层获取地板对象
 
 接口名称:http://<ip>:<port>/equip/floorBoard/query?groupCode=集团编码&projectId=项目id