From 228b290570cecda7f13586db6fdf445cbfca22f8 Mon Sep 17 00:00:00 2001 From: AKurakin Date: Wed, 30 Aug 2023 15:27:38 +0300 Subject: [PATCH] gateway-api http://jira.mfd.msk:8088/browse/CLS-347 bug fix --- .../service/adapter/CompanyRequestAdapter.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/CompanyRequestAdapter.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/CompanyRequestAdapter.java index c2f83f531..f8a31a3ca 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/CompanyRequestAdapter.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/CompanyRequestAdapter.java @@ -14,6 +14,7 @@ import ru.spcex.platform.enumeration.CompanySymbol; import ru.spcex.platform.enumeration.WorkflowStatus; import ru.spcex.platform.imdg.api.Imdg; import ru.spcex.platform.imdg.api.ImdgProvider; +import ru.spcex.platform.utils.log.ExceptionUtils; import java.util.Map; @@ -81,19 +82,21 @@ public class CompanyRequestAdapter { clientCodeNewRequest.setCode(client.getClientCode()); clientCodeNewRequest.setMoneyAccountId(client.getMoneyAccountId()); clientCodeNewRequest.setDepoAccountId(client.getDepoAccountId()); - if (client.getMoneyAccount() != null) { + if (client.getMoneyAccount() != null) try { Account mAccount = accountMap.getSingleObjectByFieldValues(Map.of( // "accountType", AccountType.Clrn.getKey(), or "accountType", AccountType.Info.getKey(), - "account", client.getDepoAccount() + "account", client.getMoneyAccount() )); if (mAccount == null) { log.warn("Money account \"{}\" not found", client.getMoneyAccount()); } else { - log.warn("Money account \"{}\" found with id={}", client.getMoneyAccount(), mAccount.getId()); + log.trace("Money account \"{}\" found with id={}", client.getMoneyAccount(), mAccount.getId()); client.setDepoAccountId(mAccount.getId()); } + } catch (Exception e) { + log.warn("Error happened when search money account \"{}\": {}", client.getMoneyAccount(), ExceptionUtils.getStackTrace(e)); } - if (client.getDepoAccount() != null) { + if (client.getDepoAccount() != null) try { Account dAccount = accountMap.getSingleObjectByFieldValues(Map.of( "accountType", AccountType.Depo.getKey(), "account", client.getDepoAccount() @@ -101,9 +104,11 @@ public class CompanyRequestAdapter { if (dAccount == null) { log.warn("Depo account \"{}\" not found", client.getDepoAccount()); } else { - log.warn("Depo account \"{}\" found with id={}", client.getDepoAccount(), dAccount.getId()); + log.trace("Depo account \"{}\" found with id={}", client.getDepoAccount(), dAccount.getId()); client.setDepoAccountId(dAccount.getId()); } + } catch (Exception e) { + log.warn("Error happened when search depo account \"{}\": {}", client.getMoneyAccount(), ExceptionUtils.getStackTrace(e)); } return clientCodeNewRequest; }