From bcedb566ff53bf6640574ceccac338b80f0e377c Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 7 Jan 2025 11:22:49 -0600 Subject: [PATCH] CE-1955 Add info summary line re: number of records processed; also return early if all records have mapping errors... this could lead to some spoon feeding, but, is working better now, so. --- .../bulk/insert/BulkInsertTransformStep.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/implementations/bulk/insert/BulkInsertTransformStep.java b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/implementations/bulk/insert/BulkInsertTransformStep.java index f113f76f..f406608b 100644 --- a/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/implementations/bulk/insert/BulkInsertTransformStep.java +++ b/qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/processes/implementations/bulk/insert/BulkInsertTransformStep.java @@ -241,8 +241,10 @@ public class BulkInsertTransformStep extends AbstractTransformStep { ///////////////////////////////////////////////////////////////////////////////// // skip the rest of this method if there aren't any records w/o errors in them // + // but, advance our counter before we return. // ///////////////////////////////////////////////////////////////////////////////// this.rowsProcessed += recordsInThisPage; + return; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -508,6 +510,15 @@ public class BulkInsertTransformStep extends AbstractTransformStep ArrayList rs = new ArrayList<>(); String tableLabel = table == null ? "" : table.getLabel(); + ProcessSummaryLine recordsProcessedLine = new ProcessSummaryLine(Status.INFO); + recordsProcessedLine.setCount(rowsProcessed); + rs.add(recordsProcessedLine); + recordsProcessedLine.withMessageSuffix(" processed from the file."); + recordsProcessedLine.withSingularFutureMessage("record was"); + recordsProcessedLine.withSingularPastMessage("record was"); + recordsProcessedLine.withPluralFutureMessage("records were"); + recordsProcessedLine.withPluralPastMessage("records were"); + String noWarningsSuffix = processSummaryWarningsAndErrorsRollup.countWarnings() == 0 ? "" : " with no warnings"; okSummary.setSingularFutureMessage(tableLabel + " record will be inserted" + noWarningsSuffix + "."); okSummary.setPluralFutureMessage(tableLabel + " records will be inserted" + noWarningsSuffix + ".");