Skip to content

Commit

Permalink
Merge pull request #445 from bcgov/develop/alex-GRAD2-1869-2
Browse files Browse the repository at this point in the history
User Request Blank Certificate Adult Dogwood to Advanced Education fail
  • Loading branch information
kamal-mohammed authored Nov 15, 2023
2 parents c44a6b0 + 3a6ba15 commit c06c067
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ public void afterJob(JobExecution jobExecution) {
BlankDistributionSummaryDTO finalSummaryDTO = summaryDTO;
summaryDTO.getCredentialCountMap().forEach((key, value) -> LOGGER.info(" {} count : {}", key, finalSummaryDTO.getCredentialCountMap().get(key)));

StudentSearchRequest studentSearchRequestObject = (StudentSearchRequest)jsonTransformer.unmarshall(studentSearchRequest, StudentSearchRequest.class);

ResponseObj obj = restUtils.getTokenResponseObject();
LOGGER.info("Starting Report Process --------------------------------------------------------------------------");
processGlobalList(credentialType,summaryDTO.getGlobalList(),jobExecutionId,summaryDTO.getMapDist(),obj.getAccess_token(),localDownLoad,properName);
processGlobalList(studentSearchRequestObject, credentialType,summaryDTO.getGlobalList(),jobExecutionId,summaryDTO.getMapDist(),obj.getAccess_token(),localDownLoad,properName);
LOGGER.info(LOG_SEPARATION);
}
}

private void processGlobalList(String credentialType, List<BlankCredentialDistribution> cList, Long batchId, Map<String, DistributionPrintRequest> mapDist, String accessToken,String localDownload,String properName) {
private void processGlobalList(StudentSearchRequest studentSearchRequest , String credentialType, List<BlankCredentialDistribution> cList, Long batchId, Map<String, DistributionPrintRequest> mapDist, String accessToken,String localDownload,String properName) {
List<String> uniqueSchoolList = cList.stream().map(BlankCredentialDistribution::getSchoolOfRecord).distinct().collect(Collectors.toList());
uniqueSchoolList.forEach(usl->{
List<BlankCredentialDistribution> yed4List = new ArrayList<>();
Expand All @@ -109,7 +111,7 @@ private void processGlobalList(String credentialType, List<BlankCredentialDistri
supportListener.blankCertificatePrintFile(yedrList,batchId,usl,mapDist,"YEDR",properName);
supportListener.blankCertificatePrintFile(yedbList,batchId,usl,mapDist,"YEDB",properName);
});
DistributionRequest distributionRequest = DistributionRequest.builder().mapDist(mapDist).build();
DistributionRequest distributionRequest = DistributionRequest.builder().mapDist(mapDist).studentSearchRequest(studentSearchRequest).build();
restUtils.createBlankCredentialsAndUpload(batchId, accessToken, distributionRequest,localDownload);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public class BlankCredentialDistribution {
private String schoolOfRecord;
private int quantity;
private String paperType;

private Address address;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
public class BlankCredentialRequest implements Serializable {
private List<String> schoolOfRecords;
private List<String> credentialTypeCode;
private String user;
private Address address;
private int quantity;
String localDownload;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private List<BlankCredentialDistribution> getRecordsForBlankUserReqDisRun(BlankC
bcd.setQuantity(req.getQuantity());
bcd.setSchoolOfRecord(sch);
bcd.setCredentialTypeCode(ctc);
bcd.setAddress(req.getAddress());
blankList.add(bcd);
}
});
Expand Down

0 comments on commit c06c067

Please sign in to comment.