Pull request #402: RED-3705 cleanup of deleted status
Merge in RED/persistence-service from RED-3705-cleanup to master * commit '12c34d1c0ef64b62dc56e2c7a5d429d64c61cd3b': RED-3800 code cleanup RED-3705 cleanup of deleted status
This commit is contained in:
commit
467c27d519
@ -1,6 +1,6 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file;
|
||||
|
||||
public enum ProcessingStatus {
|
||||
ANALYSE, DELETED, ERROR, FULLREPROCESS, IMAGE_ANALYZING, INDEXING, NER_ANALYZING, OCR_PROCESSING, PROCESSED, PROCESSING, REPROCESS, SURROUNDING_TEXT_PROCESSING, UNPROCESSED, FULL_PROCESSING
|
||||
ANALYSE, ERROR, FULLREPROCESS, IMAGE_ANALYZING, INDEXING, NER_ANALYZING, OCR_PROCESSING, PROCESSED, PROCESSING, REPROCESS, SURROUNDING_TEXT_PROCESSING, UNPROCESSED, FULL_PROCESSING
|
||||
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ public class FileStatusPersistenceService {
|
||||
|
||||
var now = OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS);
|
||||
|
||||
int countUpdate = fileRepository.setHardDelete(fileId, ProcessingStatus.DELETED, now, now, now);
|
||||
int countUpdate = fileRepository.setHardDelete(fileId, ProcessingStatus.PROCESSED, now, now, now);
|
||||
if (countUpdate == 0) {
|
||||
throw new NotFoundException("Unknown file=" + fileId);
|
||||
}
|
||||
@ -231,7 +231,7 @@ public class FileStatusPersistenceService {
|
||||
@Transactional
|
||||
public void softDelete(String fileId, OffsetDateTime softDeletedTime) {
|
||||
|
||||
int countUpdate = fileRepository.setSoftDelete(fileId, ProcessingStatus.DELETED, OffsetDateTime.now()
|
||||
int countUpdate = fileRepository.setSoftDelete(fileId, ProcessingStatus.PROCESSED, OffsetDateTime.now()
|
||||
.truncatedTo(ChronoUnit.MILLIS), softDeletedTime);
|
||||
if (countUpdate == 0) {
|
||||
throw new NotFoundException("Unknown file=" + fileId);
|
||||
|
||||
@ -150,7 +150,7 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
|
||||
void setLastManualChangeDate(String fileId, OffsetDateTime lastManualChangeDate, OffsetDateTime lastUpdated);
|
||||
|
||||
@Query("select f from FileEntity f join DossierEntity d on d.id = f.dossierId where f.workflowStatus <> 'APPROVED' and f.excludedFromAutomaticAnalysis = false " +
|
||||
"and ( f.processingStatus = 'PROCESSED' or f.processingStatus = 'UNPROCESSED' or f.processingStatus = 'DELETED' or f.processingStatus = 'ERROR' )" +
|
||||
"and ( f.processingStatus = 'PROCESSED' or f.processingStatus = 'UNPROCESSED' or f.processingStatus = 'ERROR' )" +
|
||||
"and d.softDeletedTime is null and d.hardDeletedTime is null and d.archivedTime is null ")
|
||||
List<FileEntity> getAllRelevantStatusesForReanalysisScheduler();
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.do
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.download.DownloadStatusValue;
|
||||
import com.iqser.red.service.redaction.report.v1.api.model.ReportResultMessage;
|
||||
import com.iqser.red.service.redaction.report.v1.api.model.StoredFileInformation;
|
||||
import com.iqser.red.service.redaction.v1.model.AnnotateRequest;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionLog;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -1 +1 @@
|
||||
update file set deleted = CURRENT_TIMESTAMP where deleted is null and hard_deleted_time is null and processing_status = 'DELETED';
|
||||
update file set deleted = CURRENT_TIMESTAMP, processing_status = 'PROCESSED' where deleted is null and hard_deleted_time is null and processing_status = 'DELETED';
|
||||
|
||||
@ -41,7 +41,6 @@ import com.iqser.red.service.peristence.v1.server.utils.MetricsPrinterService;
|
||||
import com.iqser.red.service.peristence.v1.server.utils.StorageIdUtils;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.client.PDFTronRedactionClient;
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileType;
|
||||
import com.iqser.red.service.redaction.v1.model.AnnotateResponse;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionLog;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionResult;
|
||||
import com.iqser.red.storage.commons.StorageAutoConfiguration;
|
||||
@ -181,7 +180,6 @@ public abstract class AbstractPersistenceServerServiceTest {
|
||||
});
|
||||
|
||||
|
||||
when(redactionClient.annotate(Mockito.any())).thenReturn(new AnnotateResponse("document".getBytes()));
|
||||
when(redactionClient.sections(Mockito.any())).thenReturn(new RedactionResult());
|
||||
when(redactionClient.getRedactionLog(Mockito.any())).thenReturn(new RedactionLog(1, 1,
|
||||
Lists.newArrayList(), null, 0, 0, 0, 0));
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<redaction-service.version>3.108.0</redaction-service.version>
|
||||
<redaction-service.version>3.114.0</redaction-service.version>
|
||||
<search-service.version>2.36.0</search-service.version>
|
||||
<pdftron-redaction-service.version>3.80.0</pdftron-redaction-service.version>
|
||||
<redaction-report-service.version>3.45.0</redaction-report-service.version>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user