pending add to dict

This commit is contained in:
Timo Bejan 2022-03-21 09:38:58 +02:00
parent 5db6db52e5
commit 91108a7299

View File

@ -277,6 +277,7 @@ public class RedactionLogMergeService {
for (ManualRedactionEntry manualRedactionEntry : manualAdds) { for (ManualRedactionEntry manualRedactionEntry : manualAdds) {
if (shouldCreateManualEntry(manualRedactionEntry)) {
RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), dossierTemplateId); RedactionLogEntry redactionLogEntry = createRedactionLogEntry(manualRedactionEntry, manualRedactionEntry.getAnnotationId(), dossierTemplateId);
redactionLogEntry.setPositions(convertPositions(manualRedactionEntry.getPositions())); redactionLogEntry.setPositions(convertPositions(manualRedactionEntry.getPositions()));
redactionLogEntry.setComments(comments.get(manualRedactionEntry.getAnnotationId())); redactionLogEntry.setComments(comments.get(manualRedactionEntry.getAnnotationId()));
@ -287,6 +288,7 @@ public class RedactionLogMergeService {
redactionLogEntries.add(redactionLogEntry); redactionLogEntries.add(redactionLogEntry);
} }
}
return redactionLogEntries; return redactionLogEntries;
} }
@ -300,6 +302,14 @@ public class RedactionLogMergeService {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
private boolean shouldCreateManualEntry(ManualRedactionEntry manualRedactionEntry) {
return (!manualRedactionEntry.isAddToDictionary() && !manualRedactionEntry.isAddToDossierDictionary())
|| ((manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDictionary()) && manualRedactionEntry.getProcessedDate() == null);
}
private RedactionLogEntry createRedactionLogEntry(ManualRedactionEntry manualRedactionEntry, String id, private RedactionLogEntry createRedactionLogEntry(ManualRedactionEntry manualRedactionEntry, String id,
String dossierTemplateId) { String dossierTemplateId) {