From bfcd1e2189b28707ec1ead39fd0ce3a607d48666 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:58:35 -0700 Subject: [PATCH] Grad release 1.16.0 (#253) * GRAD2-2525: DTO update to sync. GRAD2-2525: DTO update to sync. * Develop/alex grad2 2403 * GRAD2-2403 Fix packing slip jasper file to accommodate address line 2 * GRAD2-2403 Fix packing slip jasper file to accommodate address line 2 * Update pom.xml --------- Co-authored-by: Jinil Sung Co-authored-by: Kamal Mohammed Co-authored-by: Alexander Rybakov <83988488+arybakov-cgi@users.noreply.github.com> --- api/pom.xml | 2 +- .../distribution/model/dto/GradProgram.java | 10 +++++++ .../distribution/service/ReportService.java | 27 ++++++++++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index af80acbf..9cea9d3c 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-distribution-api - 1.8.56 + 1.8.57 educ-grad-distribution-api Ministry of Education GRAD DISTRIBUTION API diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/GradProgram.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/GradProgram.java index 2e7035ae..2edc5141 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/GradProgram.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/GradProgram.java @@ -7,6 +7,8 @@ public class GradProgram implements Serializable { private Code code; + private String expiryDate; + public Code getCode() { return code; } @@ -14,4 +16,12 @@ public Code getCode() { public void setCode(Code value) { this.code = value; } + + public String getExpiryDate() { + return expiryDate; + } + + public void setExpiryDate(String value) { + this.expiryDate = value; + } } diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/service/ReportService.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/service/ReportService.java index ae4089c5..53ff2955 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/service/ReportService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/service/ReportService.java @@ -32,12 +32,15 @@ public class ReportService { final RestService restService; + final SchoolService schoolService; + @Autowired - public ReportService(WebClient webClient, RestUtils restUtils, EducDistributionApiConstants educDistributionApiConstants, RestService restService, JsonTransformer jsonTransformer) { + public ReportService(WebClient webClient, RestUtils restUtils, EducDistributionApiConstants educDistributionApiConstants, RestService restService, SchoolService schoolService, JsonTransformer jsonTransformer) { this.webClient = webClient; this.restUtils = restUtils; this.educDistributionApiConstants = educDistributionApiConstants; this.restService = restService; + this.schoolService = schoolService; this.jsonTransformer = jsonTransformer; } @@ -57,12 +60,22 @@ public ReportRequest preparePackingSlipData(StudentSearchRequest searchRequest, boolean useSchoolAddress = (searchRequest == null || searchRequest.getAddress() == null); Address addr = useSchoolAddress ? new Address() : searchRequest.getAddress(); if(useSchoolAddress) { - addr.setStreetLine1(schoolDetails.getScAddressLine1()); - addr.setStreetLine2(schoolDetails.getScAddressLine2()); - addr.setCity(schoolDetails.getScCity()); - addr.setCode(schoolDetails.getScPostalCode()); - addr.setCountry(schoolDetails.getScCountryCode()); - addr.setRegion(schoolDetails.getScProvinceCode()); + TraxSchool traxSchool = schoolService.getTraxSchool(schoolDetails.getDistNo()+schoolDetails.getSchlNo(), new ExceptionMessage()); + if(traxSchool != null) { + addr.setStreetLine1(traxSchool.getAddress1()); + addr.setStreetLine2(traxSchool.getAddress2()); + addr.setCity(traxSchool.getCity()); + addr.setCode(traxSchool.getPostal()); + addr.setCountry(traxSchool.getCountryName()); + addr.setRegion(traxSchool.getProvinceName()); + } else { + addr.setStreetLine1(schoolDetails.getScAddressLine1()); + addr.setStreetLine2(schoolDetails.getScAddressLine2()); + addr.setCity(schoolDetails.getScCity()); + addr.setCode(schoolDetails.getScPostalCode()); + addr.setCountry(schoolDetails.getScCountryCode()); + addr.setRegion(schoolDetails.getScProvinceCode()); + } } schObj.setAddress(addr); schObj.setDistno(schoolDetails.getDistNo());