|
@@ -1,5 +1,6 @@
|
|
|
package com.persagy.proxy.adm.handler;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
@@ -7,8 +8,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
-import com.google.common.collect.Sets;
|
|
|
import com.persagy.dmp.common.context.AppContext;
|
|
|
import com.persagy.dmp.common.helper.SpringHelper;
|
|
|
import com.persagy.dmp.digital.entity.ObjectDigital;
|
|
@@ -60,13 +59,13 @@ public class SpaceRelationInfoHandler {
|
|
|
|
|
|
String floorId = request.getFloorId();
|
|
|
String buildingId = request.getBuildingId();
|
|
|
- Set<String> zoneTypeList = StrUtil.isNotEmpty(request.getZoneType()) ? Sets.newHashSet(request.getZoneType())
|
|
|
- : (request.getZoneTypeList() == null ? Sets.newHashSet() : request.getZoneTypeList());
|
|
|
+ Set<String> zoneTypeList = StrUtil.isNotEmpty(request.getZoneType()) ? CollUtil.newHashSet(request.getZoneType())
|
|
|
+ : (request.getZoneTypeList() == null ? CollUtil.newHashSet() : request.getZoneTypeList());
|
|
|
|
|
|
if (StrUtil.isNotBlank(buildingId) && StrUtil.isNotBlank(floorId) && !"isnull".equals(floorId)) {
|
|
|
// 当建筑ID不为空、楼层ID不为空时
|
|
|
String graphAndRelKey = GraphCodeEnum.ArchForArch.name() + AdmCommonConstant.UNDERLINE + RelCodeEnum.Sp2Fl.name();
|
|
|
- List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, Sets.newHashSet(buildingId), null);
|
|
|
+ List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, CollUtil.newHashSet(buildingId), null);
|
|
|
if (CollectionUtil.isNotEmpty(allRelations)) {
|
|
|
resultList = this.transferSpaceInfo(allRelations, buildingId, floorId);
|
|
|
}
|
|
@@ -78,7 +77,7 @@ public class SpaceRelationInfoHandler {
|
|
|
} else if (StrUtil.isNotBlank(buildingId) && StrUtil.isBlank(floorId) && !"isnull".equals(buildingId)) {
|
|
|
// 当建筑ID不为空、楼层ID为空时
|
|
|
String graphAndRelKey = GraphCodeEnum.ArchForArch.name() + AdmCommonConstant.UNDERLINE + RelCodeEnum.Sp2Bd.name();
|
|
|
- List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, Sets.newHashSet(buildingId), null);
|
|
|
+ List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, CollUtil.newHashSet(buildingId), null);
|
|
|
if (CollectionUtil.isNotEmpty(allRelations)) {
|
|
|
resultList = this.transferSpaceInfo(allRelations, buildingId, null);
|
|
|
}
|
|
@@ -89,15 +88,15 @@ public class SpaceRelationInfoHandler {
|
|
|
|
|
|
} else if (StrUtil.isBlank(buildingId) && StrUtil.isBlank(floorId)) {
|
|
|
// 直接获取所有的空间数据
|
|
|
- List<ObjectNode> spacelist = this.relationReportService.queryObjects(criteria, groupCode, projectId, null, zoneTypeList,
|
|
|
- Sets.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
+ List<ObjectNode> spacelist = this.relationReportService.queryObjects(criteria, groupCode, projectId, null, zoneTypeList,
|
|
|
+ CollUtil.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
resultList = this.fillSpaceInfo(spacelist, null, null);
|
|
|
}
|
|
|
|
|
|
result.put("zoneType", request.getZoneType());
|
|
|
result.put("floorId", request.getFloorId());
|
|
|
result.put("total", CollectionUtil.isEmpty(resultList) ? 0 : resultList.size());
|
|
|
- result.put("content", CollectionUtil.isEmpty(resultList) ? Lists.newArrayList() : resultList);
|
|
|
+ result.put("content", CollectionUtil.isEmpty(resultList) ? CollUtil.newArrayList() : resultList);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -118,7 +117,7 @@ public class SpaceRelationInfoHandler {
|
|
|
Set<String> floorIds = new HashSet<String>();
|
|
|
Set<String> notBuildSpace = new HashSet<String>();
|
|
|
// 获取所有的楼层ID集合
|
|
|
- List<ObjectRelation> relationObjects = this.queryObjectRelation(groupCode, projectId, GraphCodeEnum.ArchForArch.name(), RelCodeEnum.Fl2Bd.name(), null, Sets.newHashSet(buildingId));
|
|
|
+ List<ObjectRelation> relationObjects = this.queryObjectRelation(groupCode, projectId, GraphCodeEnum.ArchForArch.name(), RelCodeEnum.Fl2Bd.name(), null, CollUtil.newHashSet(buildingId));
|
|
|
|
|
|
// 获取所有楼层下的空间数据
|
|
|
if (CollectionUtil.isNotEmpty(relationObjects)) {
|
|
@@ -132,7 +131,7 @@ public class SpaceRelationInfoHandler {
|
|
|
spaceIds.add(objectRelation.getObjFrom());
|
|
|
}
|
|
|
// 再获取此建筑下,不是这些空间的空间
|
|
|
- relationObjects = this.queryObjectRelation(groupCode, projectId, GraphCodeEnum.ArchForArch.name(), RelCodeEnum.Sp2Bd.name(), null, Sets.newHashSet(buildingId));
|
|
|
+ relationObjects = this.queryObjectRelation(groupCode, projectId, GraphCodeEnum.ArchForArch.name(), RelCodeEnum.Sp2Bd.name(), null, CollUtil.newHashSet(buildingId));
|
|
|
for (ObjectRelation objectRelation : relationObjects) {
|
|
|
if (!spaceIds.contains(objectRelation.getObjFrom())) {
|
|
|
notBuildSpace.add(objectRelation.getObjFrom());
|
|
@@ -141,14 +140,14 @@ public class SpaceRelationInfoHandler {
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(notBuildSpace)){
|
|
|
// 获取所有的对象数据
|
|
|
- resultList = this.relationReportService.queryObjects(null, groupCode, projectId, notBuildSpace, zoneTypeList,
|
|
|
- Sets.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
+ resultList = this.relationReportService.queryObjects(null, groupCode, projectId, notBuildSpace, zoneTypeList,
|
|
|
+ CollUtil.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
this.fillSpaceInfo(resultList, buildingId, null);
|
|
|
}
|
|
|
} else {
|
|
|
// 获取所有的空间数据
|
|
|
String graphAndRelKey = GraphCodeEnum.MechInArch.name() + AdmCommonConstant.UNDERLINE + RelCodeEnum.Eq2Fl.name();
|
|
|
- List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, Sets.newHashSet(buildingId), null);
|
|
|
+ List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, CollUtil.newHashSet(buildingId), null);
|
|
|
if (CollectionUtil.isNotEmpty(allRelations)) {
|
|
|
resultList = this.transferSpaceInfo(allRelations, buildingId, null);
|
|
|
}
|
|
@@ -172,14 +171,14 @@ public class SpaceRelationInfoHandler {
|
|
|
Set<String> zoneTypeList, List<OrderItem> orderItem) {
|
|
|
List<ObjectNode> resultList = null;
|
|
|
// 获取所有的建筑ID集合
|
|
|
- List<ObjectNode> buildList = this.relationReportService.queryObjects(null, groupCode, projectId, null, null,
|
|
|
- Sets.newHashSet(AdmObjectType.BUILDING.getIndex()), orderItem);
|
|
|
+ List<ObjectNode> buildList = this.relationReportService.queryObjects(null, groupCode, projectId, null, null,
|
|
|
+ CollUtil.newHashSet(AdmObjectType.BUILDING.getIndex()), orderItem);
|
|
|
if (CollectionUtil.isNotEmpty(buildList)) {
|
|
|
for (ObjectNode objectNode : buildList) {
|
|
|
String buildingId = objectNode.get("id").asText();
|
|
|
// 获取所有的空间数据
|
|
|
String graphAndRelKey = GraphCodeEnum.MechInArch.name() + AdmCommonConstant.UNDERLINE + RelCodeEnum.Eq2Fl.name();
|
|
|
- List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, Sets.newHashSet(buildingId), null);
|
|
|
+ List<ObjectDigital> allRelations = this.relationObjectContext.queryAllRelations(groupCode, projectId, graphAndRelKey, null, CollUtil.newHashSet(buildingId), null);
|
|
|
if (CollectionUtil.isNotEmpty(allRelations)) {
|
|
|
// 获取所有的对象数据
|
|
|
resultList = this.transferSpaceInfo(allRelations, buildingId, null);
|
|
@@ -187,8 +186,8 @@ public class SpaceRelationInfoHandler {
|
|
|
}
|
|
|
} else {
|
|
|
// 获取所有的空间数据
|
|
|
- List<ObjectNode> spacelist = this.relationReportService.queryObjects(criteria, groupCode, projectId, null, zoneTypeList,
|
|
|
- Sets.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
+ List<ObjectNode> spacelist = this.relationReportService.queryObjects(criteria, groupCode, projectId, null, zoneTypeList,
|
|
|
+ CollUtil.newHashSet(AdmObjectType.SPACE.getIndex()), orderItem);
|
|
|
resultList = this.fillSpaceInfo(spacelist, null, null);
|
|
|
}
|
|
|
|
|
@@ -299,7 +298,7 @@ public class SpaceRelationInfoHandler {
|
|
|
*/
|
|
|
private List<ObjectRelation> queryObjectRelation(String groupCode, String projectId, String graphCode, String relCode, Set<String> objFroms, Set<String> objTos) {
|
|
|
List<ObjectRelation> relationObjects = this.relationReportService.findRelationObjects(groupCode, projectId, graphCode, relCode, objFroms, objTos);
|
|
|
- return CollectionUtil.isEmpty(relationObjects) ? Lists.newArrayList() : relationObjects;
|
|
|
+ return CollectionUtil.isEmpty(relationObjects) ? CollUtil.newArrayList() : relationObjects;
|
|
|
}
|
|
|
|
|
|
}
|