Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAD2-2308 #239

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading