RED-7241: added many log files to debug strange behaviour
This commit is contained in:
parent
480711e39c
commit
cae5d386da
@ -492,7 +492,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
public List<ManualAddResponse> resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<ResizeRedactionRequest> resizeRedactionRequests) {
|
||||
|
||||
log.info("method resizeRedactionBulk({}, {}, {})", dossierId, fileId, resizeRedactionRequests);
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsMemberOrApprover(dossierId);
|
||||
|
||||
|
||||
@ -14,8 +14,6 @@ import java.util.function.Predicate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -29,13 +27,14 @@ import com.iqser.red.service.persistence.management.v1.processor.exception.NotAl
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.DictionaryPersistenceService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.EntryPersistenceService;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.utils.TextNormalizationUtilities;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.utils.TypeMapper;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.validation.DictionaryValidator;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.DictionaryEntryType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.Type;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -231,6 +230,8 @@ public class DictionaryManagementService {
|
||||
@Transactional
|
||||
public void addEntries(String typeId, List<String> entries, boolean removeCurrent, boolean ignoreInvalidEntries, DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
log.info("method addEntries({}, {}, {}, {}, {})", typeId, entries, removeCurrent, ignoreInvalidEntries, dictionaryEntryType);
|
||||
|
||||
checkForDossierTypeExistenceAndCreate(typeId);
|
||||
|
||||
Set<String> cleanEntries = entries.stream().map(this::cleanDictionaryEntry).collect(toSet());
|
||||
|
||||
@ -269,6 +269,8 @@ public class ManualRedactionService {
|
||||
|
||||
private void addToDictionary(String typeId, String value, String dossierId, String fileId, DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
log.info("method addToDictionary({}, {}, {})", dossierId, fileId, dictionaryEntryType);
|
||||
|
||||
try {
|
||||
log.debug("Adding entry: {} to {} for {} / {}", value, typeId, dossierId, fileId);
|
||||
dictionaryManagementService.addEntries(typeId, List.of(value), false, false, dictionaryEntryType != null ? dictionaryEntryType : DictionaryEntryType.ENTRY);
|
||||
@ -680,6 +682,8 @@ public class ManualRedactionService {
|
||||
@Transactional
|
||||
public List<ManualAddResponse> addResizeRedaction(String dossierId, String fileId, List<ResizeRedactionRequest> resizeRedactionRequests) {
|
||||
|
||||
log.info("method addResizeRedaction({}, {}, {})", dossierId, fileId, resizeRedactionRequests);
|
||||
|
||||
var response = new ArrayList<ManualAddResponse>();
|
||||
|
||||
RedactionLog redactionLog = redactionLogService.getRedactionLog(dossierId, fileId, true, true);
|
||||
@ -708,6 +712,8 @@ public class ManualRedactionService {
|
||||
|
||||
private void updateDictionaryForResizeRedactions(String dossierId, String fileId, ManualResizeRedactionEntity resizeRedaction, RedactionLog redactionLog) {
|
||||
|
||||
log.info("method updateDictionaryForResizeRedactions({}, {}, {}, {})", dossierId, fileId, resizeRedaction, redactionLog);
|
||||
|
||||
RedactionLogEntry redactionLogEntry = null;
|
||||
try {
|
||||
redactionLogEntry = getRedactionLogEntry(redactionLog, resizeRedaction.getId().getAnnotationId());
|
||||
@ -742,6 +748,8 @@ public class ManualRedactionService {
|
||||
|
||||
}
|
||||
|
||||
log.info("redactionLogEntry: {}, dossier: {}, typeId: {}, newValue: {}, oldValue: {}, dictionaryEntryType: {}", redactionLogEntry, dossier, typeId, newValue, oldValue, dictionaryEntryType);
|
||||
|
||||
log.info("Add new value '{}' to dictionary", newValue);
|
||||
addToDictionary(typeId, newValue, dossierId, fileId, dictionaryEntryType);
|
||||
}
|
||||
|
||||
@ -4,8 +4,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.entity.configuration.BaseDictionaryEntry;
|
||||
@ -19,6 +17,7 @@ import com.iqser.red.service.persistence.management.v1.processor.service.persist
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.DictionaryEntryType;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.JDBCWriteUtils;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -104,11 +103,14 @@ public class EntryPersistenceService {
|
||||
@Transactional
|
||||
public void addEntries(String typeId, Set<String> entries, long version, DictionaryEntryType dictionaryEntryType, boolean deleted) {
|
||||
|
||||
log.info("method addEntries({}, {}, {}, {}, {})", typeId, entries, version, dictionaryEntryType, deleted);
|
||||
|
||||
var type = typeRepository.getById(typeId);
|
||||
|
||||
switch (dictionaryEntryType) {
|
||||
case ENTRY -> {
|
||||
var undeletedEntries = entryRepository.undeleteEntries(typeId, entries, version);
|
||||
log.info("undeleted entries: {}", undeletedEntries);
|
||||
|
||||
undeletedEntries.forEach(entries::remove);
|
||||
|
||||
@ -122,6 +124,8 @@ public class EntryPersistenceService {
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
log.info("entry entities: {}", entryEntities);
|
||||
|
||||
jdbcWriteUtils.saveBatch(entryEntities);
|
||||
}
|
||||
case FALSE_POSITIVE -> {
|
||||
|
||||
@ -13,9 +13,9 @@ import com.iqser.red.service.persistence.management.v1.processor.entity.annotati
|
||||
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.RectangleEntity;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.annotationentity.ResizeRedactionRepository;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ResizeRedactionRequest;
|
||||
import com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -30,6 +30,7 @@ public class ResizeRedactionPersistenceService {
|
||||
|
||||
@Transactional
|
||||
public ManualResizeRedactionEntity insert(String fileId, ResizeRedactionRequest resizeRedactionRequest) {
|
||||
log.info("method insert({}, {})", fileId, resizeRedactionRequest);
|
||||
|
||||
ManualResizeRedactionEntity manualResizeRedaction = new ManualResizeRedactionEntity();
|
||||
manualResizeRedaction.setId(new AnnotationEntityId(resizeRedactionRequest.getAnnotationId(), fileId));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user