Merge branch 'RED-8043-broken-section' into 'master'

RED-8043 - Fix section

Closes RED-8043

See merge request redactmanager/persistence-service!303
This commit is contained in:
Andrei Isvoran 2024-01-11 12:29:47 +01:00
commit 5a95dfbc1c
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ public class EntityLogMergeService {
@Observed(name = "EntityLogMergeService", contextualName = "merge-entity-log")
public EntityLog mergeEntityLog(ManualRedactions manualRedactions, EntityLog entityLog, DossierEntity dossier) {
log.info("Merging EntityLog");
log.debug("Merging EntityLog");
List<BaseAnnotation> allManualChanges = allManualChanges(manualRedactions);
List<String> manualChangesIds = allManualChanges.stream().map(BaseAnnotation::getAnnotationId).toList();
List<EntityLogEntry> matchingEntities = entityLog.getEntityLogEntry().stream().filter(entityLogEntry -> manualChangesIds.contains(entityLogEntry.getId())).collect(Collectors.toList());
@ -92,7 +92,7 @@ public class EntityLogMergeService {
}
});
log.info("EntityLog merged successfully.");
log.debug("EntityLog merged successfully.");
return entityLog;
}

View File

@ -54,7 +54,7 @@ public class RedactionAnalysisResponseReceiver {
manualRedactionEntry.setTextBefore(unprocessedManualEntity.getTextBefore());
manualRedactionEntry.setTextAfter(unprocessedManualEntity.getTextAfter());
manualRedactionEntry.setPositions(convertPositions(unprocessedManualEntity.getPositions()));
if (StringUtils.isNullOrEmpty(manualRedactionEntry.getSection()) && StringUtils.isNullOrEmpty(unprocessedManualEntity.getSection()) && !manualRedactionEntry.getSection().equals(unprocessedManualEntity.getSection())) {
if (StringUtils.isNullOrEmpty(manualRedactionEntry.getSection()) || (!StringUtils.isNullOrEmpty(unprocessedManualEntity.getSection()) && !manualRedactionEntry.getSection().equals(unprocessedManualEntity.getSection()))) {
manualRedactionEntry.setSection(unprocessedManualEntity.getSection());
}
addRedactionPersistenceService.update(manualRedactionEntry);