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

View file

@ -257,7 +257,7 @@ public class ImdgHazelcast<T extends SpcexObjectBase> implements Imdg<T> {
if (els.size() > 1) {
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