CLNRWORM hot fix session
This commit is contained in:
parent
206ff77b97
commit
89e8f2dae7
2 changed files with 37 additions and 35 deletions
|
|
@ -175,6 +175,7 @@ public class FinalMkrSession extends AbstractSession implements InitializingBean
|
||||||
{
|
{
|
||||||
InspectionPoolPayload companyIdPayload = new InspectionPoolPayload();
|
InspectionPoolPayload companyIdPayload = new InspectionPoolPayload();
|
||||||
companyIdPayload.setProcessedCompanyId(currSession.getCompanyId());
|
companyIdPayload.setProcessedCompanyId(currSession.getCompanyId());
|
||||||
|
companyIdPayload.setSessionId(currSession.getId());
|
||||||
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligationsReturn);
|
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligationsReturn);
|
||||||
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligations);
|
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligations);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@ import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.*;
|
import static ru.spcex.platform.enumeration.RegistryTradingParams.CM_T;
|
||||||
import static ru.spcex.platform.utils.number.BigDecimalUtil.safeBD;
|
import static ru.spcex.platform.enumeration.RegistryTradingParams.LM_T;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
|
|
@ -156,39 +156,40 @@ public class FormingPaymentInstructionDealsFinalMkr implements ISessionStage {
|
||||||
log.error("groupId {} cmt_t {} lm_t {} - both must be present", groupId, cm_t, lm_t);
|
log.error("groupId {} cmt_t {} lm_t {} - both must be present", groupId, cm_t, lm_t);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
{
|
// TODO CLRNWORM
|
||||||
//изменение активов - блокируем средства беред отправкой sdf'ов
|
// {
|
||||||
Optional<Registry> amfO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_F);
|
// //изменение активов - блокируем средства беред отправкой sdf'ов
|
||||||
Optional<Registry> payerAmtO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_T);
|
// Optional<Registry> amfO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_F);
|
||||||
Optional<Registry> ambO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_B);
|
// Optional<Registry> payerAmtO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_T);
|
||||||
Optional<Registry> receiverAmtO = rgsMng.findRelatedAsset(cm_t.getTradingClearingRegistryId(), cm_t.getCompanyId(), AM_B);
|
// Optional<Registry> ambO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_B);
|
||||||
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={}",
|
// Optional<Registry> receiverAmtO = rgsMng.findRelatedAsset(cm_t.getTradingClearingRegistryId(), cm_t.getCompanyId(), AM_B);
|
||||||
lm_t.getId(),
|
// 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={}",
|
||||||
cm_t.getId(),
|
// lm_t.getId(),
|
||||||
amfO.map(Registry::getId).orElse(null),
|
// cm_t.getId(),
|
||||||
payerAmtO.map(Registry::getId).orElse(null),
|
// amfO.map(Registry::getId).orElse(null),
|
||||||
ambO.map(Registry::getId).orElse(null),
|
// payerAmtO.map(Registry::getId).orElse(null),
|
||||||
receiverAmtO.map(Registry::getId).orElse(null)
|
// ambO.map(Registry::getId).orElse(null),
|
||||||
);
|
// receiverAmtO.map(Registry::getId).orElse(null)
|
||||||
Instant now = Instant.now();
|
// );
|
||||||
amfO.ifPresent(amf -> {
|
// Instant now = Instant.now();
|
||||||
amf.setBalance(safeBD(amf.getBalance()).subtract(safeBD(lm_t.getBalance())));
|
// amfO.ifPresent(amf -> {
|
||||||
setUpdatedStoreInImdg(amf, now);
|
// amf.setBalance(safeBD(amf.getBalance()).subtract(safeBD(lm_t.getBalance())));
|
||||||
});
|
// setUpdatedStoreInImdg(amf, now);
|
||||||
payerAmtO.ifPresent(amt -> {
|
// });
|
||||||
amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
// payerAmtO.ifPresent(amt -> {
|
||||||
setUpdatedStoreInImdg(amt, now);
|
// amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
||||||
});
|
// setUpdatedStoreInImdg(amt, now);
|
||||||
ambO.ifPresent(amb -> {
|
// });
|
||||||
amb.setBalance(safeBD(amb.getBalance()).add(safeBD(lm_t.getBalance())));
|
// ambO.ifPresent(amb -> {
|
||||||
setUpdatedStoreInImdg(amb, now);
|
// amb.setBalance(safeBD(amb.getBalance()).add(safeBD(lm_t.getBalance())));
|
||||||
});
|
// setUpdatedStoreInImdg(amb, now);
|
||||||
receiverAmtO.ifPresent(amt -> {
|
// });
|
||||||
// у отправителя и получателя одинаково, см. в FormingPaymentInstruction
|
// receiverAmtO.ifPresent(amt -> {
|
||||||
amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
// // у отправителя и получателя одинаково, см. в FormingPaymentInstruction
|
||||||
setUpdatedStoreInImdg(amt, now);
|
// amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
||||||
});
|
// setUpdatedStoreInImdg(amt, now);
|
||||||
}
|
// });
|
||||||
|
// }
|
||||||
log.trace("generating payment instruction for groupId {} cmt_t {} lm_t {}",
|
log.trace("generating payment instruction for groupId {} cmt_t {} lm_t {}",
|
||||||
groupId,
|
groupId,
|
||||||
cm_t.getId(),
|
cm_t.getId(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue