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();
|
||||
companyIdPayload.setProcessedCompanyId(currSession.getCompanyId());
|
||||
companyIdPayload.setSessionId(currSession.getId());
|
||||
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligationsReturn);
|
||||
runStage(TaskType.InspectionObligations, companyIdPayload, inspectionObligations);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ import java.util.function.Function;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.*;
|
||||
import static ru.spcex.platform.utils.number.BigDecimalUtil.safeBD;
|
||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.CM_T;
|
||||
import static ru.spcex.platform.enumeration.RegistryTradingParams.LM_T;
|
||||
|
||||
@Service
|
||||
@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);
|
||||
continue;
|
||||
}
|
||||
{
|
||||
//изменение активов - блокируем средства беред отправкой sdf'ов
|
||||
Optional<Registry> amfO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_F);
|
||||
Optional<Registry> payerAmtO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_T);
|
||||
Optional<Registry> ambO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_B);
|
||||
Optional<Registry> receiverAmtO = rgsMng.findRelatedAsset(cm_t.getTradingClearingRegistryId(), cm_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={}",
|
||||
lm_t.getId(),
|
||||
cm_t.getId(),
|
||||
amfO.map(Registry::getId).orElse(null),
|
||||
payerAmtO.map(Registry::getId).orElse(null),
|
||||
ambO.map(Registry::getId).orElse(null),
|
||||
receiverAmtO.map(Registry::getId).orElse(null)
|
||||
);
|
||||
Instant now = Instant.now();
|
||||
amfO.ifPresent(amf -> {
|
||||
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())));
|
||||
setUpdatedStoreInImdg(amt, now);
|
||||
});
|
||||
ambO.ifPresent(amb -> {
|
||||
amb.setBalance(safeBD(amb.getBalance()).add(safeBD(lm_t.getBalance())));
|
||||
setUpdatedStoreInImdg(amb, now);
|
||||
});
|
||||
receiverAmtO.ifPresent(amt -> {
|
||||
// у отправителя и получателя одинаково, см. в FormingPaymentInstruction
|
||||
amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
||||
setUpdatedStoreInImdg(amt, now);
|
||||
});
|
||||
}
|
||||
// TODO CLRNWORM
|
||||
// {
|
||||
// //изменение активов - блокируем средства беред отправкой sdf'ов
|
||||
// Optional<Registry> amfO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_F);
|
||||
// Optional<Registry> payerAmtO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_T);
|
||||
// Optional<Registry> ambO = rgsMng.findRelatedAsset(lm_t.getTradingClearingRegistryId(), lm_t.getCompanyId(), AM_B);
|
||||
// Optional<Registry> receiverAmtO = rgsMng.findRelatedAsset(cm_t.getTradingClearingRegistryId(), cm_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={}",
|
||||
// lm_t.getId(),
|
||||
// cm_t.getId(),
|
||||
// amfO.map(Registry::getId).orElse(null),
|
||||
// payerAmtO.map(Registry::getId).orElse(null),
|
||||
// ambO.map(Registry::getId).orElse(null),
|
||||
// receiverAmtO.map(Registry::getId).orElse(null)
|
||||
// );
|
||||
// Instant now = Instant.now();
|
||||
// amfO.ifPresent(amf -> {
|
||||
// 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())));
|
||||
// setUpdatedStoreInImdg(amt, now);
|
||||
// });
|
||||
// ambO.ifPresent(amb -> {
|
||||
// amb.setBalance(safeBD(amb.getBalance()).add(safeBD(lm_t.getBalance())));
|
||||
// setUpdatedStoreInImdg(amb, now);
|
||||
// });
|
||||
// receiverAmtO.ifPresent(amt -> {
|
||||
// // у отправителя и получателя одинаково, см. в FormingPaymentInstruction
|
||||
// amt.setSettledDebit(safeBD(amt.getSettledDebit()).add(safeBD(lm_t.getBalance())));
|
||||
// setUpdatedStoreInImdg(amt, now);
|
||||
// });
|
||||
// }
|
||||
log.trace("generating payment instruction for groupId {} cmt_t {} lm_t {}",
|
||||
groupId,
|
||||
cm_t.getId(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue