- Fix for Beim Ziehen eines Reports wirft es diesen Fehler 8212640113 #20
This commit is contained in:
parent
9fc655b14e
commit
f7dd0d5e8a
2 changed files with 3 additions and 3 deletions
|
|
@ -62,10 +62,10 @@ public class CalculationJobRepository {
|
|||
}
|
||||
|
||||
@Transactional
|
||||
public Optional<CalculationJob> getCalculationJob(Integer periodId, Integer nodeId, Integer materialId) {
|
||||
public Optional<CalculationJob> getCalculationJobWithJobStateValid(Integer periodId, Integer nodeId, Integer materialId) {
|
||||
|
||||
/* there should only be one job per period id, node id and material id combination */
|
||||
String query = "SELECT * FROM calculation_job AS cj INNER JOIN premise AS p ON cj.premise_id = p.id WHERE validity_period_id = ? AND p.supplier_node_id = ? AND material_id = ? LIMIT 1";
|
||||
String query = "SELECT * FROM calculation_job AS cj INNER JOIN premise AS p ON cj.premise_id = p.id WHERE job_state = 'VALID' AND validity_period_id = ? AND p.supplier_node_id = ? AND material_id = ? LIMIT 1";
|
||||
|
||||
var job = jdbcTemplate.query(query, new CalculationJobMapper(), periodId, nodeId, materialId);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class ReportingService {
|
|||
|
||||
var periodId = period.get().getId();
|
||||
|
||||
var jobs = nodeIds.stream().map(nodeId -> calculationJobRepository.getCalculationJob(periodId, nodeId,materialId)).filter(Optional::isPresent).map(Optional::get).toList();
|
||||
var jobs = nodeIds.stream().map(nodeId -> calculationJobRepository.getCalculationJobWithJobStateValid(periodId, nodeId,materialId)).filter(Optional::isPresent).map(Optional::get).toList();
|
||||
return jobs.stream().map(reportTransformer::toReportDTO).toList();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue