Skip to content

Commit

Permalink
GRAD2-2265 & GRAD2-2269: tasks are completed. (#223)
Browse files Browse the repository at this point in the history
* GRAD2-2255 & GRAD2-2264: tasks are completed.

GRAD2-2255 & GRAD2-2264: tasks are completed.

* Clean up unused codes.

Clean up unused codes.

* GRAD2-2265 & GRAD2-2269: tasks are completed.

GRAD2-2265 & GRAD2-2269: tasks are completed.

* Clean up unused codes & comments

Clean up unused codes & comments
  • Loading branch information
infstar authored Aug 3, 2023
1 parent 633e044 commit 6726cf8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ public ProcessorData fire(ProcessorData processorData) {
for (String mincode : mapDist.keySet()) {
CommonSchool commonSchool = getBaseSchoolDetails(null, mincode, exception);
if (commonSchool != null) {
String schoolCategoryCode = commonSchool.getSchoolCategoryCode();
String distcode = getDistrictCodeFromMincode(mincode);
processDistrictsForLabels(districtsForLabels, distcode, exception);

int currentSlipCount = 0;
schoolCounter++;
String schoolCategoryCode = commonSchool.getSchoolCategoryCode();

logger.debug("*** School Details Acquired {} category {}", mincode, schoolCategoryCode);
if(StringUtils.containsAnyIgnoreCase(schoolCategoryCode, "02", "03", "09")) {
processSchoolsForLabels(schoolsForLabels, mincode, exception);
logger.debug("Added Independent School {} for processing", commonSchool.getSchoolName());
} else {
// GRAD2-2269: no district for 02,03,09 school category
String distcode = getDistrictCodeFromMincode(mincode);
processDistrictsForLabels(districtsForLabels, distcode, exception);
}
logger.debug("{} School {}/{}", mincode, schoolCounter, mapDist.size());
List<Student> studListNonGrad = new ArrayList<>();
Expand Down Expand Up @@ -83,7 +84,6 @@ public ProcessorData fire(ProcessorData processorData) {
mincodes.add(mincode);
numberOfProcessedSchoolReports += processDistrictSchoolDistribution(processorData.getBatchId(), mincodes, null, null, NONGRADDISTREP_SC, null);
logger.debug("***** Number of distributed Student NonGrad School Reports {} *****", numberOfProcessedSchoolReports);
numberOfPdfs++;
}

if(!NONGRADYERUN.equalsIgnoreCase(processorData.getActivityCode())) {
Expand All @@ -96,7 +96,6 @@ public ProcessorData fire(ProcessorData processorData) {
numberOfProcessedSchoolReports += processDistrictSchoolDistribution(processorData.getBatchId(), mincodes, null, null, DISTREP_YE_SC, null);
logger.debug("***** {} School Report Created*****", mincode);
logger.debug("***** Number of distributed School Reports {} *****", numberOfProcessedSchoolReports);
numberOfPdfs++;
}

logger.debug("PDFs Merged for School {}", commonSchool.getSchoolName());
Expand All @@ -121,7 +120,7 @@ public ProcessorData fire(ProcessorData processorData) {
numberOfCreatedSchoolLabelReports += createDistrictSchoolYearEndReport(null, DISTREP_YE_SD, null, mincodes);
logger.debug("***** Number of created District Reports {} *****", numberOfCreatedSchoolLabelReports);
logger.debug("***** Distribute District Reports *****");
processDistrictSchoolDistribution(batchId, mincodes, null, DISTREP_YE_SD, null, null);
numberOfProcessedSchoolReports += processDistrictSchoolDistribution(batchId, mincodes, null, DISTREP_YE_SD, null, null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,11 @@ public boolean postingProcess(DistributionResponse distributionResponse) {
String download = distributionResponse.getLocalDownload();
String transmissionMode = distributionResponse.getTransmissionMode();
int numberOfPdfs = distributionResponse.getNumberOfPdfs();
boolean forAllSchools = true;
List<String> districtCodes = extractDistrictCodes(distributionResponse);
if(NONGRADYERUN.equalsIgnoreCase(activityCode)) {
if(!districtCodes.isEmpty()) {
forAllSchools = false;
createDistrictSchoolYearEndNonGradReport(null, NONGRADDISTREP_SD, null, districtCodes);
}
// GRAD2-2264: removed the redundant logic of NONGRADDISTREP_SC, which is already processed in YearEndMergeProcess
if(forAllSchools) {
createDistrictSchoolYearEndNonGradReport(null, NONGRADDISTREP_SD, null);
}
if(NONGRADYERUN.equalsIgnoreCase(activityCode) && !districtCodes.isEmpty()) {
createDistrictSchoolYearEndNonGradReport(null, NONGRADDISTREP_SD, null, districtCodes);
numberOfPdfs += processDistrictSchoolDistribution(batchId, null, NONGRADDISTREP_SD, null, transmissionMode);
// GRAD2-2264: removed the redundant logic of NONGRADDISTREP_SC because schools are already processed in YearEndMergeProcess
}
return zipBatchDirectory(batchId, download, numberOfPdfs, TMP_DIR);
}
Expand Down Expand Up @@ -341,8 +334,4 @@ private List<String> extractDistrictCodes(DistributionResponse distributionRespo
return distributionResponse.getDistricts().stream().map(School::getMincode).toList();
}

private List<String> extractSchoolCodes(DistributionResponse distributionResponse) {
return distributionResponse.getSchools().stream().map(School::getMincode).toList();
}

}

0 comments on commit 6726cf8

Please sign in to comment.