|
@@ -111,12 +111,13 @@ public class AdmSystemController {
|
|
|
});
|
|
|
List<AdmSystem> unRelationSys = new ArrayList<>();
|
|
|
List<AdmSystem> admSystemList = new ArrayList<>(vos.size());
|
|
|
+ List<RelationDTO> relationDTOS = new ArrayList<>(vos.size());
|
|
|
vos.stream().forEach(admSystem -> {
|
|
|
if(CollUtil.isNotEmpty(admSystem.getBuildingFloorInfoList())){
|
|
|
List<AdmSystem> admSystems = service.doInsert(AdmContextUtil.toDmpContext(), AdmSystem.class, CollUtil.newArrayList(admSystem));
|
|
|
//添加关系
|
|
|
String systemId = admSystems.get(0).getId();
|
|
|
- List<RelationDTO> relationDTOS = new ArrayList<>(admSystem.getBuildingFloorInfoList().size());
|
|
|
+
|
|
|
admSystem.getBuildingFloorInfoList().forEach(info -> {
|
|
|
String floorId = info.get("FloorID") == null ? null : info.get("FloorID").textValue();
|
|
|
String buildID = info.get("BuildID") == null ? null : info.get("BuildID").textValue();
|
|
@@ -127,14 +128,14 @@ public class AdmSystemController {
|
|
|
relationDTOS.add(new RelationDTO(null, "MechForArch", "Sy2Bd", null, systemId , buildID));
|
|
|
}
|
|
|
});
|
|
|
- if(CollUtil.isNotEmpty(relationDTOS)){
|
|
|
- relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOS);
|
|
|
- }
|
|
|
admSystemList.addAll(admSystems);
|
|
|
}else{
|
|
|
unRelationSys.add(admSystem);
|
|
|
}
|
|
|
});
|
|
|
+ if(CollUtil.isNotEmpty(relationDTOS)){
|
|
|
+ relationService.doSave(AdmContextUtil.toDmpContext(), relationDTOS);
|
|
|
+ }
|
|
|
if(CollUtil.isNotEmpty(unRelationSys)){
|
|
|
List<AdmSystem> systemList = service.doInsert(AdmContextUtil.toDmpContext(), AdmSystem.class, unRelationSys);
|
|
|
admSystemList.addAll(systemList);
|