diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/listener/BaseRunCompletionNotificationListener.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/listener/BaseRunCompletionNotificationListener.java index b1f5d924..75860cf7 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/listener/BaseRunCompletionNotificationListener.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/listener/BaseRunCompletionNotificationListener.java @@ -10,7 +10,6 @@ import ca.bc.gov.educ.api.batchgraduation.service.TaskSchedulingService; import ca.bc.gov.educ.api.batchgraduation.util.DateUtils; import ca.bc.gov.educ.api.batchgraduation.util.JsonTransformer; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.batch.core.JobExecution; @@ -21,7 +20,8 @@ import java.util.*; -import static ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants.*; +import static ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants.SEARCH_REQUEST; +import static ca.bc.gov.educ.api.batchgraduation.util.EducGradBatchGraduationApiConstants.USER_SCHEDULED; public abstract class BaseRunCompletionNotificationListener implements JobExecutionListener { @@ -88,9 +88,7 @@ protected void handleSummary(JobExecution jobExecution, String summaryDtoName, b if (!isSpecialRun) { updateBackStudentFlagForErroredStudents(summaryDTO.getErrors(), jobType, obj.getAccess_token()); } - if(!StringUtils.equalsAnyIgnoreCase(req.getActivityCode(), TVRCREATE, TVRUPDATE, TVRDELETE, ALL)) { - processSchoolList(jobExecutionId, jobType); - } + processSchoolList(jobExecutionId, jobType); } private void processBatchJobHistory(AlgorithmSummaryDTO summaryDTO, Long jobExecutionId, String status, String jobTrigger, String jobType, Date startTime, Date endTime) { diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/model/StudentSearchRequest.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/model/StudentSearchRequest.java index b02b5216..d2d42c84 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/model/StudentSearchRequest.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/model/StudentSearchRequest.java @@ -1,6 +1,7 @@ package ca.bc.gov.educ.api.batchgraduation.model; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -41,12 +42,13 @@ public class StudentSearchRequest implements Serializable { String localDownload; Integer quantity; + @JsonIgnore public boolean isEmpty() { - return schoolOfRecords.isEmpty() && - districts.isEmpty() && - schoolCategoryCodes.isEmpty() && - pens.isEmpty() && - studentIDs.isEmpty() && - programs.isEmpty(); + return (schoolOfRecords == null || schoolOfRecords.isEmpty()) && + (districts == null || districts.isEmpty()) && + (schoolCategoryCodes == null || schoolCategoryCodes.isEmpty()) && + (pens == null || pens.isEmpty()) && + (studentIDs == null || studentIDs.isEmpty()); } + }