фикс D регистров при обработке Sdf57
This commit is contained in:
parent
9a3cb66037
commit
56719d4d37
1 changed files with 12 additions and 10 deletions
|
|
@ -193,17 +193,19 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
registryImdg.insert(registryB);
|
registryImdg.insert(registryB);
|
||||||
};
|
};
|
||||||
|
|
||||||
Consumer<RegistryDesignation> createRegD = (dsgn) -> {
|
|
||||||
findRegByDesignation(stmt, RegistryDesignation.O).ifPresent(registry -> {
|
|
||||||
Registry registryD = copyRegD(registry);
|
|
||||||
registryImdg.insert(registryD);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
findRegByDesignation(stmt, RegistryDesignation.A).ifPresentOrElse(update, () -> createRegA.accept(RegistryDesignation.A));
|
findRegByDesignation(stmt, RegistryDesignation.A).ifPresentOrElse(update, () -> createRegA.accept(RegistryDesignation.A));
|
||||||
if (!StringUtils.isEmpty(sdf57.getSpecif()) && pattern.matcher(sdf57.getSpecif()).find()) {
|
InOutDirection direction = IEnumKey.getEnumByKey(InOutDirection.class, stmt.getInOutDirection());
|
||||||
|
if (!StringUtils.isEmpty(sdf57.getSpecif()) && pattern.matcher(sdf57.getSpecif()).find() && InOutDirection.in.equals(direction)) {
|
||||||
//todo доделать 11. Идентификация средств УК на клиринговом счете
|
//todo доделать 11. Идентификация средств УК на клиринговом счете
|
||||||
findRegByDesignation(stmt, RegistryDesignation.D).ifPresentOrElse(update, () -> createRegD.accept(RegistryDesignation.D));
|
findRegByDesignation(stmt, RegistryDesignation.D).ifPresentOrElse(rgs -> {
|
||||||
|
rgs.setBalance(safeBD(rgs.getBalance()).add(safeBD(stmt.getAmount())));
|
||||||
|
rgs.setUpdated(Instant.now());
|
||||||
|
registryImdg.update(rgs);
|
||||||
|
},
|
||||||
|
() -> findRegByDesignation(stmt, RegistryDesignation.O).ifPresent(rgs -> {
|
||||||
|
Registry registryD = copyRegD(rgs);
|
||||||
|
registryImdg.insert(registryD);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
stmt.setOperationStatus(OperationStatus.Executed.getKey());
|
stmt.setOperationStatus(OperationStatus.Executed.getKey());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -377,7 +379,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
pb.equals("companyId", s.getAddresseeId()),
|
pb.equals("companyId", s.getAddresseeId()),
|
||||||
pb.equals("accountId", s.getAccountId())
|
pb.equals("accountId", s.getAccountId())
|
||||||
);
|
);
|
||||||
if (des.equals(RegistryDesignation.D) && !TextUtil.isEmpty(s.getContract())) {
|
if (des.equals(RegistryDesignation.D) || des.equals(RegistryDesignation.O) && !TextUtil.isEmpty(s.getContract())) {
|
||||||
rgstrPredicate = pb.and(rgstrPredicate, pb.equals("contract", s.getContract()));
|
rgstrPredicate = pb.and(rgstrPredicate, pb.equals("contract", s.getContract()));
|
||||||
}
|
}
|
||||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue