RED-1666: Fixed duplicate justifications in report
This commit is contained in:
parent
74b8c06ca9
commit
f1487c4acd
@ -1,13 +1,16 @@
|
||||
package com.iqser.red.service.redaction.report.v1.server.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.iqser.red.service.configuration.v1.api.model.LegalBasisMapping;
|
||||
import com.iqser.red.service.redaction.report.v1.server.model.ReportRedactionEntry;
|
||||
import com.iqser.red.service.redaction.v1.model.ManualRedactionType;
|
||||
import com.iqser.red.service.redaction.v1.model.Rectangle;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionLog;
|
||||
import com.iqser.red.service.redaction.v1.model.Status;
|
||||
|
||||
@ -23,7 +26,7 @@ public class RedactionLogConverterService {
|
||||
|
||||
if (entry.isRedacted()) {
|
||||
|
||||
if(entry.isExcluded()){
|
||||
if (entry.isExcluded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -41,17 +44,21 @@ public class RedactionLogConverterService {
|
||||
return;
|
||||
}
|
||||
|
||||
entry.getPositions().forEach(position -> {
|
||||
reportEntries.add(new ReportRedactionEntry(position.getPage(), position.getTopLeft()
|
||||
.getX(), position.getTopLeft()
|
||||
.getY(), entry.getSection(), entry.getLegalBasis() + " " + legalBasisMappings.stream()
|
||||
.filter(lbm -> lbm.getReason().equalsIgnoreCase(entry.getLegalBasis()))
|
||||
.findAny()
|
||||
.map(LegalBasisMapping::getDescription)
|
||||
.orElse("")));
|
||||
});
|
||||
}
|
||||
Set<Integer> pages = new HashSet<>();
|
||||
for (Rectangle position : entry.getPositions()) {
|
||||
|
||||
if (pages.isEmpty() || !pages.contains(position.getPage())) {
|
||||
pages.add(position.getPage());
|
||||
reportEntries.add(new ReportRedactionEntry(position.getPage(), position.getTopLeft()
|
||||
.getX(), position.getTopLeft()
|
||||
.getY(), entry.getSection(), entry.getLegalBasis() + " " + legalBasisMappings.stream()
|
||||
.filter(lbm -> lbm.getReason().equalsIgnoreCase(entry.getLegalBasis()))
|
||||
.findAny()
|
||||
.map(LegalBasisMapping::getDescription)
|
||||
.orElse("")));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
reportEntries.sort((entry1, entry2) -> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user