создание PaymentInstruction по возвратам для итоговой сессии МКР условия и поля

This commit is contained in:
ialbert 2023-06-08 14:42:37 +03:00
parent 4e283ff5e8
commit f5a7842ab1
2 changed files with 14 additions and 1 deletions

View file

@ -146,6 +146,9 @@ public class PaymentInstructionBuilderFinalMkrDeals {
payment1.setDocumentNumber(nextDocumentNumber(lm_t, payment1));
payment1.setCreditLeg_direction(InOutDirection.out.getKey());
payment1.setDebitLeg_direction(InOutDirection.in.getKey());
payment1.setCreditLeg_securityId(lm_t.getSecurityId());
payment1.setDebitLeg_securityId(lm_t.getSecurityId());
payment1.setSessionId(sessionId);
}
//****************
@ -193,6 +196,11 @@ public class PaymentInstructionBuilderFinalMkrDeals {
payment2.setDocumentNumber(nextDocumentNumber(cm_t, payment2));
payment2.setCreditLeg_direction(InOutDirection.out.getKey());
payment2.setDebitLeg_direction(InOutDirection.in.getKey());
payment2.setCreditLeg_currencyCode(CurrencyCode.RUB.getKey());
payment2.setDebitLeg_currencyCode(CurrencyCode.RUB.getKey());
payment2.setCreditLeg_securityId(lm_t.getSecurityId());
payment2.setDebitLeg_securityId(lm_t.getSecurityId());
payment2.setSessionId(sessionId);
}
return new Pair<>(payment1, payment2);
}

View file

@ -89,7 +89,12 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
RegistryCodeSqlBuilder registryCodeSqlBuilder = RegistryCodeSqlBuilder.getInstance(LM_T, CM_T);
String registryCodeCondition = registryCodeSqlBuilder.build();
Collection<Registry> rgsAll = registryImdg.getCollectionObjectsBySQL(registryCodeCondition);
Collection<Registry> rgsAll = registryImdg.getCollectionObjectsBySQL(registryCodeCondition)
.stream()
.filter(rgs -> rgs.getValueDate() != null)
.filter(rgs -> rgs.getSettlementDate() != null)
.filter(rgs -> rgs.getSettlementDate().isAfter(rgs.getValueDate()))
.toList();
log.debug("LM*T and CM*T size = {}", rgsAll.size());
List<Registry> obligationsByMoney = rgsAll.stream()