diff --git a/src/main/java/com/mauvaisetroupe/eadesignit/service/importfile/BusinessAndDataObjectExportService.java b/src/main/java/com/mauvaisetroupe/eadesignit/service/importfile/BusinessAndDataObjectExportService.java index 81d7247e..f2d25c2e 100644 --- a/src/main/java/com/mauvaisetroupe/eadesignit/service/importfile/BusinessAndDataObjectExportService.java +++ b/src/main/java/com/mauvaisetroupe/eadesignit/service/importfile/BusinessAndDataObjectExportService.java @@ -2,6 +2,7 @@ import com.mauvaisetroupe.eadesignit.domain.BusinessObject; import com.mauvaisetroupe.eadesignit.domain.DataObject; +import com.mauvaisetroupe.eadesignit.domain.LandscapeView; import com.mauvaisetroupe.eadesignit.repository.BusinessObjectRepository; import com.mauvaisetroupe.eadesignit.repository.DataObjectRepository; import com.mauvaisetroupe.eadesignit.service.importfile.util.ExcelUtils; @@ -54,6 +55,11 @@ protected void writeDatObjects(Sheet sheet) { headerRow.createCell(column++).setCellValue(DataObjectImportService.DATA_OBJECT_APPLICATION); List dataObjects = dataObjectRepository.findAllWithAllChildrens(); + int maxNbLandscape = dataObjects.stream().map(dob -> dob.getLandscapes().size()).mapToInt(v -> v).max().orElse(0); + for (int i = 1; i < maxNbLandscape + 1; i++) { + headerRow.createCell(column++).setCellValue(DataObjectImportService.LANDSCAPE_NAME_PREFIX + i); + } + for (DataObject datObject : dataObjects) { column = 0; Row row = sheet.createRow(rownb++); @@ -75,9 +81,14 @@ protected void writeDatObjects(Sheet sheet) { } column++; if (datObject.getApplication() != null) { - row.createCell(column++).setCellValue(datObject.getApplication().getName()); + row.createCell(column).setCellValue(datObject.getApplication().getName()); } column++; + if (datObject.getLandscapes() != null) { + for (LandscapeView landscape : datObject.getLandscapes()) { + row.createCell(column++).setCellValue(landscape.getDiagramName()); + } + } } List orphanBusinessObjects = businessObjectRepository