From ed3c08cdeb02360c95f6bafe5ad9bf8c1df02cb5 Mon Sep 17 00:00:00 2001 From: akulikov Date: Fri, 29 Dec 2023 14:47:13 +0300 Subject: [PATCH] http://jira.mfd.msk:8088/browse/CLS-608 fixes --- .../reports/bean/DepoPaymentInstructionRegisterReport.java | 2 +- .../registry/reports/bean/MoneyBalanceRegisterReport.java | 2 +- .../DepoPaymentInstructionRegisterReportBuilder.java | 2 +- .../MoneyPaymentInstructionRegisterReportBuilder.java | 2 +- .../service/DepoPaymentInstructionRegisterService.java | 5 +++-- .../service/MoneyPaymentInstructionRegisterService.java | 5 +++-- .../service/DepoPaymentInstructionRegisterServiceTest.java | 2 ++ .../service/MoneyPaymentInstructionRegisterServiceTest.java | 2 ++ .../depo_payment_instruction_register_expected.csv | 2 +- .../expected_reports/money_balance_register_expected.csv | 2 +- 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/DepoPaymentInstructionRegisterReport.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/DepoPaymentInstructionRegisterReport.java index 540f3bfb7..5bd5b4ffa 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/DepoPaymentInstructionRegisterReport.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/DepoPaymentInstructionRegisterReport.java @@ -54,7 +54,7 @@ public class DepoPaymentInstructionRegisterReport implements CSVReport { @CsvBindByName(column = "Количество ЦБ") @CsvBindByPosition(position = 10) - @CsvNumber(value = "#0.00", writeFormat = "#0.00") + @CsvNumber(value = "#0", writeFormat = "#0") private BigDecimal amount; diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/MoneyBalanceRegisterReport.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/MoneyBalanceRegisterReport.java index 3399336f1..471f78687 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/MoneyBalanceRegisterReport.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/bean/MoneyBalanceRegisterReport.java @@ -42,7 +42,7 @@ public class MoneyBalanceRegisterReport implements CSVReport { @CsvBindByName(column = "Остаток денежных средств") @CsvBindByPosition(position = 7) - @CsvNumber(value = "#0", writeFormat = "#0") + @CsvNumber(value = "#0.00", writeFormat = "#0.00") private BigDecimal sum; diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/DepoPaymentInstructionRegisterReportBuilder.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/DepoPaymentInstructionRegisterReportBuilder.java index be84e51b9..78af22ed8 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/DepoPaymentInstructionRegisterReportBuilder.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/DepoPaymentInstructionRegisterReportBuilder.java @@ -26,7 +26,7 @@ public class DepoPaymentInstructionRegisterReportBuilder extends CSVReportBuilde @Override protected String reportName() { - return "depo_payment_instruction_register"; + return "Реестр распоряжений, направленных расчетному депозитарию"; } @Override diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/MoneyPaymentInstructionRegisterReportBuilder.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/MoneyPaymentInstructionRegisterReportBuilder.java index 2f4e7ba68..b322c1fd3 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/MoneyPaymentInstructionRegisterReportBuilder.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/reports/builders/MoneyPaymentInstructionRegisterReportBuilder.java @@ -23,7 +23,7 @@ public class MoneyPaymentInstructionRegisterReportBuilder extends CSVReportBuild @Override protected String reportName() { - return "money_payment_instruction_register"; + return "Реестр распоряжений, направленных расчетной организации"; } @Override diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterService.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterService.java index 0c0c7230c..2a1fe56f8 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterService.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterService.java @@ -31,6 +31,7 @@ import ru.spcex.platform.utils.validation.IValidator; import java.io.File; import java.time.Instant; +import java.time.LocalDate; import java.util.*; import java.util.function.Function; @@ -115,14 +116,14 @@ public class DepoPaymentInstructionRegisterService extends QueueConsumer impleme } } } - paymentInstructions = null; log.debug("Filtered {} PaymentInstruction, with depo account's", depoPaymentInstructions.size()); if (!csvMode) preClearMap.preClearMap(); List paymentInstructionsForReport = new ArrayList<>(); for (PaymentInstruction paymentInstruction : depoPaymentInstructions) { if (isDuplicateInMap(paymentInstruction).isEmpty()) { if (!csvMode) insertDepoPaymentInstructionRegister(paymentInstruction); - else paymentInstructionsForReport.add(paymentInstruction); + else if (LocalDate.now().equals(paymentInstruction.getClearingDate())) + paymentInstructionsForReport.add(paymentInstruction); } } if (csvMode) { diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterService.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterService.java index 77fc92399..77c79ee0e 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterService.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterService.java @@ -31,6 +31,7 @@ import ru.spcex.platform.utils.validation.IValidator; import java.io.File; import java.time.Instant; +import java.time.LocalDate; import java.util.*; import java.util.function.Function; @@ -111,7 +112,6 @@ public class MoneyPaymentInstructionRegisterService extends QueueConsumer implem } } } - paymentInstructions = null; log.debug("Filtered {} PaymentInstruction, with money account's", moneyPaymentInstructions.size()); if (!csvMode) preClearMap.preClearMap(); @@ -119,7 +119,8 @@ public class MoneyPaymentInstructionRegisterService extends QueueConsumer implem for (PaymentInstruction paymentInstruction : moneyPaymentInstructions) { if (isDuplicateInMap(paymentInstruction).isEmpty()) { if (!csvMode) insertMoneyPaymentInstructionRegister(paymentInstruction); - else paymentInstructionsForReport.add(paymentInstruction); + else if (LocalDate.now().equals(paymentInstruction.getClearingDate())) + paymentInstructionsForReport.add(paymentInstruction); } } if (csvMode) { diff --git a/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterServiceTest.java b/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterServiceTest.java index 8b92c4562..cf2b3e904 100644 --- a/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterServiceTest.java +++ b/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/DepoPaymentInstructionRegisterServiceTest.java @@ -35,6 +35,7 @@ import ru.spcex.platform.imdg.api.ImdgProvider; import java.io.File; import java.io.IOException; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.Arrays; import java.util.Collection; @@ -105,6 +106,7 @@ class DepoPaymentInstructionRegisterServiceTest implements InitializingBean { PaymentInstruction paymentInstruction = new PaymentInstruction(); paymentInstruction.setSessionId(SESSION_ID); + paymentInstruction.setClearingDate(LocalDate.now()); paymentInstruction.setCreditLeg_accountId(TRADING_CLEARING_REGISTRY_DEPO_ACCOUNT_ID); paymentInstruction.setSenderId(TRADING_CLEARING_REGISTRY_COMPANY_ID); paymentInstruction.setCreditLeg_direction(SET_CREDIT_LEG_DIRECTION); diff --git a/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterServiceTest.java b/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterServiceTest.java index b4f95b3f0..27cd4876f 100644 --- a/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterServiceTest.java +++ b/clearing-parent/registry-service/src/test/java/ru/spcex/clearing/registry/service/MoneyPaymentInstructionRegisterServiceTest.java @@ -35,6 +35,7 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.time.Instant; +import java.time.LocalDate; import java.util.Arrays; import java.util.Collection; @@ -100,6 +101,7 @@ class MoneyPaymentInstructionRegisterServiceTest implements InitializingBean { sessionMap.update(sessionMkr); PaymentInstruction paymentInstruction = new PaymentInstruction(); paymentInstruction.setSessionId(sessionId); + paymentInstruction.setClearingDate(LocalDate.now()); paymentInstruction.setCreditLeg_account(CREDITLEG_ACCOUNT_CONST); paymentInstruction.setCreditLeg_accountId(CREDITLEG_ACCOUNT_ID_CONST); paymentInstruction.setCreditLeg_amount(CREDITLEG_AMOUNT_CONST); diff --git a/clearing-parent/registry-service/src/test/resources/expected_reports/depo_payment_instruction_register_expected.csv b/clearing-parent/registry-service/src/test/resources/expected_reports/depo_payment_instruction_register_expected.csv index 5413578c9..6cc058c4a 100644 --- a/clearing-parent/registry-service/src/test/resources/expected_reports/depo_payment_instruction_register_expected.csv +++ b/clearing-parent/registry-service/src/test/resources/expected_reports/depo_payment_instruction_register_expected.csv @@ -1,2 +1,2 @@ "Номер распоряжения","Дата распоряжения","Время формирования","Номер торгового банковского/клирингового счета списания","Наименование владельца счета списания","Код владельца счета списания","Номер торгового банковского/клирингового счета зачисления","Наименование владельца счета зачисления","Код владельца счета зачисления","Код ЦБ","Количество ЦБ" -"1",,,,,,,,,,"1.00" +"1","29.12.2023",,,,,,,,,"1.00" diff --git a/clearing-parent/registry-service/src/test/resources/expected_reports/money_balance_register_expected.csv b/clearing-parent/registry-service/src/test/resources/expected_reports/money_balance_register_expected.csv index eb4bf85f1..b760d3ce4 100644 --- a/clearing-parent/registry-service/src/test/resources/expected_reports/money_balance_register_expected.csv +++ b/clearing-parent/registry-service/src/test/resources/expected_reports/money_balance_register_expected.csv @@ -1,2 +1,2 @@ "Наименование Расчетного депозитария","Номер отчета","Дата","Время","Код валюты","Краткое наименование УК","Номер торгового /клирингового счета/ счета внутреннего учета СПВБ","Остаток денежных средств" -"ANY VALUE","20231229","29.12.2023","10:34:29","RUR",,"CLRN VALUE","123411" +"ANY VALUE","20231229","29.12.2023","14:42:40","RUR",,"CLRN VALUE","123411.00"