Skip to content

Commit

Permalink
GRAD2-2308
Browse files Browse the repository at this point in the history
HD-21581-GRAD - P3 - GRAD Batch Processing - Select Student Options moved to wrong place
  • Loading branch information
arybakov-cgi committed Sep 20, 2023
1 parent 824f6af commit 14e9f1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.io.Serializable;
import java.util.List;
import java.util.UUID;

@Data
@Component
Expand All @@ -20,6 +21,7 @@ public class StudentSearchRequest implements Serializable {
List<String> schoolCategoryCodes;
List<String> pens;
List<String> programs;
private List<UUID> studentIDs;

Boolean validateInput;
}
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,15 @@ public boolean updateStudentCredentialPosting(UUID studentID, String credentialT

public List<StudentCredentialDistribution> getStudentCredentialsForUserRequestDisRun(String credentialType, StudentSearchRequest studentSearchRequest, String accessToken) {
List<StudentCredentialDistribution> scdList = new ArrayList<>();
List<UUID> studentList = getStudentsForSpecialGradRun(studentSearchRequest, accessToken);
if (!studentList.isEmpty()) {
List<UUID> studentIDs = studentSearchRequest.getStudentIDs();
if(studentIDs == null || studentIDs.isEmpty()) {
studentIDs = getStudentsForSpecialGradRun(studentSearchRequest, accessToken);
}
if (!studentIDs.isEmpty()) {
int partitionSize = 1000;
List<List<UUID>> partitions = new LinkedList<>();
for (int i = 0; i < studentList.size(); i += partitionSize) {
partitions.add(studentList.subList(i, Math.min(i + partitionSize, studentList.size())));
for (int i = 0; i < studentIDs.size(); i += partitionSize) {
partitions.add(studentIDs.subList(i, Math.min(i + partitionSize, studentIDs.size())));
}
if (credentialType.equalsIgnoreCase("OC") || credentialType.equalsIgnoreCase("RC")) {
processCertificate(partitions, scdList);
Expand Down

0 comments on commit 14e9f1a

Please sign in to comment.