RED-6098: Removed changing of reportEntries
This commit is contained in:
parent
4c6d04cf8a
commit
9465f763e6
@ -100,7 +100,7 @@ public class ExcelReportGenerationService {
|
||||
|
||||
|
||||
@Timed("redactmanager_generateExcelReport")
|
||||
public void generateExcelReport(List<ReportRedactionEntry> reportEntries,
|
||||
public void generateExcelReport(List<ReportRedactionEntry> allReportEntries,
|
||||
PlaceholderModel placeholderModel,
|
||||
String reportTemplateName,
|
||||
SXSSFWorkbook workbook,
|
||||
@ -111,10 +111,9 @@ public class ExcelReportGenerationService {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
if (!excelModel.isSkippedPlaceholderPresent()) {
|
||||
reportEntries = reportEntries.stream().filter(entry -> !entry.isSkipped()).collect(Collectors.toList());
|
||||
}
|
||||
List<ReportRedactionEntry> reportEntries = !excelModel.isSkippedPlaceholderPresent() ? allReportEntries.stream()
|
||||
.filter(entry -> !entry.isSkipped())
|
||||
.collect(Collectors.toList()) : allReportEntries;
|
||||
|
||||
try {
|
||||
|
||||
@ -376,7 +375,7 @@ public class ExcelReportGenerationService {
|
||||
return placeholderInput -> placeholderInput.getPlaceholderModel().getDossierAttributesValueByPlaceholder().get(placeholder);
|
||||
}
|
||||
|
||||
return switch(placeholder) {
|
||||
return switch (placeholder) {
|
||||
case FILE_NAME_PLACEHOLDER -> PlaceholderInput::getFilename;
|
||||
case PAGE_PLACEHOLDER -> input -> String.valueOf(input.getEntry().getPage());
|
||||
case PARAGRAPH_PLACEHOLDER -> input -> input.getEntry().getSection();
|
||||
@ -384,8 +383,10 @@ public class ExcelReportGenerationService {
|
||||
case JUSTIFICATION_PARAGRAPH_PLACEHOLDER, JUSTIFICATION_LEGAL_BASIS_PLACEHOLDER -> input -> input.getEntry().getJustificationParagraph();
|
||||
case JUSTIFICATION_REASON_PLACEHOLDER, JUSTIFICATION_TEXT_PLACEHOLDER -> input -> input.getEntry().getJustificationReason();
|
||||
case EXCERPT_PLACEHOLDER -> input -> input.getEntry().getExcerpt();
|
||||
case REDACTION_VALUE_PLACEHOLDER -> input -> input.getEntry().getValue() != null ? input.getEntry().getValue().replaceAll("\n", " ").replaceAll(" {2,}", " ") : input.getEntry()
|
||||
.getEntityDisplayName();
|
||||
case REDACTION_VALUE_PLACEHOLDER -> input -> input.getEntry().getValue() != null ? input.getEntry()
|
||||
.getValue()
|
||||
.replaceAll("\n", " ")
|
||||
.replaceAll(" {2,}", " ") : input.getEntry().getEntityDisplayName();
|
||||
case REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER -> input -> input.getEntry().getEntityDisplayName();
|
||||
case SKIPPED_PLACEHOLDER -> input -> input.getEntry().isSkipped() ? "true" : "false";
|
||||
default -> input -> "";
|
||||
|
||||
@ -82,7 +82,7 @@ public class WordReportGenerationService {
|
||||
|
||||
|
||||
@Timed("redactmanager_generateWordReport")
|
||||
public int generateWordReport(List<ReportRedactionEntry> reportEntries,
|
||||
public int generateWordReport(List<ReportRedactionEntry> allReportEntries,
|
||||
PlaceholderModel placeholderModel,
|
||||
String reportTemplateName,
|
||||
XWPFDocument doc,
|
||||
@ -92,8 +92,7 @@ public class WordReportGenerationService {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
// currently word reports should not contain skipped redactions
|
||||
reportEntries = reportEntries.stream().filter(entry -> !entry.isSkipped()).collect(Collectors.toList());
|
||||
List<ReportRedactionEntry>reportEntries = allReportEntries.stream().filter(entry -> !entry.isSkipped()).collect(Collectors.toList());
|
||||
|
||||
int sumOfChars = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user