|
@@ -127,7 +127,7 @@ public class AdmSpaceController {
|
|
|
ObjectNode node = JsonNodeFactory.instance.objectNode();
|
|
|
|
|
|
List<RelationDTO> relationDTOList = new ArrayList<>(vos.size());
|
|
|
- vos.stream().forEach(admSpace -> {
|
|
|
+ vos.forEach(admSpace -> {
|
|
|
//处理建筑 楼层信息点
|
|
|
int removeflBd = 0 ;//关系处理 0 不删除 1 删除bd 2 删除fl 3 都删除
|
|
|
if(StrUtil.isNotEmpty(admSpace.getFlowBuild())){
|
|
@@ -275,6 +275,12 @@ public class AdmSpaceController {
|
|
|
String id = requestData.getId();
|
|
|
String type = requestData.getType();//classCode
|
|
|
|
|
|
+ //更新实体
|
|
|
+ AdmSpace space = new AdmSpace();
|
|
|
+ space.setId(spaceId);
|
|
|
+ space.setObjectType(AdmSpace.OBJ_TYPE);
|
|
|
+ space.setClassCode(type);
|
|
|
+
|
|
|
/** 清除空间和建筑楼层的的数据 */
|
|
|
dealRelation(spaceId, queryCriteria,"Bd2Sp", false);
|
|
|
dealRelation(spaceId, queryCriteria,"Fl2Sp", false);
|
|
@@ -285,6 +291,7 @@ public class AdmSpaceController {
|
|
|
admQueryCriteria.setName(AdmFloor.OBJ_TYPE);
|
|
|
admQueryCriteria.setFilters("id = '"+id+"'");
|
|
|
AdmResponse admResponseFl = floorService.query(admQueryCriteria);
|
|
|
+
|
|
|
if(CollUtil.isNotEmpty(admResponseFl.getContent())){
|
|
|
AdmFloor floor = (AdmFloor) admResponseFl.getContent().get(0);
|
|
|
if (floor!=null){
|
|
@@ -303,11 +310,7 @@ public class AdmSpaceController {
|
|
|
rFl_up.setObjFrom(floor.getId());
|
|
|
RSpInFl_up.add(rFl_up);
|
|
|
|
|
|
- //更新实体
|
|
|
- AdmSpace space = new AdmSpace();
|
|
|
- space.setId(spaceId);
|
|
|
- space.setObjectType(AdmSpace.OBJ_TYPE);
|
|
|
- space.setClassCode(type);
|
|
|
+ //楼层 建筑信息点维护
|
|
|
space.setBuildingId(floor.getBuildingId());
|
|
|
space.setFloorId(floor.getId());
|
|
|
space_up.add(space);
|
|
@@ -331,17 +334,19 @@ public class AdmSpaceController {
|
|
|
rBd_up.setObjFrom(id);
|
|
|
RSpInBd_up.add(rBd_up);
|
|
|
|
|
|
- //更新实体
|
|
|
- AdmSpace space = new AdmSpace();
|
|
|
- space.setId(spaceId);
|
|
|
- space.setObjectType(AdmSpace.OBJ_TYPE);
|
|
|
- space.setClassCode(type);
|
|
|
+ //楼层 建筑信息点维护
|
|
|
space.setBuildingId(id);
|
|
|
Map<String, Object> info = new HashMap<>(1);
|
|
|
info.put("$remove",Arrays.asList("floorId"));
|
|
|
space.setInfos(info);
|
|
|
space_up.add(space);
|
|
|
}
|
|
|
+ }else{
|
|
|
+ //楼层 建筑信息点维护 清除
|
|
|
+ Map<String, Object> info = new HashMap<>(1);
|
|
|
+ info.put("$remove",Arrays.asList("floorId","buildingId"));
|
|
|
+ space.setInfos(info);
|
|
|
+ space_up.add(space);
|
|
|
}
|
|
|
});
|
|
|
service.doUpdate( AdmContextUtil.toDmpContext(), AdmSpace.class, space_up);
|