Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,6 @@ public List<RealWorldTestingSummaryReport> getRealWorldTestingReportsByTestingYe
.toList();
}

private RealWorldTestingPlanSummaryReportEntity getEntity(Long id) throws EntityRetrievalException {
Query query = entityManager.createQuery(
"from RealWorldTestingPlanSummaryReportEntity where (NOT deleted = true) and id = :id", RealWorldTestingPlanSummaryReportEntity.class);
query.setParameter("id", id);
List<RealWorldTestingPlanSummaryReportEntity> result = query.getResultList();

if (result.size() > 1) {
throw new EntityRetrievalException("Data error. Duplicate id in real_world_testing_plan_summary_report table.");
}

if (result.size() > 0) {
return result.get(0);
}
return null;
}

private RealWorldTestingPlanSummaryReportEntity getEntityByCheckedDateAndAcb(LocalDate checkedDate, Long certificationBodyId) throws EntityRetrievalException {
Query query = entityManager.createQuery(
"from RealWorldTestingPlanSummaryReportEntity rwtps "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
.map(acb -> acb.getId())
.toList();

List<RealWorldTestingReport> reportRows = rwtReportService.getRealWorldTestingReports(activeAcbIds, LOGGER);
List<RealWorldTestingReport> rwtPlansReports = rwtReportService.getRealWorldTestingReports(activeAcbIds, LOGGER).stream()
.collect(Collectors.toList());

//RWT Results requirement is only enforced for listings with g7, g9, or g10 so we only want to report on those
List<RealWorldTestingReport> rwtResultReports = rwtPlansReports.stream()
.filter(report -> report.getAttestsG7() || report.getAttestsG9() || report.getAttestsG10())
.collect(Collectors.toList());

TransactionOperations transactionOperations = new TransactionTemplate(transactionManager,
new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRES_NEW));
transactionOperations.executeWithoutResult(status -> {
processRwtPlanCounts(reportRows);
processRwtResultsCounts(reportRows);
processRwtPlanCounts(rwtPlansReports);
processRwtResultsCounts(rwtResultReports);
});
} catch (Exception e) {
LOGGER.catching(e);
Expand Down