conditional reprocess
This commit is contained in:
parent
0045f46c7f
commit
ec292dacbe
@ -8,17 +8,14 @@ import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileModel;
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.ProcessingStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.WorkflowStatus;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.amqp.core.AmqpAdmin;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -65,9 +62,13 @@ public class AutomaticAnalysisScheduler {
|
||||
// in case the file doesn't have numberOfPages set, we assume an average.
|
||||
worstCaseScenarioQueuedPages += next.getNumberOfPages() <= 0 ? pageFactor : next.getNumberOfPages();
|
||||
log.info("Queued file: {} for automatic analysis!", next.getFilename());
|
||||
fileStatusService.setStatusReprocess(next.getDossierId(), next.getId(), 1);
|
||||
|
||||
fileStatusService.setStatusReprocess(next.getDossierId(), next.getId(), 1);
|
||||
if (next.isReanalysisRequired()) {
|
||||
fileStatusService.setStatusReprocess(next.getDossierId(), next.getId(), 1);
|
||||
}
|
||||
if (next.isAnalysisRequired()) {
|
||||
fileStatusService.setStatusFullReprocess(next.getDossierId(), next.getId(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,11 +81,11 @@ public class AutomaticAnalysisScheduler {
|
||||
private List<FileModel> getAllStatuses() {
|
||||
|
||||
return reanalysisRequiredStatusService.enhanceFileStatusWithAnalysisRequirements(convert(fileStatusService.getAllStatuses()
|
||||
.stream()
|
||||
.filter(f -> !f.getProcessingStatus().equals(ProcessingStatus.DELETED))
|
||||
.filter(f -> !f.getWorkflowStatus().equals(WorkflowStatus.APPROVED))
|
||||
.filter(f -> !isProcessing(f))
|
||||
.collect(Collectors.toList()), FileModel.class, new FileModelMapper()))
|
||||
.stream()
|
||||
.filter(f -> !f.getProcessingStatus().equals(ProcessingStatus.DELETED))
|
||||
.filter(f -> !f.getWorkflowStatus().equals(WorkflowStatus.APPROVED))
|
||||
.filter(f -> !isProcessing(f))
|
||||
.collect(Collectors.toList()), FileModel.class, new FileModelMapper()))
|
||||
.stream()
|
||||
.filter(FileModel::isAnalysisRequired)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user