diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/Student.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/Student.java index 902c8ac6..520760e6 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/Student.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/Student.java @@ -5,8 +5,8 @@ import java.io.Serializable; import java.time.LocalDate; -import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Objects; @@ -19,7 +19,7 @@ public class Student implements Serializable { private String gender; private String citizenship; private LocalDate birthdate; - private LocalDateTime lastUpdateDate; + private Date lastUpdateDate; private Address address; private String grade; private String gradProgram; @@ -101,11 +101,12 @@ public void setBirthdate(LocalDate value) { this.birthdate = value; } - public LocalDateTime getLastUpdateDate() { + @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") + public Date getLastUpdateDate() { return lastUpdateDate; } - public void setLastUpdateDate(LocalDateTime lastUpdateDate) { + public void setLastUpdateDate(Date lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/StudentCredentialDistribution.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/StudentCredentialDistribution.java index 7d779ecd..bfadf356 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/StudentCredentialDistribution.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/model/dto/StudentCredentialDistribution.java @@ -28,4 +28,8 @@ public class StudentCredentialDistribution { private String program; private String studentGrade; private List nonGradReasons; + + public LocalDateTime getLastUpdateDate() { + return lastUpdateDate == null ? LocalDateTime.now() : lastUpdateDate; + } } diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/process/MergeProcess.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/process/MergeProcess.java index d519af3b..d0840d17 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/process/MergeProcess.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/process/MergeProcess.java @@ -18,7 +18,9 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.sql.Date; import java.time.LocalDate; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -218,7 +220,7 @@ private Student prepareStudentObj(StudentCredentialDistribution scd, List