RED-7158-2 last layout processed time
This commit is contained in:
parent
8b6353157c
commit
f06f73c55c
@ -119,6 +119,7 @@ public class FileManagementController implements FileManagementResource {
|
|||||||
return getResponseEntityForPDFDocument(fileId, dossierId, FileType.ORIGIN, inline);
|
return getResponseEntityForPDFDocument(fileId, dossierId, FileType.ORIGIN, inline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Timed
|
@Timed
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasAuthority('" + DOWNLOAD_ORIGINAL_FILE + "')")
|
@PreAuthorize("hasAuthority('" + DOWNLOAD_ORIGINAL_FILE + "')")
|
||||||
@ -126,7 +127,12 @@ public class FileManagementController implements FileManagementResource {
|
|||||||
@PathVariable(FILE_ID) String fileId,
|
@PathVariable(FILE_ID) String fileId,
|
||||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline) {
|
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline) {
|
||||||
|
|
||||||
|
// Viewer Document Returns
|
||||||
|
if (storageService.objectExists(TenantContext.getTenantId(), StorageIdUtils.getStorageId(dossierId, fileId, FileType.VIEWER_DOCUMENT))) {
|
||||||
return getResponseEntityForPDFDocument(fileId, dossierId, FileType.VIEWER_DOCUMENT, inline);
|
return getResponseEntityForPDFDocument(fileId, dossierId, FileType.VIEWER_DOCUMENT, inline);
|
||||||
|
} else {
|
||||||
|
return getResponseEntityForPDFDocument(fileId, dossierId, FileType.ORIGIN, inline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,9 @@ public class FileEntity {
|
|||||||
@Column
|
@Column
|
||||||
private OffsetDateTime lastProcessed;
|
private OffsetDateTime lastProcessed;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private OffsetDateTime lastLayoutProcessed;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime lastIndexed;
|
private OffsetDateTime lastIndexed;
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.iqser.red.service.persistence.management.v1.processor.service;
|
|||||||
import static com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingQueueNames.LAYOUT_PARSING_REQUEST_QUEUE;
|
import static com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingQueueNames.LAYOUT_PARSING_REQUEST_QUEUE;
|
||||||
|
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -717,6 +718,12 @@ public class FileStatusService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateLayoutProcessedTime(String fileId) {
|
||||||
|
|
||||||
|
fileStatusPersistenceService.updateLayoutProcessedTime(fileId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int countSoftDeletedFiles(String dossierId) {
|
public int countSoftDeletedFiles(String dossierId) {
|
||||||
|
|
||||||
return fileStatusPersistenceService.countSoftDeletedFilesPerDossierId(dossierId);
|
return fileStatusPersistenceService.countSoftDeletedFilesPerDossierId(dossierId);
|
||||||
|
|||||||
@ -548,4 +548,10 @@ public class FileStatusPersistenceService {
|
|||||||
OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateLayoutProcessedTime(String fileId) {
|
||||||
|
|
||||||
|
fileRepository.updateLayoutProcessedTime(fileId, OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -220,6 +220,12 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
|
|||||||
@Query(value = "update FileEntity f set f.numberOfOCRedPages = :numberOfOCRedPages, f.numberOfPagesToOCR = :numberOfPagesToOCR, f.ocrEndTime = :ocrEndTime, " + " f.lastUpdated = :lastUpdated where f.id = :fileId")
|
@Query(value = "update FileEntity f set f.numberOfOCRedPages = :numberOfOCRedPages, f.numberOfPagesToOCR = :numberOfPagesToOCR, f.ocrEndTime = :ocrEndTime, " + " f.lastUpdated = :lastUpdated where f.id = :fileId")
|
||||||
void updateOCRStatus(String fileId, int numberOfPagesToOCR, int numberOfOCRedPages, OffsetDateTime ocrEndTime, OffsetDateTime lastUpdated);
|
void updateOCRStatus(String fileId, int numberOfPagesToOCR, int numberOfOCRedPages, OffsetDateTime ocrEndTime, OffsetDateTime lastUpdated);
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query(value = "update FileEntity f set f.lastLayoutProcessed = :offsetDateTime where f.id = :fileId")
|
||||||
|
void updateLayoutProcessedTime(String fileId, OffsetDateTime offsetDateTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,8 @@ public class LayoutParsingFinishedMessageReceiver {
|
|||||||
layoutParsingRequestIdentifierService.parseFileId(response.identifier()),
|
layoutParsingRequestIdentifierService.parseFileId(response.identifier()),
|
||||||
layoutParsingRequestIdentifierService.parsePriority(response.identifier()));
|
layoutParsingRequestIdentifierService.parsePriority(response.identifier()));
|
||||||
|
|
||||||
|
fileStatusService.updateLayoutProcessedTime(layoutParsingRequestIdentifierService.parseFileId(response.identifier()));
|
||||||
|
|
||||||
log.info("Received message {} in {}", response, MessagingConfiguration.OCR_STATUS_UPDATE_RESPONSE_QUEUE);
|
log.info("Received message {} in {}", response, MessagingConfiguration.OCR_STATUS_UPDATE_RESPONSE_QUEUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -153,3 +153,6 @@ databaseChangeLog:
|
|||||||
file: db/changelog/tenant/105-add-remove-watermark-to-dossier-template.yaml
|
file: db/changelog/tenant/105-add-remove-watermark-to-dossier-template.yaml
|
||||||
- include:
|
- include:
|
||||||
file: db/changelog/tenant/106-add-add-to-all-dossiers-to-resize-redactions.yaml
|
file: db/changelog/tenant/106-add-add-to-all-dossiers-to-resize-redactions.yaml
|
||||||
|
- include:
|
||||||
|
file: db/changelog/tenant/107-add-last-layout-processed-column.yaml
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
databaseChangeLog:
|
||||||
|
- changeSet:
|
||||||
|
id: add-last-layout-processed-column-to-file
|
||||||
|
author: timo
|
||||||
|
changes:
|
||||||
|
- addColumn:
|
||||||
|
columns:
|
||||||
|
- column:
|
||||||
|
name: last_layout_processed
|
||||||
|
type: TIMESTAMP WITHOUT TIME ZONE
|
||||||
|
tableName: file
|
||||||
@ -31,6 +31,7 @@ public class FileModel {
|
|||||||
private OffsetDateTime deleted;
|
private OffsetDateTime deleted;
|
||||||
private OffsetDateTime lastProcessed;
|
private OffsetDateTime lastProcessed;
|
||||||
private OffsetDateTime lastIndexed;
|
private OffsetDateTime lastIndexed;
|
||||||
|
private OffsetDateTime lastLayoutProcessed;
|
||||||
private OffsetDateTime lastManualChangeDate;
|
private OffsetDateTime lastManualChangeDate;
|
||||||
private int numberOfAnalyses;
|
private int numberOfAnalyses;
|
||||||
private String assignee;
|
private String assignee;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user