Pull request #582: RED-5809
Merge in RED/persistence-service from RED-5809 to master * commit 'a074180241ac4a8dd359e0a9e8988092475f3dea': RED-5809: removed unnecessary import RED-5809: updated processedTime when declining a requested image recategoration redaction RED-5809: updated processedTime when declining a requested force redaction RED-5809: updated processedTime when declining a requested force redaction
This commit is contained in:
commit
8589f8e188
@ -77,10 +77,10 @@ public class ForceRedactionPersistenceService {
|
||||
return new HashSet<>(forceRedactionRepository.findByFileIdIncludeDeletions(fileId, includeDeletions));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void markAsProcessed(String annotationId, String fileId) {
|
||||
|
||||
public void markAsProcessed(ManualForceRedaction e) {
|
||||
|
||||
forceRedactionRepository.markAsProcessed(new AnnotationEntityId(e.getAnnotationId(), e.getFileId()), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
forceRedactionRepository.markAsProcessed(new AnnotationEntityId(annotationId, fileId), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -78,10 +78,10 @@ public class ImageRecategorizationPersistenceService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void markAsProcessed(String annotationId, String fileId) {
|
||||
|
||||
public void markAsProcessed(ManualImageRecategorization e) {
|
||||
|
||||
imageRecategorizationRepository.markAsProcessed(new AnnotationEntityId(e.getAnnotationId(), e.getFileId()), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
imageRecategorizationRepository.markAsProcessed(new AnnotationEntityId(annotationId, fileId), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -618,7 +618,11 @@ public class ManualRedactionService {
|
||||
for (var annotationId : annotationIds) {
|
||||
var forceRedaction = forceRedactionPersistenceService.findForceRedaction(fileId, annotationId);
|
||||
forceRedactionPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
||||
actionPerformed = actionPerformed || !(forceRedaction.getStatus() == AnnotationStatus.REQUESTED && annotationStatus == AnnotationStatus.DECLINED);
|
||||
boolean isDeclined = forceRedaction.getStatus() == AnnotationStatus.REQUESTED && annotationStatus == AnnotationStatus.DECLINED;
|
||||
actionPerformed = actionPerformed || !isDeclined;
|
||||
if (isDeclined) {
|
||||
forceRedactionPersistenceService.markAsProcessed(annotationId, fileId);
|
||||
}
|
||||
}
|
||||
|
||||
if (actionPerformed) {
|
||||
@ -654,7 +658,11 @@ public class ManualRedactionService {
|
||||
for (var annotationId : annotationIds) {
|
||||
var imageRecategorization = recategorizationPersistenceService.findRecategorization(fileId, annotationId);
|
||||
recategorizationPersistenceService.updateStatus(fileId, annotationId, annotationStatus);
|
||||
actionPerformed = actionPerformed || !(imageRecategorization.getStatus() == AnnotationStatus.REQUESTED && annotationStatus == AnnotationStatus.DECLINED);
|
||||
boolean isDeclined = imageRecategorization.getStatus() == AnnotationStatus.REQUESTED && annotationStatus == AnnotationStatus.DECLINED;
|
||||
actionPerformed = actionPerformed || !isDeclined;
|
||||
if (isDeclined) {
|
||||
recategorizationPersistenceService.markAsProcessed(annotationId, fileId);
|
||||
}
|
||||
}
|
||||
|
||||
if (actionPerformed) {
|
||||
@ -752,14 +760,14 @@ public class ManualRedactionService {
|
||||
if (manualRedactions.getForceRedactions() != null) {
|
||||
manualRedactions.getForceRedactions().forEach(e -> {
|
||||
if (!e.getStatus().equals(AnnotationStatus.REQUESTED) && e.getProcessedDate() == null) {
|
||||
forceRedactionPersistenceService.markAsProcessed(e);
|
||||
forceRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||
}
|
||||
});
|
||||
}
|
||||
if (manualRedactions.getImageRecategorization() != null) {
|
||||
manualRedactions.getImageRecategorization().forEach(e -> {
|
||||
if (!e.getStatus().equals(AnnotationStatus.REQUESTED) && e.getProcessedDate() == null) {
|
||||
recategorizationPersistenceService.markAsProcessed(e);
|
||||
recategorizationPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user