This commit is contained in:
parent
a44c6072a3
commit
ae9bff9b16
1 changed files with 4 additions and 3 deletions
|
|
@ -62,7 +62,7 @@ public class AccountFacade implements IClearingFacade {
|
||||||
String currencyCode = moneyAccountMsgRequest.getCurrCode() == null ? CurrencyCode.RUB.getKey() : moneyAccountMsgRequest.getCurrCode();
|
String currencyCode = moneyAccountMsgRequest.getCurrCode() == null ? CurrencyCode.RUB.getKey() : moneyAccountMsgRequest.getCurrCode();
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
|
|
||||||
String accountValue = defineAccountValForInfo(currencyCode);
|
String accountValue = defineAccountValForInfo(currencyCode, moneyAccountMsgRequest.getEks_account());
|
||||||
Account account = new Account();
|
Account account = new Account();
|
||||||
account.setCompanyId(company.getId());
|
account.setCompanyId(company.getId());
|
||||||
account.setAccount(accountValue);
|
account.setAccount(accountValue);
|
||||||
|
|
@ -78,7 +78,7 @@ public class AccountFacade implements IClearingFacade {
|
||||||
return new Pair<>(specificAccId, currencyCode);
|
return new Pair<>(specificAccId, currencyCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String defineAccountValForInfo(String currencyCode) {
|
private String defineAccountValForInfo(String currencyCode, String eksAccount) {
|
||||||
ImdgPredicateBuilder predicateBuilder = currencyImdg.predicateBuilder();
|
ImdgPredicateBuilder predicateBuilder = currencyImdg.predicateBuilder();
|
||||||
Currency currency = currencyImdg.getFirstObjectByPredicate(
|
Currency currency = currencyImdg.getFirstObjectByPredicate(
|
||||||
predicateBuilder.equals("currencyCode", currencyCode)
|
predicateBuilder.equals("currencyCode", currencyCode)
|
||||||
|
|
@ -88,7 +88,8 @@ public class AccountFacade implements IClearingFacade {
|
||||||
ImdgPredicateBuilder pb = accountImdg.predicateBuilder();
|
ImdgPredicateBuilder pb = accountImdg.predicateBuilder();
|
||||||
ImdgPredicate andPredicate = pb.and(
|
ImdgPredicate andPredicate = pb.and(
|
||||||
pb.equals("accountType", AccountType.Anlt.getKey()),
|
pb.equals("accountType", AccountType.Anlt.getKey()),
|
||||||
pb.equals("currency", currencyCode)
|
pb.equals("currency", currencyCode),
|
||||||
|
pb.equals("account", eksAccount)
|
||||||
);
|
);
|
||||||
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
||||||
if (accountsAnlt.isEmpty()) {
|
if (accountsAnlt.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue