RED-4036: Ignore non entry placeholders in excel

This commit is contained in:
deiflaender 2022-05-13 16:56:04 +02:00
parent f1ebfef248
commit ca2a44f2b9

View File

@ -66,6 +66,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
@RequiredArgsConstructor
@SuppressWarnings("PMD")
public class ExcelTemplateReportGenerationService {
public void generateReport(List<ReportRedactionEntry> reportEntries,
@ -79,15 +80,15 @@ public class ExcelTemplateReportGenerationService {
for (Sheet sheet : workbook) {
addEntryRows(sheet, reportEntries, fileStatus.getFilename(), isLastFile);
for (ImagePlaceholder imagePlaceholder : placeholderModel.getImagePlaceholders()){
replacePlaceholdersForImagePlaceholder(workbook, sheet, imagePlaceholder);
}
for (String placeholder : placeholderModel.getPlaceholders()) {
String placeholderValue = getPlaceholderValue(placeholder, dossier, fileStatus, placeholderModel.getFileAttributePlaceHolders(), placeholderModel.getDossierAttributesPlaceholder());
if (placeholderValue != null) {
replacePlaceholdersForTextPlaceholder(sheet, placeholder, placeholderValue);
}
}
// for (ImagePlaceholder imagePlaceholder : placeholderModel.getImagePlaceholders()){
// replacePlaceholdersForImagePlaceholder(workbook, sheet, imagePlaceholder);
// }
// for (String placeholder : placeholderModel.getPlaceholders()) {
// String placeholderValue = getPlaceholderValue(placeholder, dossier, fileStatus, placeholderModel.getFileAttributePlaceHolders(), placeholderModel.getDossierAttributesPlaceholder());
// if (placeholderValue != null) {
// replacePlaceholdersForTextPlaceholder(sheet, placeholder, placeholderValue);
// }
// }
}
long end = System.currentTimeMillis();