SDF57 processing

This commit is contained in:
etreschenkov 2023-05-24 19:44:14 +03:00
parent b5de68ae1e
commit 53e10b7527
2 changed files with 8 additions and 6 deletions

View file

@ -127,9 +127,9 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
Account accountCred = validator.getStored(ValidationStored.Sdf57AccountCred); Account accountCred = validator.getStored(ValidationStored.Sdf57AccountCred);
//адресат CREDIT / владелец DEBIT //адресат CREDIT / владелец DEBIT
Optional<Statement> statementDeb = createStatementIfNeeded.apply(companyCred, accountCred, InOutDirection.in); Optional<Statement> statementDeb = createStatementIfNeeded.apply(companyDeb, accountDeb, InOutDirection.in);
//адресат DEBIT / владелец CREDIT //адресат DEBIT / владелец CREDIT
Optional<Statement> statementCred = createStatementIfNeeded.apply(companyDeb, accountDeb, InOutDirection.out); Optional<Statement> statementCred = createStatementIfNeeded.apply(companyCred, accountCred, InOutDirection.out);
Consumer<StmtCmpAcc> createRegistryIfNeeded = stmtCmpAcc -> { Consumer<StmtCmpAcc> createRegistryIfNeeded = stmtCmpAcc -> {
Statement stmt = stmtCmpAcc.statement(); Statement stmt = stmtCmpAcc.statement();
@ -213,9 +213,11 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
//rgs.setTradingClearingRegistry(); //todo ! //rgs.setTradingClearingRegistry(); //todo !
rgs.setRegistryStatus(RegistryStatus.PROC.getKey()); rgs.setRegistryStatus(RegistryStatus.PROC.getKey());
rgs.setSecurityId(statement.getSecurityId()); rgs.setSecurityId(statement.getSecurityId());
Security security = securityImdg.getSingleObjectByID(statement.getSecurityId()); if (statement.getSecurityId() != null) {
if (security != null) { Security security = securityImdg.getSingleObjectByID(statement.getSecurityId());
rgs.setSecuritySymbol(security.getSecuritySymbol()); if (security != null) {
rgs.setSecuritySymbol(security.getSecuritySymbol());
}
} }
InOutDirection inOutDirection = IEnumKey.getEnumByKey(InOutDirection.class, statement.getInOutDirection()); InOutDirection inOutDirection = IEnumKey.getEnumByKey(InOutDirection.class, statement.getInOutDirection());
//считаю balance при создании нулевым и исхожу из этого //считаю balance при создании нулевым и исхожу из этого

View file

@ -257,7 +257,7 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
if (els.size() > 1) { if (els.size() > 1) {
throw new RuntimeException("More than one element found by predicate - " + els.size()); throw new RuntimeException("More than one element found by predicate - " + els.size());
} }
return els.iterator().next(); return els.size() == 1 ? els.iterator().next() : null;
} }
@Override @Override