Skip to content

Commit

Permalink
Merge pull request #651 from bcgov/grad-release
Browse files Browse the repository at this point in the history
Grad release 1.16.0
  • Loading branch information
githubmamatha authored Mar 26, 2024
2 parents e77b67e + f1e73f1 commit 3855512
Show file tree
Hide file tree
Showing 40 changed files with 232 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-report-api</artifactId>
<name>educ-grad-report-api</name>
<version>1.8.58</version>
<version>1.8.59</version>
<description>Ministry of Education and Child Care REPORT API</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
public class GradProgram implements Serializable {
private Code code = new Code();

private String expiryDate = "";

public Code getCode() {
return code;
}

public void setCode(Code value) {
this.code = value;
}

public String getExpiryDate() {
return expiryDate;
}

public void setExpiryDate(String value) {
this.expiryDate = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public GradProgram getGradProgram(ReportData reportData) {
assert program != null;
return new GradProgramImpl(GraduationProgramCode.valueFrom(
program.getCode().getCode(),
program.getCode().getDescription()));
program.getCode().getDescription()), program.getExpiryDate());
}

public List<School> getSchools(ReportData reportData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ public final class GradProgramImpl extends AbstractDomainEntity
private GraduationProgramCode code;
private String programCode;
private String programName;
private String expiryDate;

public GradProgramImpl() {

}

public GradProgramImpl(GraduationProgramCode code) {
public GradProgramImpl(GraduationProgramCode code, String expiryDate) {
setCode(code);
setExpiryDate(expiryDate);
}

@Override
Expand Down Expand Up @@ -69,4 +71,14 @@ public void setProgramCode(String programCode) {
public void setProgramName(String programName) {
this.programName = programName;
}

@Override
public String getExpiryDate() {
return expiryDate;
}

@Override
public void setExpiryDate(String value) {
this.expiryDate = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import ca.bc.gov.educ.grad.report.dto.reports.data.impl.Status;
import ca.bc.gov.educ.grad.report.dto.reports.data.impl.Student;
import ca.bc.gov.educ.grad.report.dto.reports.data.impl.TranscriptResult;
import ca.bc.gov.educ.grad.report.model.common.SignatureBlockType;
import ca.bc.gov.educ.grad.report.model.graduation.GradProgram;
import ca.bc.gov.educ.grad.report.model.graduation.GraduationProgramCode;
import ca.bc.gov.educ.grad.report.model.graduation.NonGradReason;
Expand All @@ -30,6 +31,7 @@
import ca.bc.gov.educ.grad.report.model.transcript.TranscriptTypeCode;

import java.util.List;
import java.util.Map;

import static ca.bc.gov.educ.grad.report.dto.reports.data.adapter.BusinessEntityAdapter.adapt;
import static ca.bc.gov.educ.grad.report.model.reports.ReportFormat.HTML;
Expand Down Expand Up @@ -290,6 +292,12 @@ public final boolean isBlank() {
@Override
protected void preprocessParameters() {
super.preprocessParameters();
Student student = getStudent();
Map<String, SignatureBlockType> signatureBlockTypes = student.getSignatureBlockTypes();
SignatureBlockType signatureBlockType = signatureBlockTypes.get("MOE_ADM");
if(signatureBlockType != null) {
setParameter("P_SIGNATURE_LABEL", signatureBlockType.getLabel());
}
setParameter("P_REPORT_PREVIEW", isPreview());
setParameter("P_REPORT_INTERIM", isInterim());
setParameter("P_REPORT_BLANK", isBlank());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ public interface GradProgram extends DomainEntity {
* @param code The new graduation program code.
*/
void setCode(GraduationProgramCode code);

public String getExpiryDate();

public void setExpiryDate(String value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private GradProgram createGradProgram(String code) {

return new GradProgramImpl(GraduationProgramCode.valueFrom(
code,
reportData.getGradProgram().getCode().getDescription()));
reportData.getGradProgram().getCode().getDescription()),"");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ public Transcript getTranscript(
LOG.entering(CLASSNAME, methodName);

final Transcript transcriptInfo = getTranscriptInformation(pen);
final List<TranscriptCourse> transcriptCourses = getTranscriptCourseList(pen, transcriptInfo.getInterim());
final StudentInfo studentInfo = getStudentInfo(pen);
final TranscriptTypeCode transcriptTypeCode = transcriptInfo.getTranscriptTypeCode();
final GradProgram program = createGradProgram(studentInfo.getGradReqYear());
final List<TranscriptCourse> transcriptCourses = getTranscriptCourseList(pen, transcriptInfo.getInterim(), StringUtils.isBlank(program.getExpiryDate()));
final Date reportDate = transcriptInfo.getIssueDate();

final Transcript transcript = adapt(
Expand Down Expand Up @@ -274,7 +274,7 @@ private StudentTranscriptReport createTranscriptReport(
* @return
*/
private List<TranscriptCourse> getTranscriptCourseList(
final String pen, final boolean interim)
final String pen, final boolean interim, final boolean openGradProgram)
throws DomainServiceException {
final String methodName = "getTranscriptCourseList(String, boolean)";
LOG.entering(CLASSNAME, methodName);
Expand All @@ -283,7 +283,7 @@ private List<TranscriptCourse> getTranscriptCourseList(

ReportData reportData = getReportData(methodName);
if(interim) {
results = filterCourses(gradDataConvertionBean.getTranscriptCourses(reportData));
results = filterCourses(gradDataConvertionBean.getTranscriptCourses(reportData), openGradProgram);
} else {
results = gradDataConvertionBean.getTranscriptCourses(reportData);
}
Expand Down Expand Up @@ -683,14 +683,14 @@ private GraduationData adaptGraduationData(
* @param results Courses for PEN user which might have duplicated courses
* @return
*/
private List<TranscriptCourse> filterCourses(final List<TranscriptCourse> results) {
private List<TranscriptCourse> filterCourses(final List<TranscriptCourse> results, boolean openGradProgram) {

final List<TranscriptCourse> resultOfCourses = new ArrayList<>();
for (final TranscriptCourse course : results) {

if (!resultOfCourses.contains(course)) {
final TranscriptCourse interimCourse
= getInterimCourse(course, results);
= getInterimCourse(course, results, openGradProgram);

if (!(resultOfCourses.contains(interimCourse))) {
resultOfCourses.add(interimCourse);
Expand All @@ -712,21 +712,27 @@ private List<TranscriptCourse> filterCourses(final List<TranscriptCourse> result
*/
private TranscriptCourse getInterimCourse(
TranscriptCourse course,
final List<TranscriptCourse> results) {
final List<TranscriptCourse> results, boolean openGradProgram) {
//Check for duplicate courses
for (final TranscriptCourse compareCourse : results) {
//Check and compare two courses for duplication and if required
//replace course based on requirement.
if (course.courseEquals(compareCourse)
&& !course.isCompletedCourseUsedForGrad()
&& course.compareCourse(compareCourse) ) {
if (isInterimCourse(course, compareCourse, openGradProgram)) {
course = compareCourse;
}
}
return course;

}

private boolean isInterimCourse(TranscriptCourse source, TranscriptCourse target, boolean openGradProgram) {
if (openGradProgram) { // GRAD-2525
return source.courseEquals(target) && source.compareCourse(target);
} else { // GRAD2-2222
return source.courseEquals(target) && !source.isCompletedCourseUsedForGrad() && source.compareCourse(target);
}
}

/**
* @param results
* @param code
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE DIGITAL_SIGNATURE SET DIGITAL_SIGNATURE_NAME='Lisa Beare', UPDATE_USER = USER, UPDATE_DATE = SYSTIMESTAMP WHERE DIGITAL_SIGNATURE_CODE='MOAE';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
UPDATE SIGNATURE_BLOCK_TYPE
SET
LABEL = 'Associate Deputy Minister',
DESCRIPTION = 'Associate Deputy Minister',
UPDATE_USER = 'GRAD_REPORT_API',
UPDATE_DATE = SYSTIMESTAMP
WHERE
SIGNATURE_BLOCK_TYPE = 'MOE_ADM';
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
<parameter name="P_REPORT_SIGNATURES_PATH" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_IMAGES_PATH} + "signatures/"]]></defaultValueExpression>
</parameter>
<field name="student" class="ca.bc.gov.educ.grad.report.dto.reports.data.impl.Student">
<fieldDescription><![CDATA[student]]></fieldDescription>
</field>
<field name="F_LABEL_MAP" class="java.util.HashMap">
<fieldDescription><![CDATA[student.signatureBlockTypes]]></fieldDescription>
</field>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="110">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
Expand All @@ -56,7 +53,7 @@
<topPen lineWidth="0.75" lineStyle="Dashed"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{F_LABEL_MAP} != null ? $F{F_LABEL_MAP}.get("MOE_ADM").toString() : "Assistant Deputy Minister"]]></textFieldExpression>
<textFieldExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></textFieldExpression>
</textField>
</frame>
</band>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="772">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
Expand Down Expand Up @@ -330,6 +333,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<subreport>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="772">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
Expand Down Expand Up @@ -330,6 +333,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<subreport>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<subreport>
Expand Down Expand Up @@ -82,6 +85,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "sections/" + $P{P_REPORT_TYPE} + "/SUMMARY_" + $P{P_REPORT_TYPE} + "_SUB.jasper"]]></subreportExpression>
</subreport>
</band>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<frame>
Expand Down Expand Up @@ -336,6 +339,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<staticText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<subreport>
Expand Down Expand Up @@ -82,6 +85,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "sections/" + $P{P_REPORT_TYPE} + "/SUMMARY_" + $P{P_REPORT_TYPE} + "_SUB.jasper"]]></subreportExpression>
</subreport>
</band>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<frame>
Expand Down Expand Up @@ -336,6 +339,9 @@
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<staticText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<staticText>
Expand Down Expand Up @@ -533,6 +536,9 @@ possible, but credit was granted on the basis of adjudication by the school]]></
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<subreport>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<parameter name="P_SIGNATURE_FILE" class="java.lang.String">
<defaultValueExpression><![CDATA[$P{P_REPORT_SIGNATURES_PATH}.replace("#signatureCode#","MOE_ADM")]]></defaultValueExpression>
</parameter>
<parameter name="P_SIGNATURE_LABEL" class="java.lang.String">
<defaultValueExpression><![CDATA["Assistant Deputy Minister"]]></defaultValueExpression>
</parameter>
<summary>
<band height="792">
<staticText>
Expand Down Expand Up @@ -533,6 +536,9 @@ possible, but credit was granted on the basis of adjudication by the school]]></
<subreportParameter name="P_SIGNATURE_FILE">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_FILE}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="P_SIGNATURE_LABEL">
<subreportParameterExpression><![CDATA[$P{P_SIGNATURE_LABEL}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{P_REPORT_CONCRETE_PATH} + "Signature.jasper"]]></subreportExpression>
</subreport>
<subreport>
Expand Down
Loading

0 comments on commit 3855512

Please sign in to comment.