RED-3452: Fixed undelete legal basis changes
This commit is contained in:
parent
400c602868
commit
5bd2b55359
@ -5,6 +5,7 @@ import java.time.OffsetDateTime;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileModel;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.hash.HashFunction;
|
||||
@ -293,6 +294,20 @@ public class FileService {
|
||||
}
|
||||
});
|
||||
|
||||
legalBasisChangePersistenceService.findLegalBasisChanges(fileId, true).forEach(annotation -> {
|
||||
if (annotation.getSoftDeletedTime().equals(softDeletedTime) || annotation.getSoftDeletedTime()
|
||||
.isAfter(softDeletedTime)) {
|
||||
legalBasisChangePersistenceService.undelete(fileId, annotation.getId().getAnnotationId());
|
||||
commentPersistenceService.findCommentsByAnnotationId(fileId, annotation.getId().getAnnotationId(), true)
|
||||
.forEach(comment -> {
|
||||
if (comment.getSoftDeletedTime().equals(softDeletedTime) || comment.getSoftDeletedTime()
|
||||
.isAfter(softDeletedTime)) {
|
||||
commentPersistenceService.undelete(comment.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
indexingService.addToIndexingQueue(IndexMessageType.UPDATE, dossierTemplateId, dossierId, fileId, 2);
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user