финальная сессия МКР шаг 7
This commit is contained in:
parent
d91383b4e5
commit
61332c5b73
2 changed files with 22 additions and 19 deletions
|
|
@ -40,6 +40,7 @@ import ru.spcex.platform.utils.number.BigDecimalUtil;
|
|||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
|
@ -100,7 +101,9 @@ public class FormingPaymentInstructionDealsFinalMkr implements ISessionStage {
|
|||
RegistryCodeSqlBuilder registryCodeSqlBuilder = RegistryCodeSqlBuilder.getInstance(
|
||||
LM_T, CM_T
|
||||
);
|
||||
ImdgPredicate rgsCodePrdct = rgsPb.sql(registryCodeSqlBuilder.build());
|
||||
ImdgPredicate rgsCodePrdct = rgsPb.and(
|
||||
rgsPb.sql(registryCodeSqlBuilder.build()),
|
||||
rgsPb.equals("settlementDate", LocalDate.now()));
|
||||
Collection<Registry> registries = registryImdg.getCollectionObjectsByPredicate(rgsCodePrdct);
|
||||
return registries.stream()
|
||||
.filter(rgs -> Objects.equals(rgs.getValueDate(), rgs.getSettlementDate()))
|
||||
|
|
|
|||
|
|
@ -138,9 +138,9 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
|||
for (Registry relatedRegistry : relatedRegistries) {
|
||||
if (equalsByRegistry(AM_T, relatedRegistry)) {
|
||||
relatedRegistry.setSettledDebit(safeBD(relatedRegistry.getSettledDebit()).add(safeBD(requirementByMoney.getBalance())));
|
||||
log.trace("updated related registry.id={} for CM*T.id={}", relatedRegistry.getId(), requirementByMoney.getId());
|
||||
registryImdg.update(relatedRegistry);
|
||||
}
|
||||
log.trace("updated related registry.id={} for CM*T.id={}", relatedRegistry.getId(), requirementByMoney.getId());
|
||||
registryImdg.update(relatedRegistry);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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 false;
|
||||
}
|
||||
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++) {
|
||||
//сортировка чтобы найти сделки с одинаковыми направлениями и адресатами и схлопнуть в одну
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue