From c2f540a37418b92318b9c9cd8348f4dad47ce8a7 Mon Sep 17 00:00:00 2001 From: arybakov Date: Wed, 4 Sep 2024 16:37:42 -0600 Subject: [PATCH] GRAD2-2817 TVR Delete Process - Backend Changes Endpoints --- .../reader/DeleteStudentReportsPartitioner.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/DeleteStudentReportsPartitioner.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/DeleteStudentReportsPartitioner.java index 0cf8e67f..94388589 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/DeleteStudentReportsPartitioner.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/DeleteStudentReportsPartitioner.java @@ -47,7 +47,6 @@ public Map partition(int gridSize) { long startTime = System.currentTimeMillis(); logger.debug("Filter Schools for deleting student reports"); boolean processAllReports = "ALL".equalsIgnoreCase(searchRequest.getActivityCode()); - int quantity = ((searchRequest.getQuantity() == null) || (searchRequest.getQuantity() == 0)) ? DEFAULT_ROW_COUNT : searchRequest.getQuantity(); Long batchId = jobExecution.getId();; List eligibleStudentSchoolDistricts = gradSchoolOfRecordFilter.filterSchoolOfRecords(searchRequest); List finalSchoolDistricts = eligibleStudentSchoolDistricts.stream().sorted().toList(); @@ -68,7 +67,7 @@ public Map partition(int gridSize) { if(processAllReports) { for(String reportType: searchRequest.getReportTypes()) { Long studentReportsCount = restUtils.getTotalReportsForProcessing(List.of(), reportType, distributionSummaryDTO); - Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), quantity); + Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), DEFAULT_ROW_COUNT); totalStudentReportsCount += guidsRowCount; updateBatchJobHistory(algorithmJobHistory, totalStudentReportsCount); List reportTypeGuids = restUtils.getReportStudentIDsByStudentIDsAndReportType(List.of(), reportType, guidsRowCount, distributionSummaryDTO); @@ -80,7 +79,7 @@ public Map partition(int gridSize) { if(!studentGuidsBySearch.isEmpty()) { for (String reportType : searchRequest.getReportTypes()) { Long studentReportsCount = restUtils.getTotalReportsForProcessing(studentGuidsBySearchString, reportType, distributionSummaryDTO); - Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), quantity); + Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), DEFAULT_ROW_COUNT); totalStudentReportsCount += guidsRowCount; updateBatchJobHistory(algorithmJobHistory, totalStudentReportsCount); List reportTypeGuids = restUtils.getReportStudentIDsByStudentIDsAndReportType(studentGuidsBySearchString, reportType, guidsRowCount, distributionSummaryDTO);