From 14494171b38b977d571ce61b532a2fd77cd5f6ed Mon Sep 17 00:00:00 2001 From: Jinil Sung Date: Thu, 10 Oct 2024 13:58:49 -0700 Subject: [PATCH] GRAD2-2905: fixed the equal interim issue for OPEN program in xml preview. GRAD2-2905: fixed the equal interim issue for OPEN program in xml preview. --- .../educ/grad/report/dto/impl/TranscriptCourseImpl.java | 7 ++++++- .../report/service/impl/StudentTranscriptServiceImpl.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java b/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java index 91d111f6..b8b2d0af 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/dto/impl/TranscriptCourseImpl.java @@ -247,7 +247,12 @@ public boolean compareCourse(final TranscriptCourse compareCourse) { // Removes duplication of courses by comparing and finding course with // highest percentage. - return percentage <= comparePercentage && comparePercentage != 0; + // GRAD2-2905 + if (this.isCompletedCourseUsedForGrad() && !compareCourse.isCompletedCourseUsedForGrad()) { + return percentage < comparePercentage && comparePercentage != 0; + } else { + return percentage <= comparePercentage && comparePercentage != 0; + } } public boolean isCompletedCourseUsedForGrad() { diff --git a/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java b/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java index 99eddd8a..bb25e813 100644 --- a/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java +++ b/api/src/main/java/ca/bc/gov/educ/grad/report/service/impl/StudentTranscriptServiceImpl.java @@ -715,6 +715,7 @@ private TranscriptCourse getInterimCourse( final List results, boolean openGradProgram) { //Check for duplicate courses for (final TranscriptCourse compareCourse : results) { + if (course.equals(compareCourse)) continue; //Check and compare two courses for duplication and if required //replace course based on requirement. if (isInterimCourse(course, compareCourse, openGradProgram)) {