изменения по финальной МКР сессии 5/7 шаг bugfix

This commit is contained in:
ialbert 2023-06-30 17:20:15 +03:00
parent 84ccc444b8
commit 679b5cc01b
2 changed files with 37 additions and 33 deletions

View file

@ -149,22 +149,22 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
List<Registry> allLiabilities = rgsAll List<Registry> allLiabilities = rgsAll
.stream() .stream()
.filter(registry -> RegistryDesignation.L.equalsByKey(registry.getRegistryDesignation())) .filter(registry -> RegistryDesignation.L.equalsByKey(registry.getRegistryDesignation()))
.filter(obligation -> { //.filter(obligation -> {
//если valueDate < settlement date // //если valueDate < settlement date
if (!(obligation.getValueDate() != null // if (!(obligation.getValueDate() != null
&& obligation.getSettlementDate() != null // && obligation.getSettlementDate() != null
&& obligation.getValueDate().isBefore(obligation.getSettlementDate()))) { // && obligation.getValueDate().isBefore(obligation.getSettlementDate()))) {
return true; // return true;
} // }
Optional<Registry> dmx = searchDmx(obligation); // Optional<Registry> dmx = searchDmx(obligation);
if (dmx.isPresent()) { // if (dmx.isPresent()) {
log.debug("LM*T#id={}, DM*X#id={} found, no action needed for group {}, skipping liability", // log.debug("LM*T#id={}, DM*X#id={} found, no action needed for group {}, skipping liability",
obligation.getId(), // obligation.getId(),
obligation.getId(), // obligation.getId(),
obligation.getGroupId()); // obligation.getGroupId());
} // }
return dmx.isEmpty(); // return dmx.isEmpty();
}) //})
.toList(); .toList();
for (int i = 0; i < allLiabilities.size(); i++) { for (int i = 0; i < allLiabilities.size(); i++) {
//сортировка чтобы найти сделки с одинаковыми направлениями и адресатами и схлопнуть в одну //сортировка чтобы найти сделки с одинаковыми направлениями и адресатами и схлопнуть в одну

View file

@ -112,24 +112,28 @@ public class InspectionObligationsDepositReturn implements ISessionStage {
log.debug("groupId={}, OM*T.id={}", entry.getKey(), omtRgs.getId()); log.debug("groupId={}, OM*T.id={}", entry.getKey(), omtRgs.getId());
BigDecimal omtBalance = safeBD(omtRgs.getBalance()); BigDecimal omtBalance = safeBD(omtRgs.getBalance());
if (omtRgs.getValueDate() != null //первая часть сделки депозита
&& omtRgs.getSettlementDate() != null if (omtRgs.getValueDate() == null
&& omtRgs.getValueDate().isBefore(omtRgs.getSettlementDate())) { || omtRgs.getSettlementDate() == null
Optional<Registry> dmx = searchDmx(omtRgs); || !omtRgs.getValueDate().isBefore(omtRgs.getSettlementDate())) {
if (dmx.isPresent()) { continue;
BigDecimal dmxBalance = safeBD(dmx.get().getBalance()); }
log.debug("OM*T.id={} -> DM*X.id={}, dmxBalance={}, omtBalance={}",
omtRgs.getId(), //вторая часть сделки - возврат депозита
dmx.get().getId(), Optional<Registry> dmx = searchDmx(omtRgs);
dmxBalance, omtBalance if (dmx.isPresent()) {
); BigDecimal dmxBalance = safeBD(dmx.get().getBalance());
if (dmxBalance.compareTo(omtBalance) >= 0) { log.debug("OM*T.id={} -> DM*X.id={}, dmxBalance={}, omtBalance={}",
group.forEach(rgs -> updateStatus(rgs, RegistryStatus.OK)); omtRgs.getId(),
} else { dmx.get().getId(),
group.forEach(rgs -> updateStatus(rgs, registryStatusForDmxCheckFailed())); dmxBalance, omtBalance
} );
continue; 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); Optional<Registry> amfAssetO = searchAssetByOMT(omtRgs);