From b54665e849ad4f0fcaf9b2bb23c55a3f78a47b58 Mon Sep 17 00:00:00 2001 From: arybakov Date: Wed, 15 May 2024 10:36:15 -0600 Subject: [PATCH] GRAD2-2580 (GRAD) Fix User Request Distribution Run options - Part 2 - CUR and Null Distribution Dates --- .../GraduationStudentRecordSearchSpecification.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordSearchSpecification.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordSearchSpecification.java index 833b2324..2ea60a7b 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordSearchSpecification.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordSearchSpecification.java @@ -37,7 +37,7 @@ public Predicate toPredicate(Root root, Cri Predicate curStatusOptional; boolean userDist = StringUtils.containsAnyIgnoreCase(searchCriteria.activityCode, "USERDIST", "USERDISTOC", "USERDISTRC", "USERDISTOT", "USERDISTRT"); if(userDist) { - curStatusOptional = criteriaBuilder.notEqual(root.get(STUDENT_STATUS), "MER"); + curStatusOptional = criteriaBuilder.not(root.get(STUDENT_STATUS).in("MER", "DEC")); } else { curStatusOptional = criteriaBuilder.equal(root.get(STUDENT_STATUS), "CUR"); } @@ -49,6 +49,7 @@ public Predicate toPredicate(Root root, Cri ); } if (searchCriteria.getStudentIds() != null && !searchCriteria.getStudentIds().isEmpty()) { + curStatusOptional = criteriaBuilder.not(root.get(STUDENT_STATUS).in("MER")); return criteriaBuilder.and(root.get("studentID").as(UUID.class).in(searchCriteria.getStudentUUIDs()), curStatusOptional, datesRangePredicate ); @@ -80,6 +81,6 @@ public Predicate toPredicate(Root root, Cri curStatusOptional, datesRangePredicate ); } - return criteriaBuilder.and(curStatusOptional); + return criteriaBuilder.and(curStatusOptional, datesRangePredicate); } }