DM-357: fix idRemoval mark as processed logic
This commit is contained in:
parent
ccade4b5fd
commit
ed90b6a9cc
@ -284,18 +284,16 @@ public class ManualRedactionService {
|
|||||||
if (removeRedactionRequest.getComment() != null) {
|
if (removeRedactionRequest.getComment() != null) {
|
||||||
commentId = addComment(fileId, removeRedactionRequest.getAnnotationId(), removeRedactionRequest.getComment(), removeRedactionRequest.getUser()).getId();
|
commentId = addComment(fileId, removeRedactionRequest.getAnnotationId(), removeRedactionRequest.getComment(), removeRedactionRequest.getUser()).getId();
|
||||||
}
|
}
|
||||||
|
boolean matchingEntryFound = false;
|
||||||
if (!removeRedactionRequest.isRemoveFromDictionary() && AnnotationStatus.APPROVED.equals(removeRedactionRequest.getStatus())) {
|
if (!removeRedactionRequest.isRemoveFromDictionary() && AnnotationStatus.APPROVED.equals(removeRedactionRequest.getStatus())) {
|
||||||
boolean matchingEntryFound;
|
|
||||||
try {
|
try {
|
||||||
getRedactionLogEntry(redactionLog, removeRedactionRequest.getAnnotationId());
|
getRedactionLogEntry(redactionLog, removeRedactionRequest.getAnnotationId());
|
||||||
matchingEntryFound = true;
|
matchingEntryFound = true;
|
||||||
} catch (NotFoundException e) {
|
} catch (NotFoundException e) {
|
||||||
matchingEntryFound = false;
|
log.warn("No matching entry found in redaction log for annotation id {}", removeRedactionRequest.getAnnotationId());
|
||||||
}
|
}
|
||||||
|
|
||||||
requiresReAnalysis = requiresReAnalysis || matchingEntryFound;
|
requiresReAnalysis = requiresReAnalysis || matchingEntryFound;
|
||||||
if (!matchingEntryFound && idRemoval.isApproved()) {
|
|
||||||
removeRedactionPersistenceService.markAsProcessed(idRemoval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var removedFromDictionary = handleRemoveFromDictionary(redactionLog,
|
var removedFromDictionary = handleRemoveFromDictionary(redactionLog,
|
||||||
@ -307,7 +305,7 @@ public class ManualRedactionService {
|
|||||||
removeRedactionRequest.isRemoveFromAllDossiers(),
|
removeRedactionRequest.isRemoveFromAllDossiers(),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (!removedFromDictionary && idRemoval.isApproved()) {
|
if (!matchingEntryFound && !removedFromDictionary && idRemoval.isApproved()) {
|
||||||
removeRedactionPersistenceService.markAsProcessed(idRemoval);
|
removeRedactionPersistenceService.markAsProcessed(idRemoval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,8 +87,10 @@ public class RedactionLogMergeService {
|
|||||||
var manualRedactionWrappers = createManualRedactionWrappers(manualRedactions);
|
var manualRedactionWrappers = createManualRedactionWrappers(manualRedactions);
|
||||||
|
|
||||||
for (RedactionLogEntry entry : redactionLog.getRedactionLogEntry()) {
|
for (RedactionLogEntry entry : redactionLog.getRedactionLogEntry()) {
|
||||||
|
var applicableManualRedactions = manualRedactionWrappers.stream().filter(mr -> entry.getId().equals(mr.getId())).collect(Collectors.toList());
|
||||||
processRedactionLogEntry(manualRedactionWrappers.stream().filter(mr -> entry.getId().equals(mr.getId())).collect(Collectors.toList()), entry, types, colors);
|
if (!applicableManualRedactions.isEmpty()) {
|
||||||
|
processRedactionLogEntry(applicableManualRedactions, entry, types, colors);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry.isImported() && !entry.isRedacted()) {
|
if (entry.isImported() && !entry.isRedacted()) {
|
||||||
skippedImportedRedactions.add(entry.getId());
|
skippedImportedRedactions.add(entry.getId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user