RED-8480: don't merge recategorizations for images, create pending entry instead
* TODO: remove filter in report-service and pdftron-redaction-service
This commit is contained in:
parent
619591812d
commit
adca68cc91
@ -52,7 +52,7 @@ public class ManualRedactionDictionaryUpdateHandler {
|
||||
|
||||
public Set<String> handleAddToDictionaryAndReturnModifiedTypeIds(String fileId, String value, ManualRequestWithAddToDictionary manualRequestWithAddToDictionary) {
|
||||
|
||||
if (!manualRequestWithAddToDictionary.isAddToDictionary()) {
|
||||
if (!manualRequestWithAddToDictionary.isAddToDictionary() || value == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
|
||||
@ -99,7 +99,7 @@ public class ManualRedactionDictionaryUpdateHandler {
|
||||
|
||||
public Set<String> handleRemoveFromDictionaryAndReturnModifiedTypeIds(String fileId, ManualRequestWithRemoveFromDictionary manualRequestWithRemoveFromDictionary) {
|
||||
|
||||
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary()) {
|
||||
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary() || manualRequestWithRemoveFromDictionary.getValue() == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
String dossierId = manualRequestWithRemoveFromDictionary.getDossierId();
|
||||
|
||||
@ -10,7 +10,6 @@ import java.util.Set;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.BadRequestException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.EntityLogService;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
||||
@ -155,13 +154,12 @@ public class ManualRedactionMapper {
|
||||
.addToDictionary(recategorizationRequest.isAddToDictionary())
|
||||
.addToAllDossiers(recategorizationRequest.isAddToAllDossiers())
|
||||
.dictionaryEntryType(getDictionaryEntryType(entityLogEntry))
|
||||
.value(entityLogEntry.getValue())
|
||||
.value(recategorizationRequest.getValue())
|
||||
.typeToRemove(entityLogEntry.getType())
|
||||
.dossierTemplateTypeId(toTypeId(recategorizationRequest.getType(), dossierTemplateId))
|
||||
.legalBasis(Optional.ofNullable(recategorizationRequest.getLegalBasis())
|
||||
.orElse(""))
|
||||
.section(recategorizationRequest.getSection())
|
||||
.value(recategorizationRequest.getValue())
|
||||
.build();
|
||||
requests.add(build);
|
||||
}
|
||||
|
||||
@ -240,6 +240,7 @@ public class ManualRedactionService {
|
||||
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
|
||||
recategorizationRequest.getValue(),
|
||||
recategorizationRequest);
|
||||
|
||||
Set<String> typeIdsOfDictionariesWithDelete = manualRedactionDictionaryUpdateHandler.handleRemoveFromDictionaryAndReturnModifiedTypeIds(fileId,
|
||||
recategorizationRequest);
|
||||
|
||||
@ -255,6 +256,7 @@ public class ManualRedactionService {
|
||||
|
||||
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId).build());
|
||||
}
|
||||
|
||||
reprocess(dossierId, fileId);
|
||||
|
||||
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user