Skip to content

Commit

Permalink
Users' IDIR for audit history
Browse files Browse the repository at this point in the history
  • Loading branch information
arybakov-cgi committed Aug 19, 2024
1 parent c3c8976 commit bb1c39b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package ca.bc.gov.educ.api.batchgraduation.listener;

import ca.bc.gov.educ.api.batchgraduation.model.DistributionSummaryDTO;
import ca.bc.gov.educ.api.batchgraduation.model.StudentSearchRequest;
import ca.bc.gov.educ.api.batchgraduation.util.DateUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.BatchStatus;
Expand Down Expand Up @@ -44,14 +46,17 @@ public void afterJob(JobExecution jobExecution) {
LOGGER.info(" --------------------------------------------------------------------------------------");
LOGGER.info("Errors:{}", summaryDTO.getErrors().size());

StudentSearchRequest payload = (StudentSearchRequest)jsonTransformer.unmarshall(studentSearchRequest, StudentSearchRequest.class);
String userName = ObjectUtils.defaultIfNull(payload.getUser(), "Batch Archive Process");

updateUserSchedulingJobs(jobParameters);

String jobParametersDTO = buildJobParametersDTO(jobType, studentSearchRequest, null, null);
// save batch job & error history
processBatchJobHistory(summaryDTO, jobExecutionId, status, jobTrigger, jobType, startTime, endTime, jobParametersDTO);
LOGGER.info(" --------------------------------------------------------------------------------------");
summaryDTO.getSchools().forEach((value) -> LOGGER.info("School {} number of archived Students : {}", value.getMincode(), value.getNumberOfStudents()));
restUtils.updateStudentGradRecordHistory(jobExecutionId, "Batch Archive Process", "USERSTUDARC");
restUtils.updateStudentGradRecordHistory(jobExecutionId, userName, "USERSTUDARC");
}
}
}

0 comments on commit bb1c39b

Please sign in to comment.