From 530130abd24eb4deca018e62bcc37f712dc4c608 Mon Sep 17 00:00:00 2001 From: Marco Russo Date: Fri, 15 Nov 2024 14:39:40 +0000 Subject: [PATCH] fix: lost code --- .../AccountingCorePresentationViewService.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/accounting_reporting_core/src/main/java/org/cardanofoundation/lob/app/accounting_reporting_core/resource/presentation_layer_service/AccountingCorePresentationViewService.java b/accounting_reporting_core/src/main/java/org/cardanofoundation/lob/app/accounting_reporting_core/resource/presentation_layer_service/AccountingCorePresentationViewService.java index 95f45b3..3dcbaaa 100644 --- a/accounting_reporting_core/src/main/java/org/cardanofoundation/lob/app/accounting_reporting_core/resource/presentation_layer_service/AccountingCorePresentationViewService.java +++ b/accounting_reporting_core/src/main/java/org/cardanofoundation/lob/app/accounting_reporting_core/resource/presentation_layer_service/AccountingCorePresentationViewService.java @@ -57,19 +57,22 @@ public ReconciliationResponseView allReconciliationTransaction(ReconciliationFil val transactions = accountingCoreTransactionRepository.findAllReconciliationSpecial(body.getReconciliationRejectionCode(), body.getDateFrom(), body.getLimit(), body.getPage()).stream() .filter(o -> { if (o[0] instanceof TransactionEntity) { - if (!txDuplicated.contains(o[0])) { - txDuplicated.add(o[0]); + if (!txDuplicated.contains(((TransactionEntity) o[0]).getId())) { + txDuplicated.add(((TransactionEntity) o[0]).getId()); return true; } } if (o[1] instanceof ReconcilationViolation) { - return true; + if (!txDuplicated.contains(((ReconcilationViolation) o[1]).getTransactionId())) { + txDuplicated.add(((ReconcilationViolation) o[1]).getTransactionId()); + return true; + } } - return false; }) .map(this::getReconciliationTransactionsSelector) - .collect(toSet()); + .sorted(Comparator.comparing(TransactionReconciliationTransactionsView::getId)) + .collect(Collectors.toCollection(LinkedHashSet::new)); return new ReconciliationResponseView( (long) accountingCoreTransactionRepository.findAllReconciliationSpecialCount(body.getReconciliationRejectionCode(), body.getDateFrom(), body.getLimit(), body.getPage()).size(),