From d9f225569aada9400ac95800740c1eec1ff05853 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Fri, 13 Dec 2024 15:51:50 -0700 Subject: [PATCH] Consultation Report QA (#443) * All - Use LocalDate for date formatting * All - Adjust header height for text which was clipped * Inventory - Include date with status when available * Inventory - Remove 'Lot' from AFO Count header * Summary - Join related sites on collection objects * Repatriation - Add field collection sites * Repatriation - Remove 'Lot' from AFO Count header --- .../resources/inventory_consultation.jrxml | 59 +++++------ .../repatriation_request_consultation.jrxml | 90 +++++++++-------- .../summary_documentation_consultation.jrxml | 98 +++++++++---------- 3 files changed, 128 insertions(+), 119 deletions(-) diff --git a/services/report/3rdparty/jasper-cs-report/src/main/resources/inventory_consultation.jrxml b/services/report/3rdparty/jasper-cs-report/src/main/resources/inventory_consultation.jrxml index 62b079b63..60488b3ce 100644 --- a/services/report/3rdparty/jasper-cs-report/src/main/resources/inventory_consultation.jrxml +++ b/services/report/3rdparty/jasper-cs-report/src/main/resources/inventory_consultation.jrxml @@ -30,7 +30,7 @@ WITH related_objects AS ( SELECT hierarchy.id as object_id, relation.objectcsid, - relation.subjectcsid as repatriation_csid + relation.subjectcsid as inventory_csid FROM relations_common relation INNER JOIN hierarchy on hierarchy.name = relation.objectcsid WHERE relation.objectdocumenttype = 'CollectionObject' @@ -38,8 +38,8 @@ WITH related_objects AS ( $P!{whereclause_cte} ), related_exits AS ( - SELECT DISTINCT ON (objs.repatriation_csid, hierarchy.id) objs.objectcsid, - objs.repatriation_csid, + SELECT DISTINCT ON (objs.inventory_csid, hierarchy.id) objs.objectcsid, + objs.inventory_csid, hierarchy.id as exit_id, relation.subjectcsid as exit_csid FROM related_objects objs @@ -92,7 +92,7 @@ FROM hierarchy inv_hierarchy -- Related Object - Object count -- Use regex matching because the refnames can contain subsets of the others -- a word boundary (\y) allows us to match start/ends of refnames easily - SELECT objs.repatriation_csid, + SELECT objs.inventory_csid, sum( CASE WHEN ocg.objectcounttype ~ 'minimum' THEN ocg.objectcount @@ -109,16 +109,16 @@ FROM hierarchy inv_hierarchy INNER JOIN related_objects objs ON objs.object_id = ocg_hierarchy.parentid INNER JOIN objectcountgroup ocg ON ocg.id = ocg_hierarchy.id WHERE ocg_hierarchy.name = 'collectionobjects_common:objectCountGroupList' - GROUP BY objs.repatriation_csid - ) object_count ON object_count.repatriation_csid = inv_hierarchy.name + GROUP BY objs.inventory_csid + ) object_count ON object_count.inventory_csid = inv_hierarchy.name LEFT JOIN ( -- Related Object - Field Collection Sites - SELECT objs.repatriation_csid, + SELECT objs.inventory_csid, array_agg(fcs.item) AS sites FROM collectionobjects_common_fieldcollectionsites fcs INNER JOIN related_objects objs ON objs.object_id = fcs.id - GROUP BY objs.repatriation_csid - ) field_collection_sites ON field_collection_sites.repatriation_csid = inv_hierarchy.name + GROUP BY objs.inventory_csid + ) field_collection_sites ON field_collection_sites.inventory_csid = inv_hierarchy.name LEFT JOIN ( -- Related Consultations (Inventory -> Consultation) -- Number of Consultation Log Entries @@ -138,14 +138,14 @@ FROM hierarchy inv_hierarchy -- Related Object Exits (Object -> ObjectExit (New)) -- Current owner with exit date -- Allows NULL values to aggregate so we don't lose track of pairs - SELECT related_exits.repatriation_csid, + SELECT related_exits.inventory_csid, array_agg(exit.exitdate) as exit_dates, array_agg(owners.item) AS exit_owners FROM exits_common exit INNER JOIN related_exits on related_exits.exit_id = exit.id LEFT JOIN exits_common_owners owners on owners.id = exit.id AND owners.pos = 0 - GROUP BY related_exits.repatriation_csid - ) exits ON exits.repatriation_csid = inv_hierarchy.name + GROUP BY related_exits.inventory_csid + ) exits ON exits.inventory_csid = inv_hierarchy.name $P!{whereclause}]]> @@ -204,74 +204,74 @@ $P!{whereclause}]]> - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -293,7 +293,7 @@ $P!{whereclause}]]> - + @@ -312,7 +312,10 @@ $P!{whereclause}]]> - + + @@ -348,7 +351,7 @@ $P!{whereclause}]]> if (!owner) { return null; } - return dates[index] === null ? owner : java.lang.String.format("%s (%tF)", owner, dates[index]); + return dates[index] === null ? owner : owner + ' (' + dates[index].toLocalDateTime().toLocalDate() + ')'; }).filter(owner => !!owner).join('; ') ]]> diff --git a/services/report/3rdparty/jasper-cs-report/src/main/resources/repatriation_request_consultation.jrxml b/services/report/3rdparty/jasper-cs-report/src/main/resources/repatriation_request_consultation.jrxml index bef256a47..a2eb07b65 100644 --- a/services/report/3rdparty/jasper-cs-report/src/main/resources/repatriation_request_consultation.jrxml +++ b/services/report/3rdparty/jasper-cs-report/src/main/resources/repatriation_request_consultation.jrxml @@ -1,6 +1,6 @@ - + @@ -10,7 +10,7 @@