pending add to dict

This commit is contained in:
Timo Bejan 2022-03-21 11:19:26 +02:00
parent 1bcf0a3f07
commit 50d9f4fec2

View File

@ -277,7 +277,7 @@ public class RedactionLogMergeService {
for (ManualRedactionEntry manualRedactionEntry : manualAdds) { for (ManualRedactionEntry manualRedactionEntry : manualAdds) {
if (!approvedAndShouldBeInDictionary(manualRedactionEntry)) { 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()));
@ -303,10 +303,10 @@ public class RedactionLogMergeService {
} }
private boolean approvedAndShouldBeInDictionary(ManualRedactionEntry manualRedactionEntry) { @SuppressWarnings("PMD.UselessParentheses")
private boolean shouldCreateManualEntry(ManualRedactionEntry manualRedactionEntry) {
return manualRedactionEntry.getStatus().equals(AnnotationStatus.APPROVED) && return (!manualRedactionEntry.isAddToDictionary() && !manualRedactionEntry.isAddToDossierDictionary())
(manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDossierDictionary()); || ((manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDictionary()) && manualRedactionEntry.getProcessedDate() == null);
} }