Parcourir la source

GatherDeathCertificateDeceasedTimeLineDataImpl

Andrew Grant il y a 2 mois
Parent
commit
9f7866bd12

+ 25 - 5
src/main/java/scot/carricksoftware/grantswriter/domains/people/Person.java

@@ -26,6 +26,10 @@ public class Person extends BaseEntity {
     @Column(name = "`recorded_year_of_birth`")
     private String recordedYearOfBirth;
 
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`certified_year_of_death`")
+    String certifiedYearOfDeath;
+
     public String getLastName() {
         return lastName;
     }
@@ -65,18 +69,34 @@ public class Person extends BaseEntity {
         builder.append(", ");
         builder.append(this.firstName);
         builder.append(", ");
-        if (certifiedYearOfBirth != null) {
+        if (certifiedYearOfBirth != null && !certifiedYearOfBirth.isEmpty()) {
             builder.append(certifiedYearOfBirth);
             builder.append(" ");
         } else {
-            builder.append("(");
-            builder.append(recordedYearOfBirth);
-            builder.append(")");
-            builder.append(" ");
+            if (recordedYearOfBirth != null && !recordedYearOfBirth.isEmpty()) {
+                builder.append("(");
+                builder.append(recordedYearOfBirth);
+                builder.append(")");
+                builder.append(" ");
+            }
         }
         builder.append("-");
+        if (certifiedYearOfDeath != null && !certifiedYearOfDeath.isEmpty()) {
+            builder.append(" ");
+            builder.append(certifiedYearOfDeath);
+        }
 
         return builder.toString();
     }
+
+    @SuppressWarnings("unused")
+    public String getCertifiedYearOfDeath() {
+        return certifiedYearOfDeath;
+    }
+
+    @SuppressWarnings("unused")
+    public void setCertifiedYearOfDeath(String certifiedYearOfDeath) {
+        this.certifiedYearOfDeath = certifiedYearOfDeath;
+    }
 }
 

+ 4 - 2
src/main/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/deathcertificate/GatherDeathCertificateDeceasedTimeLineDataImpl.java

@@ -34,13 +34,14 @@ public class GatherDeathCertificateDeceasedTimeLineDataImpl implements GatherDea
         logger.info("GatherDeathCertificateDeceasedTimeLineDataImpl::Gather");
         for (DeathCertificate deathCertificate : deathCertificates) {
             addWhenDied(timelineData.getTimeLine(), deathCertificate);
-            addWhenRegistered(timelineData.getTimeLine(), deathCertificate);
+  //          addWhenRegistered(timelineData.getTimeLine(), deathCertificate);
             addRefs(deathCertificate);
         }
     }
 
+    @SuppressWarnings("unused")
     private void addRefs(DeathCertificate deathCertificate) {
-        timelineData.getRefs().add("Death Certificate for : " + deathCertificate.getDeceased());
+        timelineData.getRefs().add("Death Certificate for : " + deathCertificate.getDeceased().toString());
     }
 
     private void addWhenDied(TreeMap<DMY, List<String>> timeLine, DeathCertificate deathCertificate) {
@@ -60,6 +61,7 @@ public class GatherDeathCertificateDeceasedTimeLineDataImpl implements GatherDea
 
     }
 
+    @SuppressWarnings("unused")
     private void addWhenRegistered(TreeMap<DMY, List<String>> timeLine, DeathCertificate deathCertificate) {
         logger.info("GatherDeathCertificateDeceasedTimeLineDataImpl::AddWhenRegistered");