|
@@ -1,15 +1,14 @@
|
|
|
package com.persagy.proxy.report.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import com.persagy.proxy.object.model.AdmBuilding;
|
|
|
-import com.persagy.proxy.object.model.AdmFloor;
|
|
|
import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
-import com.persagy.proxy.object.service.IAdmBuildingService;
|
|
|
-import com.persagy.proxy.object.service.IAdmFloorService;
|
|
|
import com.persagy.proxy.adm.utils.AdmContextUtil;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
+import com.persagy.proxy.object.model.AdmBuilding;
|
|
|
+import com.persagy.proxy.object.model.AdmFloor;
|
|
|
+import com.persagy.proxy.object.service.IAdmBuildingService;
|
|
|
+import com.persagy.proxy.object.service.IAdmFloorService;
|
|
|
import com.persagy.proxy.object.service.impl.AdmFloorServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -68,7 +67,6 @@ public class ComponentBuildingController {
|
|
|
if(CollUtil.isEmpty(buildings)) {
|
|
|
return;
|
|
|
}
|
|
|
- // 按建筑计算模型数量 - 这里先这样写,这种统计不太合理,统计建筑里所有楼层模型总计被使用次数。确认是否需要后再考虑是否移除
|
|
|
// 收集建筑下的楼层,处理信息点
|
|
|
List<AdmFloor> admFloors = new ArrayList<>(16);
|
|
|
for(AdmBuilding building:buildings) {
|
|
@@ -77,19 +75,21 @@ public class ComponentBuildingController {
|
|
|
continue;
|
|
|
}
|
|
|
admFloors.addAll(floors);
|
|
|
+ /** 20220117 新版ADM中,不再存在不同楼层使用同一模型的场景,此查询不需要有了。删除 */
|
|
|
+ // 按建筑计算模型数量 - 这里先这样写,这种统计不太合理,统计建筑里所有楼层模型总计被使用次数。确认是否需要后再考虑是否移除
|
|
|
// 收集所有模型Id
|
|
|
- List<Object> modelIds = CollUtil.getFieldValues(floors, "modelId", true);
|
|
|
- if(CollUtil.isEmpty(modelIds)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- // 查询模型使用次数
|
|
|
- AdmQueryCriteria floorCriteria = new AdmQueryCriteria();
|
|
|
- String inSql = CollUtil.join(modelIds, StrUtil.COMMA,"'","'");
|
|
|
- floorCriteria.setFilters(" modelId in (" + inSql + ") ");
|
|
|
- floorCriteria.setOnlyCount(true);
|
|
|
- AdmResponse floorRs = floorService.query(floorCriteria);
|
|
|
- // 设置次数
|
|
|
- building.setCount(floorRs.getCount());
|
|
|
+// List<Object> modelIds = CollUtil.getFieldValues(floors, "modelId", true);
|
|
|
+// if(CollUtil.isEmpty(modelIds)) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// // 查询模型使用次数
|
|
|
+// AdmQueryCriteria floorCriteria = new AdmQueryCriteria();
|
|
|
+// String inSql = CollUtil.join(modelIds, StrUtil.COMMA,"'","'");
|
|
|
+// floorCriteria.setFilters(" modelId in (" + inSql + ") ");
|
|
|
+// floorCriteria.setOnlyCount(true);
|
|
|
+// AdmResponse floorRs = floorService.query(floorCriteria);
|
|
|
+// // 设置次数
|
|
|
+// building.setCount(floorRs.getCount());
|
|
|
}
|
|
|
floorService.ensureSpecialValues(AdmContextUtil.toDmpContext(), admFloors, AdmFloorServiceImpl.QUERY);
|
|
|
}
|