Skip to content

Commit

Permalink
Added missed School report at district level (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybakov-cgi authored Jul 27, 2023
1 parent 1741ebd commit 30bb25d
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ public ProcessorData fire(ProcessorData processorData) {
List<School> schoolsForLabels = new ArrayList<>();
List<School> districtsForLabels = new ArrayList<>();
for (String mincode : mapDist.keySet()) {
boolean schoolReportIncluded = false;
CommonSchool commonSchool = getBaseSchoolDetails(null, mincode, exception);
if (commonSchool != null) {
String schoolCategoryCode = commonSchool.getSchoolCategoryCode();
if(searchRequest != null && searchRequest.getSchoolCategoryCodes() != null && !searchRequest.getSchoolCategoryCodes().isEmpty() && !searchRequest.getSchoolCategoryCodes().contains(schoolCategoryCode)) {
logger.debug("Skip School {}/{} category code doesn't match filter \"{}\"", commonSchool.getSchoolName(), commonSchool.getSchoolCategoryCode(), String.join(",", searchRequest.getSchoolCategoryCodes()));
continue;
}

String distcode = getDistrictCodeFromMincode(mincode);
processDistrictsForLabels(districtsForLabels, distcode, exception);

Expand All @@ -59,6 +55,7 @@ public ProcessorData fire(ProcessorData processorData) {
logger.debug("*** School Details Acquired {} category {}", mincode, schoolCategoryCode);
if(StringUtils.containsAnyIgnoreCase(schoolCategoryCode, "02", "03", "09")) {
processSchoolsForLabels(schoolsForLabels, mincode, exception);
schoolReportIncluded = true;
logger.debug("Added Independent School {} for processing", commonSchool.getSchoolName());
}
logger.debug("{} School {}/{}", mincode, schoolCounter, mapDist.size());
Expand Down Expand Up @@ -90,7 +87,7 @@ public ProcessorData fire(ProcessorData processorData) {
logger.debug("***** Number of distributed Student NonGrad School Reports {} *****", numberOfProcessedSchoolReports);
}

if(distributionPrintRequest.getSchoolDistributionRequest() != null && !NONGRADDIST.equalsIgnoreCase(processorData.getActivityCode())) {
if(!schoolReportIncluded && distributionPrintRequest.getSchoolDistributionRequest() != null && !NONGRADDIST.equalsIgnoreCase(processorData.getActivityCode())) {
logger.debug("***** Create {} School Report *****", mincode);
ReportRequest schoolDistributionReportRequest = reportService.prepareSchoolDistributionReportData(distributionPrintRequest.getSchoolDistributionRequest(), processorData.getBatchId(), commonSchool);
createAndSaveDistributionReport(schoolDistributionReportRequest,mincode,schoolCategoryCode,processorData);
Expand Down

0 comments on commit 30bb25d

Please sign in to comment.