FOND section: TCR#depoAccountId NULL fix
This commit is contained in:
parent
1eb7a9d485
commit
c1ec29a8be
1 changed files with 9 additions and 4 deletions
|
|
@ -112,19 +112,24 @@ public class RegistryFondBuilder implements IRegistryBuilder {
|
|||
if ((regDsgn.equals(RegistryDesignation.O) && side.isBuy()) || (regDsgn.equals(RegistryDesignation.T) && side.isSell())) {
|
||||
isMoney = true;
|
||||
reg.setAccountId(tcr.getMoneyAccountId());
|
||||
account = accountImdg.getSingleObjectByID(tcr.getMoneyAccountId());
|
||||
if (tcr.getMoneyAccountId() != null) {
|
||||
account = accountImdg.getSingleObjectByID(tcr.getMoneyAccountId());
|
||||
capacityByAccount = defineCapacityByAccountType(account.getAccountType(), tcr.getMoneyAccountId());
|
||||
}
|
||||
reg.setRegistryInstrumentType(RegistryInstrumentType.M.getKey());
|
||||
reg.setBalanceDimension(BalanceDimension.MONY.getKey()); //fixme add second leg code branch
|
||||
Currency currency = currencyImdg.getFirstObjectByFieldValues(Map.of("currencyCode", exec.getSettlementCurrency()));
|
||||
reg.setSecurityId(currency.getId());
|
||||
reg.setSecuritySymbol(currency.getCurrencyCode());
|
||||
capacityByAccount = defineCapacityByAccountType(account.getAccountType(), tcr.getMoneyAccountId());
|
||||
} else if ((regDsgn.equals(RegistryDesignation.T) && side.isBuy()) || (regDsgn.equals(RegistryDesignation.O) && side.isSell())) {
|
||||
isMoney = false;
|
||||
account = accountImdg.getSingleObjectByID(tcr.getDepoAccountId());
|
||||
reg.setAccountId(tcr.getDepoAccountId());
|
||||
DepoAccount depoAccount = depoAccountImdg.getFirstObjectByFieldValues(
|
||||
DepoAccount depoAccount = null;
|
||||
if (tcr.getDepoAccountId() != null) {
|
||||
account = accountImdg.getSingleObjectByID(tcr.getDepoAccountId());
|
||||
depoAccount = depoAccountImdg.getFirstObjectByFieldValues(
|
||||
Map.of("accountId", tcr.getDepoAccountId()));
|
||||
}
|
||||
if (depoAccount != null) {
|
||||
capacityByAccount = depoAccount.getDepoAccountType();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue