Skip to content

Commit

Permalink
Merge pull request #497 from bcgov/grad-release
Browse files Browse the repository at this point in the history
Grad release 1.21.2
  • Loading branch information
githubmamatha authored Jun 25, 2024
2 parents 45f1362 + 86b3f6f commit c84e5b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-batch-graduation-api</artifactId>
<version>1.8.64</version>
<version>1.8.65</version>
<name>educ-grad-batch-graduation-api</name>
<description>Ministry of Education GRAD BATCH GRADUATION API</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ private Map<String, ServiceException> updateBackStudentRecords(List<StudentCrede
unprocessedStudents.put(scd.getStudentID().toString(), new ServiceException(e));
}
});
processedCount[0] = 0;
studentIDs.forEach(uuid-> {
try {
if(!StringUtils.equalsAnyIgnoreCase(jobType, "REGALG", "TVRRUN")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,23 @@ void filterByStudentSearchRequest(List<StudentCredentialDistribution> eligibleSt
}
}
eligibleStudentSchoolDistricts.removeIf(scr->StringUtils.isNotBlank(scr.getSchoolOfRecord()) && !useFilterSchoolDistricts.contains(scr.getSchoolOfRecord()));
LOGGER.debug("Student Credential Distribution filtered by schoolCategory code {}: ", searchRequest.getSchoolCategoryCodes());
LOGGER.debug("Student Credential Distribution filtered by schoolCategory code {}: {}", searchRequest.getSchoolCategoryCodes(), eligibleStudentSchoolDistricts.size());
}
if(searchRequest != null && searchRequest.getDistricts() != null && !searchRequest.getDistricts().isEmpty()) {
eligibleStudentSchoolDistricts.removeIf(scr->StringUtils.isNotBlank(scr.getSchoolOfRecord()) && !searchRequest.getDistricts().contains(StringUtils.substring(scr.getSchoolOfRecord(), 0, 3)));
LOGGER.debug("Student Credential Distribution filtered by district code {}: ", searchRequest.getDistricts());
LOGGER.debug("Student Credential Distribution filtered by district code {}: {}", searchRequest.getDistricts(), eligibleStudentSchoolDistricts.size());
}
if(searchRequest != null && searchRequest.getSchoolOfRecords() != null && !searchRequest.getSchoolOfRecords().isEmpty()) {
eligibleStudentSchoolDistricts.removeIf(scr->StringUtils.isNotBlank(scr.getSchoolOfRecord()) && !searchRequest.getSchoolOfRecords().contains(scr.getSchoolOfRecord()));
LOGGER.debug("Student Credential Distribution filtered by schoolOfRecord code {}: ", searchRequest.getSchoolOfRecords());
LOGGER.debug("Student Credential Distribution filtered by schoolOfRecord code {}: {}", searchRequest.getSchoolOfRecords(), eligibleStudentSchoolDistricts.size());
}
if(searchRequest != null && searchRequest.getStudentIDs() != null && !searchRequest.getStudentIDs().isEmpty()) {
eligibleStudentSchoolDistricts.removeIf(scr->scr.getStudentID() != null && !searchRequest.getStudentIDs().contains(scr.getStudentID()));
LOGGER.debug("Student Credential Distribution filtered by student ID {}: ", searchRequest.getStudentIDs());
LOGGER.debug("Student Credential Distribution filtered by student ID {}: {}", searchRequest.getStudentIDs(), eligibleStudentSchoolDistricts.size());
}
if(searchRequest != null && searchRequest.getPens() != null && !searchRequest.getPens().isEmpty()) {
eligibleStudentSchoolDistricts.removeIf(scr->StringUtils.isNotBlank(scr.getPen()) && !searchRequest.getPens().contains(scr.getPen()));
LOGGER.debug("Student Credential Distribution filtered by pen {}: ", searchRequest.getPens());
LOGGER.debug("Student Credential Distribution filtered by pen {}: {}", searchRequest.getPens(), eligibleStudentSchoolDistricts.size());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public Map<String, ExecutionContext> partition(int gridSize) {
long startTime = System.currentTimeMillis();
restUtils.deleteSchoolReportRecord("", "ADDRESS_LABEL_SCHL");
restUtils.deleteSchoolReportRecord("", "ADDRESS_LABEL_YE");
restUtils.deleteSchoolReportRecord("", "DISTREP_YE_SC");
restUtils.deleteSchoolReportRecord("", "DISTREP_YE_SD");
long endTime = System.currentTimeMillis();
long diff = (endTime - startTime)/1000;
logger.debug("Old School Reports deleted in {} sec", diff);
Expand All @@ -46,6 +44,11 @@ public Map<String, ExecutionContext> partition(int gridSize) {
filterByStudentSearchRequest(eligibleStudentSchoolDistricts);
if(!eligibleStudentSchoolDistricts.isEmpty()) {
updateBatchJobHistory(createBatchJobHistory(), (long) eligibleStudentSchoolDistricts.size());
List<String> schoolOfRecords = eligibleStudentSchoolDistricts.stream().map(StudentCredentialDistribution::getSchoolOfRecord).distinct().toList();
for(String mincode: schoolOfRecords) {
restUtils.deleteSchoolReportRecord(mincode, "DISTREP_YE_SC");
restUtils.deleteSchoolReportRecord(mincode, "DISTREP_YE_SD");
}
return getStringExecutionContextMap(gridSize, eligibleStudentSchoolDistricts, null);
}
logger.info("No Credentials Found for Processing");
Expand Down

0 comments on commit c84e5b0

Please sign in to comment.