RED-8034: Excluded pages is indendent from analyse #233
@ -7,7 +7,7 @@ description = "redaction-service-api-v1"
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.springframework:spring-web:6.0.12")
|
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 {
|
publishing {
|
||||||
|
|||||||
@ -16,7 +16,7 @@ val layoutParserVersion = "0.75.0"
|
|||||||
val jacksonVersion = "2.15.2"
|
val jacksonVersion = "2.15.2"
|
||||||
val droolsVersion = "9.44.0.Final"
|
val droolsVersion = "9.44.0.Final"
|
||||||
val pdfBoxVersion = "3.0.0"
|
val pdfBoxVersion = "3.0.0"
|
||||||
val persistenceServiceVersion = "2.275.0"
|
val persistenceServiceVersion = "2.279.0"
|
||||||
val springBootStarterVersion = "3.1.5"
|
val springBootStarterVersion = "3.1.5"
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
|||||||
@ -327,7 +327,6 @@ public class AnalyzeService {
|
|||||||
redactionLog.setDictionaryVersion(dictionaryVersion.getDossierTemplateVersion());
|
redactionLog.setDictionaryVersion(dictionaryVersion.getDossierTemplateVersion());
|
||||||
redactionLog.setDossierDictionaryVersion(dictionaryVersion.getDossierVersion());
|
redactionLog.setDossierDictionaryVersion(dictionaryVersion.getDossierVersion());
|
||||||
|
|
||||||
excludeExcludedPages(redactionLog, analyzeRequest.getExcludedPages());
|
|
||||||
RedactionLogChanges redactionLogChange = redactionChangeLogService.computeChanges(previousRedactionLog, redactionLog, analyzeRequest.getAnalysisNumber());
|
RedactionLogChanges redactionLogChange = redactionChangeLogService.computeChanges(previousRedactionLog, redactionLog, analyzeRequest.getAnalysisNumber());
|
||||||
|
|
||||||
redactionStorageService.storeObject(analyzeRequest.getDossierId(), analyzeRequest.getFileId(), FileType.REDACTION_LOG, redactionLogChange.getRedactionLog());
|
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());
|
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);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,6 @@ public class EntityLogCreatorService {
|
|||||||
entityLog.setEntityLogEntry(importedRedactionFilteredEntries);
|
entityLog.setEntityLogEntry(importedRedactionFilteredEntries);
|
||||||
List<EntityLogEntry> previousExistingEntityLogEntries = getPreviousEntityLogEntries(analyzeRequest.getDossierId(), analyzeRequest.getFileId());
|
List<EntityLogEntry> previousExistingEntityLogEntries = getPreviousEntityLogEntries(analyzeRequest.getDossierId(), analyzeRequest.getFileId());
|
||||||
entityChangeLogService.computeChanges(previousExistingEntityLogEntries, entityLogEntries, analyzeRequest.getAnalysisNumber());
|
entityChangeLogService.computeChanges(previousExistingEntityLogEntries, entityLogEntries, analyzeRequest.getAnalysisNumber());
|
||||||
excludeExcludedPages(entityLog, analyzeRequest.getExcludedPages());
|
|
||||||
return entityLog;
|
return entityLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +140,6 @@ public class EntityLogCreatorService {
|
|||||||
|
|
||||||
previousEntityLog.getEntityLogEntry().addAll(newEntityLogWithImportedEntities);
|
previousEntityLog.getEntityLogEntry().addAll(newEntityLogWithImportedEntities);
|
||||||
|
|
||||||
excludeExcludedPages(previousEntityLog, analyzeRequest.getExcludedPages());
|
|
||||||
|
|
||||||
return updateVersionsAndReturnChanges(previousEntityLog, dictionaryVersion, analyzeRequest.getDossierTemplateId(), hasChanges);
|
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());
|
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);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,7 +421,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
|||||||
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AnalyzeRequest request = uploadFileToStorage(fileName);
|
AnalyzeRequest request = uploadFileToStorage(fileName);
|
||||||
request.setExcludedPages(Set.of(1));
|
|
||||||
|
|
||||||
request.setFileAttributes(List.of(FileAttribute.builder()
|
request.setFileAttributes(List.of(FileAttribute.builder()
|
||||||
.id("fileAttributeId")
|
.id("fileAttributeId")
|
||||||
@ -576,7 +575,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
|||||||
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AnalyzeRequest request = uploadFileToStorage(fileName);
|
AnalyzeRequest request = uploadFileToStorage(fileName);
|
||||||
request.setExcludedPages(Set.of(1));
|
|
||||||
|
|
||||||
request.setFileAttributes(List.of(FileAttribute.builder()
|
request.setFileAttributes(List.of(FileAttribute.builder()
|
||||||
.id("fileAttributeId")
|
.id("fileAttributeId")
|
||||||
|
|||||||
@ -44,7 +44,6 @@ public class AnalyseFileRealDataIntegrationTest extends LiveDataIntegrationTest
|
|||||||
AnalyzeRequest ar = AnalyzeRequest.builder().fileId(FILE_ID).dossierId(DOSSIER_ID)
|
AnalyzeRequest ar = AnalyzeRequest.builder().fileId(FILE_ID).dossierId(DOSSIER_ID)
|
||||||
.analysisNumber(1).dossierTemplateId(DOSSIER_TEMPLATE_ID)
|
.analysisNumber(1).dossierTemplateId(DOSSIER_TEMPLATE_ID)
|
||||||
.lastProcessed(OffsetDateTime.now())
|
.lastProcessed(OffsetDateTime.now())
|
||||||
.excludedPages(Set.of())
|
|
||||||
.fileAttributes(List.of())
|
.fileAttributes(List.of())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user