From 53810fd4f1ca7a9be40bc4c66cd7daaadec7ea26 Mon Sep 17 00:00:00 2001 From: etreschenkov Date: Fri, 6 Oct 2023 11:27:37 +0300 Subject: [PATCH] http://jira.mfd.msk:8088/browse/CLS-280 [5] --- .../service/ExecutionRegisterService.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/ExecutionRegisterService.java b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/ExecutionRegisterService.java index 36af7c2c8..e57fcf143 100644 --- a/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/ExecutionRegisterService.java +++ b/clearing-parent/registry-service/src/main/java/ru/spcex/clearing/registry/service/ExecutionRegisterService.java @@ -85,8 +85,16 @@ public class ExecutionRegisterService extends QueueConsumer implements Initializ public void executionRegisterNew(BaseRequest userRequest) { LocalDate localDateNow = LocalDate.now(); log.debug("ExecutionRegisterNewRequest received"); - Collection collectionFond = executionFondMap.getCollectionObjectsByFieldValues(Map.of("clearingDate", localDateNow)); - Collection collectionDeposit = executionDepositMap.getCollectionObjectsByFieldValues(Map.of("clearingDate", localDateNow)); + Collection collectionFond = executionFondMap.getCollectionObjectsByFieldValues( + Map.of( + "clearingDate", localDateNow, + "side", Side.SELL.getKey() + )); + Collection collectionDeposit = executionDepositMap.getCollectionObjectsByFieldValues( + Map.of( + "clearingDate", localDateNow, + "side", MoneyFlowSide.SELL.getKey() + )); log.debug("Found {} ExecutionFond and {} ExecutionDeposit on clearingDate={}", collectionFond.size(), collectionDeposit.size(), localDateNow); preClearMap.preClearMap(); @@ -181,12 +189,16 @@ public class ExecutionRegisterService extends QueueConsumer implements Initializ sellerId = common.getCounterPartyId(); buyerId = common.getCompanyId(); - if (companySymbolsForCounterPartyId != null) sellerClearingCode = companySymbolsForCounterPartyId.getCompanySymbolValue(); + if (companySymbolsForCounterPartyId != null) + sellerClearingCode = companySymbolsForCounterPartyId.getCompanySymbolValue(); sellerTradingClearingRegister = common.getCounterPartyTradingClearingRegistry(); - if (moneyAccountForCounterPartyTkrId != null) sellerMoneyAccount = moneyAccountForCounterPartyTkrId.getAccount(); - if (depoAccountForCounterPartyTkrId != null) sellerDepoAccount = depoAccountForCounterPartyTkrId.getAccount(); + if (moneyAccountForCounterPartyTkrId != null) + sellerMoneyAccount = moneyAccountForCounterPartyTkrId.getAccount(); + if (depoAccountForCounterPartyTkrId != null) + sellerDepoAccount = depoAccountForCounterPartyTkrId.getAccount(); - if (companySymbolsForCompanyId != null) buyerClearingCode = companySymbolsForCompanyId.getCompanySymbolValue(); + if (companySymbolsForCompanyId != null) + buyerClearingCode = companySymbolsForCompanyId.getCompanySymbolValue(); buyerTradingClearingRegister = common.getPartyTradingClearingRegistry(); if (moneyAccountForTkrId != null) buyerMoneyAccount = moneyAccountForTkrId.getAccount(); if (depoAccountForTkrId != null) buyerDepoAccount = depoAccountForTkrId.getAccount(); @@ -196,15 +208,19 @@ public class ExecutionRegisterService extends QueueConsumer implements Initializ sellerId = common.getCompanyId(); buyerId = common.getCounterPartyId(); - if (companySymbolsForCompanyId != null) sellerClearingCode = companySymbolsForCompanyId.getCompanySymbolValue(); + if (companySymbolsForCompanyId != null) + sellerClearingCode = companySymbolsForCompanyId.getCompanySymbolValue(); sellerTradingClearingRegister = common.getPartyTradingClearingRegistry(); if (moneyAccountForTkrId != null) sellerMoneyAccount = moneyAccountForTkrId.getAccount(); if (depoAccountForTkrId != null) sellerDepoAccount = depoAccountForTkrId.getAccount(); - if (companySymbolsForCounterPartyId != null) buyerClearingCode = companySymbolsForCounterPartyId.getCompanySymbolValue(); + if (companySymbolsForCounterPartyId != null) + buyerClearingCode = companySymbolsForCounterPartyId.getCompanySymbolValue(); buyerTradingClearingRegister = common.getCounterPartyTradingClearingRegistry(); - if (moneyAccountForCounterPartyTkrId != null) buyerMoneyAccount = moneyAccountForCounterPartyTkrId.getAccount(); - if (depoAccountForCounterPartyTkrId != null) buyerDepoAccount = depoAccountForCounterPartyTkrId.getAccount(); + if (moneyAccountForCounterPartyTkrId != null) + buyerMoneyAccount = moneyAccountForCounterPartyTkrId.getAccount(); + if (depoAccountForCounterPartyTkrId != null) + buyerDepoAccount = depoAccountForCounterPartyTkrId.getAccount(); }