RED-8034: Excluded pages is indendent from analyse

This commit is contained in:
Dominique Eifländer 2023-12-19 14:15:47 +01:00
parent 7f2d4b01e8
commit b89b90f4ba
6 changed files with 2 additions and 34 deletions

View File

@ -7,7 +7,7 @@ description = "redaction-service-api-v1"
dependencies {
implementation("org.springframework:spring-web:6.0.12")
implementation("com.iqser.red.service:persistence-service-internal-api-v1:2.240.0")
implementation("com.iqser.red.service:persistence-service-internal-api-v1:2.279.0")
}
publishing {

View File

@ -16,7 +16,7 @@ val layoutParserVersion = "0.75.0"
val jacksonVersion = "2.15.2"
val droolsVersion = "9.44.0.Final"
val pdfBoxVersion = "3.0.0"
val persistenceServiceVersion = "2.275.0"
val persistenceServiceVersion = "2.279.0"
val springBootStarterVersion = "3.1.5"
configurations {

View File

@ -327,7 +327,6 @@ public class AnalyzeService {
redactionLog.setDictionaryVersion(dictionaryVersion.getDossierTemplateVersion());
redactionLog.setDossierDictionaryVersion(dictionaryVersion.getDossierVersion());
excludeExcludedPages(redactionLog, analyzeRequest.getExcludedPages());
RedactionLogChanges redactionLogChange = redactionChangeLogService.computeChanges(previousRedactionLog, redactionLog, analyzeRequest.getAnalysisNumber());
redactionStorageService.storeObject(analyzeRequest.getDossierId(), analyzeRequest.getFileId(), FileType.REDACTION_LOG, redactionLogChange.getRedactionLog());
@ -420,16 +419,4 @@ public class AnalyzeService {
return legalBasis.stream().map(l -> new RedactionLogLegalBasis(l.getName(), l.getDescription(), l.getReason())).collect(Collectors.toList());
}
private void excludeExcludedPages(RedactionLog redactionLog, Set<Integer> excludedPages) {
if (excludedPages != null && !excludedPages.isEmpty()) {
redactionLog.getRedactionLogEntry().forEach(entry -> entry.getPositions().forEach(pos -> {
if (excludedPages.contains(pos.getPage())) {
entry.setExcluded(true);
}
}));
}
}
}

View File

@ -87,7 +87,6 @@ public class EntityLogCreatorService {
entityLog.setEntityLogEntry(importedRedactionFilteredEntries);
List<EntityLogEntry> previousExistingEntityLogEntries = getPreviousEntityLogEntries(analyzeRequest.getDossierId(), analyzeRequest.getFileId());
entityChangeLogService.computeChanges(previousExistingEntityLogEntries, entityLogEntries, analyzeRequest.getAnalysisNumber());
excludeExcludedPages(entityLog, analyzeRequest.getExcludedPages());
return entityLog;
}
@ -141,8 +140,6 @@ public class EntityLogCreatorService {
previousEntityLog.getEntityLogEntry().addAll(newEntityLogWithImportedEntities);
excludeExcludedPages(previousEntityLog, analyzeRequest.getExcludedPages());
return updateVersionsAndReturnChanges(previousEntityLog, dictionaryVersion, analyzeRequest.getDossierTemplateId(), hasChanges);
}
@ -345,17 +342,4 @@ public class EntityLogCreatorService {
return legalBasis.stream().map(l -> new EntityLogLegalBasis(l.getName(), l.getDescription(), l.getReason())).collect(Collectors.toList());
}
private void excludeExcludedPages(EntityLog entityLog, Set<Integer> excludedPages) {
if (excludedPages != null && !excludedPages.isEmpty()) {
entityLog.getEntityLogEntry().forEach(entry -> entry.getPositions().forEach(pos -> {
if (excludedPages.contains(pos.getPageNumber())) {
entry.setExcluded(true);
}
}));
}
}
}

View File

@ -421,7 +421,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
long start = System.currentTimeMillis();
AnalyzeRequest request = uploadFileToStorage(fileName);
request.setExcludedPages(Set.of(1));
request.setFileAttributes(List.of(FileAttribute.builder()
.id("fileAttributeId")
@ -576,7 +575,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
long start = System.currentTimeMillis();
AnalyzeRequest request = uploadFileToStorage(fileName);
request.setExcludedPages(Set.of(1));
request.setFileAttributes(List.of(FileAttribute.builder()
.id("fileAttributeId")

View File

@ -44,7 +44,6 @@ public class AnalyseFileRealDataIntegrationTest extends LiveDataIntegrationTest
AnalyzeRequest ar = AnalyzeRequest.builder().fileId(FILE_ID).dossierId(DOSSIER_ID)
.analysisNumber(1).dossierTemplateId(DOSSIER_TEMPLATE_ID)
.lastProcessed(OffsetDateTime.now())
.excludedPages(Set.of())
.fileAttributes(List.of())
.build();