фикс с обновлением dm*x
фикс с поиском ассетов и инструментом и ipob отключение проверки planbalance
This commit is contained in:
parent
11f6ea0b84
commit
6ec042bd30
3 changed files with 49 additions and 20 deletions
|
|
@ -320,15 +320,35 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
registryD.getId());
|
registryD.getId());
|
||||||
sessionIsNeededFlag.set(true);
|
sessionIsNeededFlag.set(true);
|
||||||
} else if (tm_tFound.isPresent()) {
|
} else if (tm_tFound.isPresent()) {
|
||||||
Registry tm_t = tm_tFound.get();
|
Optional<Registry> dm_xFound = RegistrySearch.builder(registryImdg)
|
||||||
Registry registryD = copyRegD(tm_t, stmt, RegistryUnit.X);
|
.rgsCode(RegistryTradingParams.DM_X)
|
||||||
registryImdg.insert(registryD);
|
.companyId(company.getId())
|
||||||
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",
|
.accountId(account.getId())
|
||||||
stmt.getId(),
|
.contract(stmt.getContract())
|
||||||
sdf57.getSpecif(),
|
.statusNotOk()
|
||||||
tm_t.getId(),
|
.find();
|
||||||
registryD.getId());
|
if (dm_xFound.isEmpty()) {
|
||||||
sessionIsNeededFlag.set(true);
|
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());
|
stmt.setOperationStatus(OperationStatus.Executed.getKey());
|
||||||
|
|
@ -610,6 +630,14 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
return this;
|
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() {
|
private Optional<Registry> find() {
|
||||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(predicate));
|
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(predicate));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,8 @@ public class AssetTBFProcessing {
|
||||||
pb.sql(RegistryCodeSqlBuilder.getInstance(params).build()),
|
pb.sql(RegistryCodeSqlBuilder.getInstance(params).build()),
|
||||||
pb.equals("tradingClearingRegistryId", rgs.getTradingClearingRegistryId()),
|
pb.equals("tradingClearingRegistryId", rgs.getTradingClearingRegistryId()),
|
||||||
pb.equals("companyId", rgs.getCompanyId()),
|
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));
|
return Optional.ofNullable(rgsImdg.getFirstObjectByPredicate(prdct));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,16 +214,16 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
|
||||||
public void finishPart() {
|
public void finishPart() {
|
||||||
try {
|
try {
|
||||||
//stage 9 continue revision
|
//stage 9 continue revision
|
||||||
{
|
//{
|
||||||
StageResult<Object> reviseRes = runStage(TaskType.AgainRevise, currSession.getId(), balanceRevise, false);
|
// StageResult<Object> reviseRes = runStage(TaskType.AgainRevise, currSession.getId(), balanceRevise, false);
|
||||||
if (!reviseRes.isSuccess()) {
|
// if (!reviseRes.isSuccess()) {
|
||||||
this.afterReviseErrorMonitor = SessionMonitorFactory.waitReviseError(section());
|
// this.afterReviseErrorMonitor = SessionMonitorFactory.waitReviseError(section());
|
||||||
log.warn("{} stage error, created monitor for {}",
|
// log.warn("{} stage error, created monitor for {}",
|
||||||
TaskType.AgainRevise,
|
// TaskType.AgainRevise,
|
||||||
afterReviseErrorMonitor.allConditions());
|
// afterReviseErrorMonitor.allConditions());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
//stage 10
|
//stage 10
|
||||||
{
|
{
|
||||||
FinishingSessionPayload payload = new FinishingSessionPayload();
|
FinishingSessionPayload payload = new FinishingSessionPayload();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue