RED-7256 - Overlapping annotation color from imported redaction and resized redaction #270
@ -6,6 +6,7 @@ import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -15,6 +16,7 @@ import java.util.stream.Stream;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.configuration.MessagingConfiguration;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.entity.configuration.TypeEntity;
|
||||
@ -195,12 +197,15 @@ public class EntityLogMergeService {
|
||||
entityLogEntry.setTextBefore(manualResizeRedaction.getTextBefore());
|
||||
entityLogEntry.setPositions(convertPositions(manualResizeRedaction.getPositions()));
|
||||
addChanges(entityLogEntry.getChanges(), ChangeType.CHANGED, analysisNumber, manualResizeRedaction.getRequestDate());
|
||||
entityLogEntry.getManualChanges().add(ManualChange.builder()
|
||||
ManualChange.ManualChangeBuilder manualChange = ManualChange.builder()
|
||||
.manualRedactionType(ManualRedactionType.RESIZE)
|
||||
.requestedDate(manualResizeRedaction.getRequestDate())
|
||||
.processedDate(null)
|
||||
.propertyChanges(Map.of("value", manualResizeRedaction.getValue()))
|
||||
.userId(manualResizeRedaction.getUser()).build());
|
||||
.userId(manualResizeRedaction.getUser());
|
||||
if (!Strings.isNullOrEmpty(manualResizeRedaction.getValue())) {
|
||||
manualChange.propertyChanges(Map.of("value", manualResizeRedaction.getValue()));
|
||||
}
|
||||
entityLogEntry.getManualChanges().add(manualChange.build());
|
||||
}
|
||||
|
||||
private void mergeLegalBasisChanges(ManualLegalBasisChange manualLegalBasisChange, EntityLogEntry entityLogEntry, int analysisNumber) {
|
||||
@ -209,13 +214,21 @@ public class EntityLogMergeService {
|
||||
entityLogEntry.setSection(manualLegalBasisChange.getSection());
|
||||
entityLogEntry.setValue(manualLegalBasisChange.getValue());
|
||||
addChanges(entityLogEntry.getChanges(), ChangeType.CHANGED, analysisNumber, manualLegalBasisChange.getRequestDate());
|
||||
Map<String, String> propertyChanges = new HashMap<>();
|
||||
if (!Strings.isNullOrEmpty(manualLegalBasisChange.getLegalBasis())) {
|
||||
propertyChanges.put("legalBasis", manualLegalBasisChange.getLegalBasis());
|
||||
}
|
||||
if (!Strings.isNullOrEmpty(manualLegalBasisChange.getValue())) {
|
||||
propertyChanges.put("value", manualLegalBasisChange.getValue());
|
||||
}
|
||||
if(!Strings.isNullOrEmpty(manualLegalBasisChange.getSection())) {
|
||||
propertyChanges.put("section", manualLegalBasisChange.getSection());
|
||||
}
|
||||
entityLogEntry.getManualChanges().add(ManualChange.builder()
|
||||
.manualRedactionType(ManualRedactionType.LEGAL_BASIS_CHANGE)
|
||||
.requestedDate(manualLegalBasisChange.getRequestDate())
|
||||
.processedDate(null)
|
||||
.propertyChanges(Map.of("value", manualLegalBasisChange.getValue(),
|
||||
"section", manualLegalBasisChange.getSection(),
|
||||
"legalBasis", manualLegalBasisChange.getLegalBasis()))
|
||||
.propertyChanges(propertyChanges)
|
||||
.userId(manualLegalBasisChange.getUser())
|
||||
.build());
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||
@ -173,7 +174,7 @@ public class ManualRedactionMapper {
|
||||
.user(KeycloakSecurity.getUserId())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.positions(resizeRedactionRequest.getPositions())
|
||||
.value(StringCleaningUtility.cleanString(resizeRedactionRequest.getValue()))
|
||||
.value(resizeRedactionRequest.getValue() == null ? "" : StringCleaningUtility.cleanString(resizeRedactionRequest.getValue()))
|
||||
.comment(resizeRedactionRequest.getComment())
|
||||
.updateDictionary(resizeRedactionRequest.getUpdateDictionary())
|
||||
.addToAllDossiers(resizeRedactionRequest.isAddToAllDossiers())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user