|
@@ -99,20 +99,24 @@ public class AdmModelRelServiceImpl extends AbstractAdmBaseServiceImpl<AdmModelR
|
|
|
@Override
|
|
|
public void processFloorCalState(InstanceUrlParam context, String modelId) {
|
|
|
resetContext(context);
|
|
|
- List<AdmFloor> floorList = queryFloorEntity(context, modelId, null);
|
|
|
- if(CollUtil.isEmpty(floorList)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Set<String> floorQueryTypes = getFloorQueryTypes(floorList);
|
|
|
- List<ObjectRelationProjectCal> needCals = relationCalService.queryCalRelByRelationType(context, floorQueryTypes);
|
|
|
- if(CollUtil.isEmpty(needCals)) {
|
|
|
- return;
|
|
|
+ try {
|
|
|
+ List<AdmFloor> floorList = queryFloorEntity(context, modelId, null);
|
|
|
+ if(CollUtil.isEmpty(floorList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Set<String> floorQueryTypes = getFloorQueryTypes(floorList);
|
|
|
+ List<ObjectRelationProjectCal> needCals = relationCalService.queryCalRelByRelationType(context, floorQueryTypes);
|
|
|
+ if(CollUtil.isEmpty(needCals)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //更新边类型计算状态:computationalState为2
|
|
|
+ needCals.forEach(item->{
|
|
|
+ item.setComputationalState(2);
|
|
|
+ });
|
|
|
+ relationCalService.updateObjectCalRel(context, needCals);
|
|
|
+ }finally {
|
|
|
+ AppContext.unload();
|
|
|
}
|
|
|
- //更新边类型计算状态:computationalState为2
|
|
|
- needCals.forEach(item->{
|
|
|
- item.setComputationalState(2);
|
|
|
- });
|
|
|
- relationCalService.updateObjectCalRel(context, needCals);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -126,14 +130,18 @@ public class AdmModelRelServiceImpl extends AbstractAdmBaseServiceImpl<AdmModelR
|
|
|
@Override
|
|
|
public void processRelObjects(InstanceUrlParam context, String oldBimId, String bimId, AdmFloor floor) {
|
|
|
resetContext(context);
|
|
|
- // 如果bimId不一致,则清空原来的楼层信息
|
|
|
- if(StrUtil.isNotBlank(oldBimId) && !StrUtil.equals(oldBimId, bimId)) {
|
|
|
- updateRelEquipments(context, oldBimId, floor, true);
|
|
|
- updateRelISpace(context, oldBimId, floor, true);
|
|
|
+ try {
|
|
|
+ // 如果bimId不一致,则清空原来的楼层信息
|
|
|
+ if(StrUtil.isNotBlank(oldBimId) && !StrUtil.equals(oldBimId, bimId)) {
|
|
|
+ updateRelEquipments(context, oldBimId, floor, true);
|
|
|
+ updateRelISpace(context, oldBimId, floor, true);
|
|
|
+ }
|
|
|
+ // 更新新关联的
|
|
|
+ updateRelEquipments(context, bimId, floor, false);
|
|
|
+ updateRelISpace(context, bimId, floor, false);
|
|
|
+ }finally {
|
|
|
+ AppContext.unload();
|
|
|
}
|
|
|
- // 更新新关联的
|
|
|
- updateRelEquipments(context, bimId, floor, false);
|
|
|
- updateRelISpace(context, bimId, floor, false);
|
|
|
}
|
|
|
/***
|
|
|
* Description: 重新设置一下上下文
|