изменения по финальной МКР сессии 5/7 шаг bugfix
This commit is contained in:
parent
84ccc444b8
commit
679b5cc01b
2 changed files with 37 additions and 33 deletions
|
|
@ -149,22 +149,22 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
|||
List<Registry> allLiabilities = rgsAll
|
||||
.stream()
|
||||
.filter(registry -> RegistryDesignation.L.equalsByKey(registry.getRegistryDesignation()))
|
||||
.filter(obligation -> {
|
||||
//если valueDate < settlement date
|
||||
if (!(obligation.getValueDate() != null
|
||||
&& obligation.getSettlementDate() != null
|
||||
&& obligation.getValueDate().isBefore(obligation.getSettlementDate()))) {
|
||||
return true;
|
||||
}
|
||||
Optional<Registry> dmx = searchDmx(obligation);
|
||||
if (dmx.isPresent()) {
|
||||
log.debug("LM*T#id={}, DM*X#id={} found, no action needed for group {}, skipping liability",
|
||||
obligation.getId(),
|
||||
obligation.getId(),
|
||||
obligation.getGroupId());
|
||||
}
|
||||
return dmx.isEmpty();
|
||||
})
|
||||
//.filter(obligation -> {
|
||||
// //если valueDate < settlement date
|
||||
// if (!(obligation.getValueDate() != null
|
||||
// && obligation.getSettlementDate() != null
|
||||
// && obligation.getValueDate().isBefore(obligation.getSettlementDate()))) {
|
||||
// return true;
|
||||
// }
|
||||
// Optional<Registry> dmx = searchDmx(obligation);
|
||||
// if (dmx.isPresent()) {
|
||||
// log.debug("LM*T#id={}, DM*X#id={} found, no action needed for group {}, skipping liability",
|
||||
// obligation.getId(),
|
||||
// obligation.getId(),
|
||||
// obligation.getGroupId());
|
||||
// }
|
||||
// return dmx.isEmpty();
|
||||
//})
|
||||
.toList();
|
||||
for (int i = 0; i < allLiabilities.size(); i++) {
|
||||
//сортировка чтобы найти сделки с одинаковыми направлениями и адресатами и схлопнуть в одну
|
||||
|
|
|
|||
|
|
@ -112,24 +112,28 @@ public class InspectionObligationsDepositReturn implements ISessionStage {
|
|||
log.debug("groupId={}, OM*T.id={}", entry.getKey(), omtRgs.getId());
|
||||
BigDecimal omtBalance = safeBD(omtRgs.getBalance());
|
||||
|
||||
if (omtRgs.getValueDate() != null
|
||||
&& omtRgs.getSettlementDate() != null
|
||||
&& omtRgs.getValueDate().isBefore(omtRgs.getSettlementDate())) {
|
||||
Optional<Registry> dmx = searchDmx(omtRgs);
|
||||
if (dmx.isPresent()) {
|
||||
BigDecimal dmxBalance = safeBD(dmx.get().getBalance());
|
||||
log.debug("OM*T.id={} -> DM*X.id={}, dmxBalance={}, omtBalance={}",
|
||||
omtRgs.getId(),
|
||||
dmx.get().getId(),
|
||||
dmxBalance, omtBalance
|
||||
);
|
||||
if (dmxBalance.compareTo(omtBalance) >= 0) {
|
||||
group.forEach(rgs -> updateStatus(rgs, RegistryStatus.OK));
|
||||
} else {
|
||||
group.forEach(rgs -> updateStatus(rgs, registryStatusForDmxCheckFailed()));
|
||||
}
|
||||
continue;
|
||||
//первая часть сделки депозита
|
||||
if (omtRgs.getValueDate() == null
|
||||
|| omtRgs.getSettlementDate() == null
|
||||
|| !omtRgs.getValueDate().isBefore(omtRgs.getSettlementDate())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//вторая часть сделки - возврат депозита
|
||||
Optional<Registry> dmx = searchDmx(omtRgs);
|
||||
if (dmx.isPresent()) {
|
||||
BigDecimal dmxBalance = safeBD(dmx.get().getBalance());
|
||||
log.debug("OM*T.id={} -> DM*X.id={}, dmxBalance={}, omtBalance={}",
|
||||
omtRgs.getId(),
|
||||
dmx.get().getId(),
|
||||
dmxBalance, omtBalance
|
||||
);
|
||||
if (dmxBalance.compareTo(omtBalance) >= 0) {
|
||||
group.forEach(rgs -> updateStatus(rgs, RegistryStatus.OK));
|
||||
} else {
|
||||
group.forEach(rgs -> updateStatus(rgs, registryStatusForDmxCheckFailed()));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Optional<Registry> amfAssetO = searchAssetByOMT(omtRgs);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue