логи по сессиям
This commit is contained in:
parent
524d59eece
commit
9ace5c276d
8 changed files with 21 additions and 3 deletions
|
|
@ -61,6 +61,7 @@ public class DealsPrepare implements ISessionStage {
|
|||
}
|
||||
|
||||
private StageResult<?> prepareDeals(Long sessionId, Long companyId, Long securityId) {
|
||||
log.info("loading deals sessionId: {}, companyId: {}, securityId: {}", sessionId, companyId, securityId);
|
||||
StringBuilder executionDepositSQL = new StringBuilder("sessionId = null");
|
||||
if (companyId != null) {
|
||||
executionDepositSQL.append(" and companyId = ").append(companyId); //fixme вероятно в ТЗ недостаточно условий для выборки - counterPartyId
|
||||
|
|
@ -87,6 +88,7 @@ public class DealsPrepare implements ISessionStage {
|
|||
switch (executionType) {
|
||||
case ExecutionDeposit -> {
|
||||
ImdgPredicate excDepPrct = prdComposer.apply(execDepositPredicates, executionDepositImdg);
|
||||
log.info("using predicate to load deals: {}", excDepPrct.toString());
|
||||
excs = executionDepositImdg.getCollectionObjectsByPredicate(excDepPrct)
|
||||
.stream()
|
||||
.map(execToInterface())
|
||||
|
|
@ -94,6 +96,7 @@ public class DealsPrepare implements ISessionStage {
|
|||
}
|
||||
case ExecutionFond -> {
|
||||
ImdgPredicate excFondPrct = prdComposer.apply(execFondPredicates, executionFondImdg);
|
||||
log.info("using predicate to load deals: {}", excFondPrct.toString());
|
||||
excs = executionFondImdg.getCollectionObjectsByPredicate(excFondPrct)
|
||||
.stream()
|
||||
.map(execToInterface())
|
||||
|
|
|
|||
|
|
@ -151,5 +151,6 @@ public class FinishingSession implements ISessionStage {
|
|||
exportRequest.setSdfGroupId(sdf05.getGenerationId());
|
||||
exportRequest.setNameOfTable("DF-05");
|
||||
kafkaSender.sendRequestToQueue(Consts.EXPORT_PROCESS, exportRequest);
|
||||
log.info("created sdf05.id {}, sent request to export", sdf05.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public class FormingPaymentInstructionDealsFinalMkr implements ISessionStage {
|
|||
Optional<Registry> payerAmtO = findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_T);
|
||||
Optional<Registry> ambO = findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_B);
|
||||
Optional<Registry> receiverAmtO = findRelatedAsset(cm_t.getTradingClearingRegistryId(), cm_t.getCompanyId(), AM_B);
|
||||
log.debug("changing A* registers based on LM_T {} and CM_T {} found AM*F.id={}, AM*T.id={}, AM*B.id={}, AM*B.id={}",
|
||||
log.debug("changing A* registers based on LM_T.id={} and CM_T.id={} found AM*F.id={}, AM*T.id={}, AM*B.id={}, AM*B.id={}",
|
||||
lm_t.getId(),
|
||||
cm_t.getId(),
|
||||
amfO.map(Registry::getId).orElse(null),
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
|||
String sql = String.format("tradingClearingRegistryId = %s and companyId = %s",
|
||||
obligationByMoney.getTradingClearingRegistryId(), obligationByMoney.getCompanyId());
|
||||
Collection<Registry> relatedRegistries = registryImdg.getCollectionObjectsBySQL(sql);
|
||||
log.trace("found {} related registries (by tcrId&companyId) for LM*T.id={}",
|
||||
relatedRegistries.size(),
|
||||
obligationByMoney.getId());
|
||||
|
||||
for (Registry relatedRegistry : relatedRegistries) {
|
||||
if (equalsByRegistry(AM_F, relatedRegistry)) {
|
||||
|
|
@ -118,6 +121,7 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
|||
} else if (equalsByRegistry(AM_B, relatedRegistry)) {
|
||||
relatedRegistry.setBalance(safeBD(relatedRegistry.getBalance()).add(safeBD(obligationByMoney.getBalance())));
|
||||
}
|
||||
log.trace("updated related registry.id={} for LM*T.id={}", relatedRegistry.getId(), obligationByMoney.getId());
|
||||
registryImdg.update(relatedRegistry);
|
||||
}
|
||||
}
|
||||
|
|
@ -130,11 +134,12 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
|||
String sql = String.format("tradingClearingRegistryId = %s and companyId = %s",
|
||||
requirementByMoney.getTradingClearingRegistryId(), requirementByMoney.getCompanyId());
|
||||
Collection<Registry> relatedRegistries = registryImdg.getCollectionObjectsBySQL(sql);
|
||||
|
||||
log.trace("found {} related registries (by tcrId&companyId) for CM*T.id={}", relatedRegistries.size(), requirementByMoney.getId());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ public class InclusionObligations implements ISessionStage {
|
|||
prdctBuilder.equals("registryStatus", RegistryStatus.PROC.getKey())
|
||||
);
|
||||
}
|
||||
log.info("Inclusion to pool with predicate: {}", registryPredicate.toString());
|
||||
Collection<Registry> obligations = registryImdg.getCollectionObjectsByPredicate(registryPredicate);
|
||||
Map<Long, List<Registry>> registryByGroupId = obligations.stream()
|
||||
.filter(registry -> registry.getSettlementDate().isEqual(LocalDate.now()))
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ public class InspectionObligations implements ISessionStage {
|
|||
Map<Long, List<Registry>> registriesByGroup = registriesToProcess.stream().
|
||||
collect(Collectors.groupingBy(Registry::getGroupId));
|
||||
|
||||
log.info("found {} ({} groups) registries by sql: {}", registriesToProcess.size(), registriesByGroup.size(), sqlCondition);
|
||||
for (Map.Entry<Long, List<Registry>> entry : registriesByGroup.entrySet()) {
|
||||
List<Registry> group = entry.getValue();
|
||||
List<Registry> obligationsInGroup = group.stream().filter(registry ->
|
||||
|
|
@ -152,6 +153,7 @@ public class InspectionObligations implements ISessionStage {
|
|||
|
||||
private void defineStatusAndUpdateRegistry(List<CheckResult> checkResults, List<Registry> registries) {
|
||||
boolean isOneUncovered = checkResults.stream().anyMatch(checkResult -> checkResult.isUncovered);
|
||||
log.debug("groupId {}, uncovered: {}", registries.stream().findFirst().map(Registry::getGroupId).orElse(null), isOneUncovered);
|
||||
if (isOneUncovered) {
|
||||
for (CheckResult checkResult : checkResults) {
|
||||
Optional<Registry> tRegistryWithSameCompany = registries.stream().filter(registry ->
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public class ObligationAdmission implements ISessionStage {
|
|||
private StageResult<?> obligationAdmission(Long sessionId) {
|
||||
Collection<Registry> registries = registryImdg.getCollectionObjectsBySQL("sessionId = " + sessionId);
|
||||
Map<Long, List<Registry>> byGroups = registries.stream().collect(Collectors.groupingBy(Registry::getGroupId));
|
||||
log.info("found {} ({} groups) registries with sessionId {}", registries.size(), byGroups.size(), sessionId);
|
||||
for (Map.Entry<Long, List<Registry>> grpEntry : byGroups.entrySet()) {
|
||||
EnumMessage groupError = null;
|
||||
List<Registry> rgsGroup = grpEntry.getValue();
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public class RequirementsAndObligationCreation implements ISessionStage {
|
|||
i += 1;
|
||||
continue;
|
||||
}
|
||||
log.trace("matched executions id {} and {}", matched.getFirst().getId(), matched.getSecond().getId());
|
||||
i += 2;
|
||||
ExecutionCommon partyExec = matched.getFirst();
|
||||
ExecutionCommon counterExec = matched.getSecond();
|
||||
|
|
@ -81,6 +82,7 @@ public class RequirementsAndObligationCreation implements ISessionStage {
|
|||
.registry(registry)
|
||||
.update();
|
||||
registryImdg.update(registry);
|
||||
log.trace("executions id {} and {}: updated rgs.id={}", partyExec.getId(), counterExec.getId(), registry.getId());
|
||||
}, () -> {
|
||||
IRegistryBuilder registryBuilder = defineBuilderByExecType(partyExec.type());
|
||||
Registry newRegister = registryBuilder
|
||||
|
|
@ -90,6 +92,7 @@ public class RequirementsAndObligationCreation implements ISessionStage {
|
|||
.returnDeposit(returnedDep)
|
||||
.build();
|
||||
registryImdg.insert(newRegister);
|
||||
log.trace("executions id {} and {}: created rgs.id={}", partyExec.getId(), counterExec.getId(), newRegister.getId());
|
||||
});
|
||||
findAndUpdateOrCreate.accept(partyExec, RegistryDesignation.O, false);
|
||||
findAndUpdateOrCreate.accept(partyExec, RegistryDesignation.T, false);
|
||||
|
|
@ -171,7 +174,9 @@ public class RequirementsAndObligationCreation implements ISessionStage {
|
|||
pb.equals("settlementDate", settlementDt),
|
||||
pb.equals("sessionId", sessionId)
|
||||
);
|
||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
||||
Registry rgs = registryImdg.getSingleObjectByPredicate(rgstrPredicate);
|
||||
log.trace("rgs.id={} found by: {}", rgs == null ? "'not found'" : rgs.getId(), rgstrPredicate.toString());
|
||||
return Optional.ofNullable(rgs);
|
||||
}
|
||||
|
||||
private LocalDate settlementDt(ExecutionCommon exec) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue