Skip to content

Commit

Permalink
GRAD2-2434 fixed code for list of students.
Browse files Browse the repository at this point in the history
  • Loading branch information
githubmamatha committed Feb 1, 2024
1 parent 5dd0cea commit 0cbb772
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,10 @@ private void processGradStudentRecordJobHistory(JobExecution jobExecution) {

JobParameters jobParameters = jobExecution.getJobParameters();
Long batchId = jobExecution.getId();
String token = restUtils.fetchAccessToken();
String accessToken = restUtils.fetchAccessToken();
String userName = jobParameters.getString(RUN_BY);
List<UUID> studentList;
String searchRequest = jobParameters.getString(SEARCH_REQUEST, "{}");
StudentSearchRequest req = (StudentSearchRequest) jsonTransformer.unmarshall(searchRequest, StudentSearchRequest.class);
studentList = restUtils.getStudentsForSpecialGradRun(req, token);

if (!studentList.isEmpty()) {
studentList.forEach(studentID -> {
LOGGER.debug("Update back Student Record {}", studentID);
String accessToken = restUtils.fetchAccessToken();
restUtils.updateStudentGradRecordHistory(studentID, batchId, accessToken, userName);
});

}
restUtils.updateStudentGradRecordHistory(batchId, accessToken, userName);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,14 @@ public void updateStudentGradRecord(UUID studentID, Long batchId,String activity
}
}

public void updateStudentGradRecordHistory(UUID studentID, Long batchId, String accessToken, String userName) {
public void updateStudentGradRecordHistory(Long batchId, String accessToken, String userName) {
try {
if (batchId != null) {
String url = String.format(constants.getUpdateStudentRecordHistory(), batchId, userName);
this.put(url,"{}", GraduationStudentRecord.class, accessToken);
}
} catch (Exception e) {
LOGGER.error("Unable to update student record {}", studentID);
LOGGER.error("Unable to update student record");
}
}

Expand Down

0 comments on commit 0cbb772

Please sign in to comment.