|
|
@ -119,15 +119,15 @@ public class BirthAndDeathDetailsService { |
|
|
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {}); |
|
|
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {}); |
|
|
|
|
|
|
|
|
// ✅ Only keep records that actually have a PDF link |
|
|
// ✅ Only keep records that actually have a PDF link |
|
|
// if (result.containsKey("certificate_details")) { |
|
|
|
|
|
// List<Map<String, Object>> details = (List<Map<String, Object>>) result.get("certificate_details"); |
|
|
|
|
|
|
|
|
if (result.containsKey("certificate_details")) { |
|
|
|
|
|
List<Map<String, Object>> details = (List<Map<String, Object>>) result.get("certificate_details"); |
|
|
|
|
|
|
|
|
// List<Map<String, Object>> filtered = details.stream() |
|
|
|
|
|
// .filter(row -> row.get("pdf_url") != null && !row.get("pdf_url").toString().trim().isEmpty()) |
|
|
|
|
|
// .toList(); |
|
|
|
|
|
|
|
|
List<Map<String, Object>> filtered = details.stream() |
|
|
|
|
|
.filter(row -> row.get("pdf_url") != null && !row.get("pdf_url").toString().trim().isEmpty()) |
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
// result.put("certificate_details", filtered); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
result.put("certificate_details", filtered); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
@ -171,15 +171,15 @@ public class BirthAndDeathDetailsService { |
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {}); |
|
|
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {}); |
|
|
//✅ Only keep records that actually have a PDF link |
|
|
//✅ Only keep records that actually have a PDF link |
|
|
// if (result.containsKey("certificate_details")) { |
|
|
|
|
|
// List<Map<String, Object>> details = (List<Map<String, Object>>) result.get("certificate_details"); |
|
|
|
|
|
|
|
|
if (result.containsKey("certificate_details")) { |
|
|
|
|
|
List<Map<String, Object>> details = (List<Map<String, Object>>) result.get("certificate_details"); |
|
|
|
|
|
|
|
|
// List<Map<String, Object>> filtered = details.stream() |
|
|
|
|
|
// .filter(row -> row.get("pdf_url") != null && !row.get("pdf_url").toString().trim().isEmpty()) |
|
|
|
|
|
// .toList(); |
|
|
|
|
|
|
|
|
List<Map<String, Object>> filtered = details.stream() |
|
|
|
|
|
.filter(row -> row.get("pdf_url") != null && !row.get("pdf_url").toString().trim().isEmpty()) |
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
// result.put("certificate_details", filtered); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
result.put("certificate_details", filtered); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|