From a9ae01ab32f08d0dadb1b12b0cc4db8070071b42 Mon Sep 17 00:00:00 2001 From: Ali Oezyetimoglu Date: Mon, 15 Aug 2022 09:27:23 +0200 Subject: [PATCH] RED-4891: Rectangle redactions not listed in DELTA view --- .../redaction/service/RedactionLogMergeService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/RedactionLogMergeService.java b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/RedactionLogMergeService.java index 994e07c3..3e93bc18 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/RedactionLogMergeService.java +++ b/redaction-service-v1/redaction-service-server-v1/src/main/java/com/iqser/red/service/redaction/v1/server/redaction/service/RedactionLogMergeService.java @@ -25,6 +25,8 @@ import com.iqser.red.service.persistence.service.v1.api.model.annotations.entity import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.configuration.Colors; import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileType; import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.type.Type; +import com.iqser.red.service.redaction.v1.model.Change; +import com.iqser.red.service.redaction.v1.model.ChangeType; import com.iqser.red.service.redaction.v1.model.ManualChange; import com.iqser.red.service.redaction.v1.model.ManualRedactionType; import com.iqser.red.service.redaction.v1.model.Point; @@ -100,7 +102,7 @@ public class RedactionLogMergeService { log.info("Merging Redaction log with manual redactions"); if (manualRedactions != null) { - var manualRedactionLogEntries = addManualAddEntries(sectionGrid, manualRedactions.getEntriesToAdd(), manualRedactions.getComments(), colors, types); + var manualRedactionLogEntries = addManualAddEntries(sectionGrid, manualRedactions.getEntriesToAdd(), manualRedactions.getComments(), colors, types, redactionLog.getAnalysisNumber()); redactionLog.getRedactionLogEntry().addAll(manualRedactionLogEntries); @@ -372,14 +374,14 @@ public class RedactionLogMergeService { public List addManualAddEntries(SectionGrid sectionGrid, Set manualAdds, Map> comments, Colors colors, - List types) { + List types, int analysisNumber) { List redactionLogEntries = new ArrayList<>(); for (ManualRedactionEntry manualRedactionEntry : manualAdds) { if (shouldCreateManualEntry(manualRedactionEntry)) { - RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), colors, types); + RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), colors, types, analysisNumber); redactionLogEntry.setPositions(convertPositions(manualRedactionEntry.getPositions())); redactionLogEntry.setComments(convert(comments.get(manualRedactionEntry.getAnnotationId()))); redactionLogEntry.setTextBefore(manualRedactionEntry.getTextBefore()); @@ -420,7 +422,7 @@ public class RedactionLogMergeService { private RedactionLogEntry createRedactionLogEntry(ManualRedactionEntry manualRedactionEntry, String id, - Colors colors, List types) { + Colors colors, List types, int analysisNumber) { var addToDictionary = manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDossierDictionary(); @@ -445,6 +447,7 @@ public class RedactionLogMergeService { .sectionNumber(-1) .rectangle(manualRedactionEntry.isRectangle()) .manualChanges(changeList) + .changes(List.of(new Change(analysisNumber + 1, ChangeType.ADDED, manualRedactionEntry.getRequestDate()))) .build(); }