Merge branch 'RED-9782-fix-bp' into 'release/2.465.x'
RED-9782:Automated Analysis should be disabled when uploading a document that... See merge request redactmanager/persistence-service!666
This commit is contained in:
commit
272cc17fbc
@ -58,6 +58,7 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemp
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.mongo.service.EntityLogMongoService;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter;
|
||||
import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingType;
|
||||
import com.knecon.fforesight.service.ocr.v1.api.model.DocumentRequest;
|
||||
@ -100,6 +101,7 @@ public class FileStatusService {
|
||||
FileManagementServiceSettings fileManagementServiceSettings;
|
||||
LayoutParsingRequestFactory layoutParsingRequestFactory;
|
||||
ComponentMappingService componentMappingService;
|
||||
EntityLogMongoService entityLogMongoService;
|
||||
|
||||
WebsocketService websocketService;
|
||||
|
||||
@ -304,6 +306,13 @@ public class FileStatusService {
|
||||
|
||||
log.info("Add file: {} from dossier {} to Analysis queue with MessageType {}", fileId, dossierId, messageType);
|
||||
|
||||
// a full processing is supposed to happen when the FIRST manual reanalyze is executed for a file uploaded with imported redactions and disabled automatic analysis
|
||||
if (fileEntity.isExcludedFromAutomaticAnalysis()
|
||||
&& manualRedactionReanalyse
|
||||
&& analyseRequest.getAnalysisNumber() == 2
|
||||
&& entityLogMongoService.entityLogContainsImportedEntries(dossierId, fileId)) {
|
||||
analyseRequest.setMessageType(MessageType.ANALYSE);
|
||||
}
|
||||
if (messageType.equals(MessageType.REANALYSE)) {
|
||||
setStatusProcessing(fileId);
|
||||
} else {
|
||||
|
||||
@ -60,4 +60,8 @@ public interface EntityLogEntryDocumentRepository extends MongoRepository<Entity
|
||||
@Query(value = "{ 'entityLogId' : ?0}", delete = true)
|
||||
void deleteByEntityLogId(String entityLogId);
|
||||
|
||||
|
||||
@Query(value = "{ 'entityLogId': ?0, 'engines': 'IMPORTED' }", exists = true)
|
||||
boolean existsByEntityLogIdAndEngineImported(String entityLogId);
|
||||
|
||||
}
|
||||
|
||||
@ -333,4 +333,11 @@ public class EntityLogMongoService {
|
||||
entityLogDocumentUpdateService.updateEntityLogDocumentWithoutEntries(dossierId, fileId, entityLog);
|
||||
}
|
||||
|
||||
|
||||
public boolean entityLogContainsImportedEntries(String dossierId, String fileId) {
|
||||
|
||||
String entityLogId = mapper.getLogId(dossierId, fileId);
|
||||
return entityLogEntryDocumentRepository.existsByEntityLogIdAndEngineImported(entityLogId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user