Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop/alex #220

Merged
merged 10 commits into from
Jul 28, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ 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();
Expand All @@ -55,7 +54,6 @@ 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 @@ -88,18 +86,16 @@ public ProcessorData fire(ProcessorData processorData) {
numberOfPdfs++;
}

if(!schoolReportIncluded && !NONGRADDIST.equalsIgnoreCase(processorData.getActivityCode())) {
if(!NONGRADDIST.equalsIgnoreCase(processorData.getActivityCode())) {
logger.debug("***** Create {} School Report *****", mincode);
List<String> mincodes = new ArrayList<>();
mincodes.add(mincode);
numberOfCreatedSchoolReports += createDistrictSchoolYearEndReport(null, null, DISTREP_YE_SC, mincodes);
logger.debug("***** Number of School Reports Created {} *****", numberOfCreatedSchoolReports);
/**
logger.debug("***** Distribute {} School Reports *****", mincode);
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++;
}

Expand All @@ -119,6 +115,14 @@ public ProcessorData fire(ProcessorData processorData) {
List<String> mincodes = districtsForLabels.stream().map(School::getMincode).toList();
numberOfProcessedSchoolReports += processDistrictSchoolDistribution(batchId, mincodes, ADDRESS_LABEL_YE, null, null, null);
logger.debug("***** Number of distributed District Label reports {} *****", numberOfProcessedSchoolReports);

if(!NONGRADDIST.equalsIgnoreCase(processorData.getActivityCode())) {
logger.debug("***** Create and Store District Reports *****");
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);
}
}

if(!schoolsForLabels.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ public boolean postingProcess(DistributionResponse distributionResponse) {
boolean forAllSchools = true;
List<String> districtCodes = extractDistrictCodes(distributionResponse);
List<String> mincodes = extractSchoolCodes(distributionResponse);
if(YEARENDDIST.equalsIgnoreCase(activityCode)) {
if(!districtCodes.isEmpty()) {
forAllSchools = false;
createDistrictSchoolYearEndReport(null, DISTREP_YE_SD, null, districtCodes);
}
if(!mincodes.isEmpty()) {
forAllSchools = false;
createDistrictSchoolYearEndReport(null, null, DISTREP_YE_SC, mincodes);
}
if(forAllSchools) {
createDistrictSchoolYearEndReport(null, DISTREP_YE_SD, DISTREP_YE_SC);
}
numberOfPdfs += processDistrictSchoolDistribution(batchId, null, DISTREP_YE_SD, DISTREP_YE_SC, transmissionMode);
}
if(NONGRADDIST.equalsIgnoreCase(activityCode)) {
if(!districtCodes.isEmpty()) {
forAllSchools = false;
Expand Down
Loading