RED-8670: integrate table inference from research
* introduce controllerAdvice to ControllerV2 package
This commit is contained in:
parent
46e221a3f6
commit
454a4d7acc
@ -65,11 +65,12 @@ java {
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
options {
|
||||
extra["javadoc.options"] = listOf("-quiet", "-Xdoclint:none")
|
||||
}
|
||||
logging.captureStandardOutput(LogLevel.ERROR)
|
||||
logging.captureStandardError(LogLevel.ERROR)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>(name) {
|
||||
|
||||
@ -208,10 +208,9 @@ public class ComponentMappingService {
|
||||
public int compare(String[] line1, String[] line2) {
|
||||
|
||||
for (int column = 0; column < line1.length; column++) {
|
||||
if (line1[column].equals(line2[column])) {
|
||||
continue;
|
||||
if (!line1[column].equals(line2[column])) {
|
||||
return line1[column].compareTo(line2[column]);
|
||||
}
|
||||
return line1[column].compareTo(line2[column]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -46,11 +46,10 @@ public class FileStatusProcessingUpdateService {
|
||||
case ANALYSE:
|
||||
case REANALYSE:
|
||||
default:
|
||||
retryTemplate.execute(retryContext -> {
|
||||
log.info("Analysis Successful for dossier {} and file {}, Attempt to update status: {}", dossierId, fileId, retryContext.getRetryCount());
|
||||
|
||||
log.info("Analysis Successful for dossier {} and file {}, Attempt to update status: {}", dossierId, fileId, 0);
|
||||
fileStatusService.setStatusSuccessful(dossierId, fileId, analyzeResult);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
if (!analyzeResult.isWasReanalyzed()) {
|
||||
indexingService.addToIndexingQueue(IndexMessageType.INSERT, dossier.getDossierTemplateId(), dossierId, fileId, 2);
|
||||
|
||||
@ -5,6 +5,7 @@ import java.time.temporal.ChronoUnit;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -29,6 +30,7 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemp
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -44,6 +46,7 @@ public class FileStatusPersistenceService {
|
||||
private final FileAttributeConfigPersistenceService fileAttributeConfigPersistenceService;
|
||||
private final DossierPersistenceService dossierService;
|
||||
private final WebsocketService websocketService;
|
||||
private final EntityManager entityManager;
|
||||
|
||||
|
||||
public void createStatus(String dossierId, String fileId, String filename, String uploader, long size) {
|
||||
@ -130,6 +133,7 @@ public class FileStatusPersistenceService {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fileRepository.updateProcessingStatus(fileId,
|
||||
numberOfPages,
|
||||
ProcessingStatus.PROCESSED,
|
||||
@ -145,16 +149,16 @@ public class FileStatusPersistenceService {
|
||||
analysisNumber,
|
||||
calculateProcessingErrorCounter(fileId, ProcessingStatus.PROCESSED));
|
||||
|
||||
// must be modifiable, otherwise hibernate fails
|
||||
List<FileEntityComponentMappingVersionEntity> versionEntities = usedComponentMappings.stream()
|
||||
.map(cm -> new FileEntityComponentMappingVersionEntity(cm.getName(), cm.getVersion()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
FileEntity file = fileRepository.findById(fileId)
|
||||
.orElseThrow(() -> new NotFoundException("File with id " + fileId + "not found!"));
|
||||
|
||||
file.setComponentMappingVersions(versionEntities);
|
||||
FileEntity fileEntity = entityManager.find(FileEntity.class, fileId);
|
||||
|
||||
fileRepository.save(file);
|
||||
fileEntity.setComponentMappingVersions(versionEntities);
|
||||
|
||||
entityManager.merge(fileEntity);
|
||||
|
||||
websocketService.sendAnalysisEvent(dossierId, fileId, AnalyseStatus.FINISHED, analysisNumber);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user