Only add redacted entries to redaction report

This commit is contained in:
deiflaender 2020-09-03 12:18:01 +02:00
parent f141e55a9c
commit 65c283e5eb

View File

@ -48,18 +48,19 @@ public class ReportGenerationService {
multiFileRedactionLog.getRedactionLogs().forEach(fileRedactionLog -> {
fileRedactionLog.getRedactionLogEntry().forEach(redactionLogEntry -> {
Set<Integer> pages = new HashSet<>();
redactionLogEntry.getPositions().forEach(position -> {
pages.add(position.getPage());
});
pages.forEach(page -> {
XWPFTableRow row = table.createRow();
row.getCell(0).setText(fileRedactionLog.getFilename());
row.getCell(1).setText(String.valueOf(page));
row.getCell(2).setText(String.valueOf(redactionLogEntry.getSectionNumber()));
row.getCell(3).setText(redactionLogEntry.getReason());
});
if(redactionLogEntry.isRedacted()) {
Set<Integer> pages = new HashSet<>();
redactionLogEntry.getPositions().forEach(position -> {
pages.add(position.getPage());
});
pages.forEach(page -> {
XWPFTableRow row = table.createRow();
row.getCell(0).setText(fileRedactionLog.getFilename());
row.getCell(1).setText(String.valueOf(page));
row.getCell(2).setText(String.valueOf(redactionLogEntry.getSectionNumber()));
row.getCell(3).setText(redactionLogEntry.getReason());
});
}
});
});