фикс с обновлением dm*x

фикс с поиском ассетов и инструментом
и ipob отключение проверки planbalance
This commit is contained in:
ialbert 2023-09-29 16:22:41 +03:00
parent 11f6ea0b84
commit 6ec042bd30
3 changed files with 49 additions and 20 deletions

View file

@ -320,15 +320,35 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
registryD.getId());
sessionIsNeededFlag.set(true);
} else if (tm_tFound.isPresent()) {
Registry tm_t = tm_tFound.get();
Registry registryD = copyRegD(tm_t, stmt, RegistryUnit.X);
registryImdg.insert(registryD);
log.debug("stmt.id={}, sdf57.specif={} found TM*T.id={} new DM*X.id={}. Return money identification for Initiator account based on TM*T registry searchin on companyId, accountId, contract and registry_status=PROC|MGN",
stmt.getId(),
sdf57.getSpecif(),
tm_t.getId(),
registryD.getId());
sessionIsNeededFlag.set(true);
Optional<Registry> dm_xFound = RegistrySearch.builder(registryImdg)
.rgsCode(RegistryTradingParams.DM_X)
.companyId(company.getId())
.accountId(account.getId())
.contract(stmt.getContract())
.statusNotOk()
.find();
if (dm_xFound.isEmpty()) {
Registry tm_t = tm_tFound.get();
Registry registryD = copyRegD(tm_t, stmt, RegistryUnit.X);
registryImdg.insert(registryD);
log.debug("stmt.id={}, sdf57.specif={} found TM*T.id={} new DM*X.id={}. Return money identification for Initiator account based on TM*T registry searchin on companyId, accountId, contract and registry_status=PROC|MGN",
stmt.getId(),
sdf57.getSpecif(),
tm_t.getId(),
registryD.getId());
sessionIsNeededFlag.set(true);
} else {
Registry dm_x = dm_xFound.get();
dm_x.setBalance(safeBD(dm_x.getBalance()).add(safeBD(stmt.getAmount())));
dm_x.setUpdated(Instant.now());
registryImdg.update(dm_x);
log.debug("stmt.id={}, sdf57.specif={} updated {}.id={}",
stmt.getId(),
sdf57.getSpecif(),
dm_x.getRegistryCode(),
dm_x.getId());
sessionIsNeededFlag.set(true);
}
}
}
stmt.setOperationStatus(OperationStatus.Executed.getKey());
@ -610,6 +630,14 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
return this;
}
private RegistrySearch statusNotOk() {
predicate = pb.and(predicate, pb.or(
pb.equals("registryStatus", RegistryStatus.PROC.getKey()),
pb.equals("registryStatus", RegistryStatus.UNCV.getKey())
));
return this;
}
private Optional<Registry> find() {
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(predicate));
}

View file

@ -169,7 +169,8 @@ public class AssetTBFProcessing {
pb.sql(RegistryCodeSqlBuilder.getInstance(params).build()),
pb.equals("tradingClearingRegistryId", rgs.getTradingClearingRegistryId()),
pb.equals("companyId", rgs.getCompanyId()),
pb.equals("accountId", rgs.getAccountId())
pb.equals("accountId", rgs.getAccountId()),
pb.equals("securityId", rgs.getSecurityId())
);
return Optional.ofNullable(rgsImdg.getFirstObjectByPredicate(prdct));
}

View file

@ -214,16 +214,16 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
public void finishPart() {
try {
//stage 9 continue revision
{
StageResult<Object> reviseRes = runStage(TaskType.AgainRevise, currSession.getId(), balanceRevise, false);
if (!reviseRes.isSuccess()) {
this.afterReviseErrorMonitor = SessionMonitorFactory.waitReviseError(section());
log.warn("{} stage error, created monitor for {}",
TaskType.AgainRevise,
afterReviseErrorMonitor.allConditions());
return;
}
}
//{
// StageResult<Object> reviseRes = runStage(TaskType.AgainRevise, currSession.getId(), balanceRevise, false);
// if (!reviseRes.isSuccess()) {
// this.afterReviseErrorMonitor = SessionMonitorFactory.waitReviseError(section());
// log.warn("{} stage error, created monitor for {}",
// TaskType.AgainRevise,
// afterReviseErrorMonitor.allConditions());
// return;
// }
//}
//stage 10
{
FinishingSessionPayload payload = new FinishingSessionPayload();