Merge branch 'dev' into plan_balance_dmx_dmt
This commit is contained in:
commit
9a074addcf
6 changed files with 42 additions and 25 deletions
|
|
@ -262,11 +262,15 @@ public class RegistryService {
|
||||||
AssetTrio asts = validator.getStored(ValidationStored.IdentificationFundsAssetTrio);
|
AssetTrio asts = validator.getStored(ValidationStored.IdentificationFundsAssetTrio);
|
||||||
Account anltAcc = validator.getStored(Stored.AnltAccount);
|
Account anltAcc = validator.getStored(Stored.AnltAccount);
|
||||||
BigDecimal dmauBalance = safeBD(dmau.getBalance());
|
BigDecimal dmauBalance = safeBD(dmau.getBalance());
|
||||||
|
BigDecimal dmauDebitBalance = safeBD(dmau.getDebit());
|
||||||
BigDecimal reqBalance = payload.getBalance();
|
BigDecimal reqBalance = payload.getBalance();
|
||||||
BigDecimal am_tBalance = safeBD(asts.a__t().getBalance());
|
BigDecimal am_tBalance = safeBD(asts.a__t().getBalance());
|
||||||
|
BigDecimal am_tCreditBalance = safeBD(asts.a__t().getCredit());
|
||||||
|
|
||||||
dmau.setBalance(dmauBalance.subtract(reqBalance));
|
dmau.setBalance(dmauBalance.subtract(reqBalance));
|
||||||
|
dmau.setDebit(dmauDebitBalance.add(reqBalance));
|
||||||
asts.a__t().setBalance(am_tBalance.add(reqBalance));
|
asts.a__t().setBalance(am_tBalance.add(reqBalance));
|
||||||
|
asts.a__t().setCredit(am_tCreditBalance.add(reqBalance));
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
dmau.setUpdated(now);
|
dmau.setUpdated(now);
|
||||||
asts.a__t().setUpdated(now);
|
asts.a__t().setUpdated(now);
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
sdf57.getDbfId().toString());
|
sdf57.getDbfId().toString());
|
||||||
asts.ifPresent(trio -> assets.process(trio.a__b(), trio.a__t(), trio.a__f(), BigDecimal.ZERO));
|
asts.ifPresent(trio -> assets.process(trio.a__b(), trio.a__t(), trio.a__f(), BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
} else {
|
} else if (InOutDirection.in.equals(IEnumKey.getEnumByKey(InOutDirection.class, stmt.getInOutDirection()))) {
|
||||||
log.debug("stmt.id={} comment='{}' error: {}. Operating through DMAU registry",
|
log.debug("stmt.id={} comment='{}' error: {}. Operating through DMAU registry",
|
||||||
stmt.getId(),
|
stmt.getId(),
|
||||||
stmt.getComment(),
|
stmt.getComment(),
|
||||||
|
|
@ -417,6 +417,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
statementCred.map(stmt -> new StmtCmpAcc(stmt, companyCred, accountCred)).ifPresent(registersUpdate);
|
statementCred.map(stmt -> new StmtCmpAcc(stmt, companyCred, accountCred)).ifPresent(registersUpdate);
|
||||||
}
|
}
|
||||||
if (sessionIsNeededFlag.get()) {
|
if (sessionIsNeededFlag.get()) {
|
||||||
|
result.setSessionWasStarted(true);
|
||||||
LauncherCommandRequest sessionTask = new LauncherCommandRequest();
|
LauncherCommandRequest sessionTask = new LauncherCommandRequest();
|
||||||
sessionTask.setSection(Section.MKR.getKey());
|
sessionTask.setSection(Section.MKR.getKey());
|
||||||
sessionTask.setSessionType(SessionType.XDEP.getKey());
|
sessionTask.setSessionType(SessionType.XDEP.getKey());
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ public class Result {
|
||||||
private Long childGenerationId;
|
private Long childGenerationId;
|
||||||
private String fileName;
|
private String fileName;
|
||||||
private boolean anyHasError;
|
private boolean anyHasError;
|
||||||
|
private boolean sessionWasStarted = false;
|
||||||
|
|
||||||
public List<AccountSdfRequestPart> getAccountRequests() {
|
public List<AccountSdfRequestPart> getAccountRequests() {
|
||||||
return accountRequests;
|
return accountRequests;
|
||||||
|
|
@ -42,4 +43,12 @@ public class Result {
|
||||||
public void setAnyHasError(boolean anyHasError) {
|
public void setAnyHasError(boolean anyHasError) {
|
||||||
this.anyHasError = anyHasError;
|
this.anyHasError = anyHasError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSessionWasStarted() {
|
||||||
|
return sessionWasStarted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSessionWasStarted(boolean sessionWasStarted) {
|
||||||
|
this.sessionWasStarted = sessionWasStarted;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,16 +243,16 @@ public class FinalMkrSession extends AbstractSession implements InitializingBean
|
||||||
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();
|
||||||
|
|
|
||||||
|
|
@ -194,16 +194,16 @@ public class ReturnDepositSession extends AbstractSession implements Initializin
|
||||||
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();
|
||||||
|
|
|
||||||
|
|
@ -181,12 +181,14 @@ public class StatementServiceV2 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//затем sdf57
|
//затем sdf57
|
||||||
processSdf57(sdf57);
|
boolean sessionStarted = processSdf57(sdf57);
|
||||||
removeFirstWithSameTableAndGroupId(sdf57);
|
removeFirstWithSameTableAndGroupId(sdf57);
|
||||||
reviser.doRevise(sdf01.getGroupId());
|
reviser.doRevise(sdf01.getGroupId());
|
||||||
//теперь можем продолжить сессию с шага 1
|
//теперь можем продолжить сессию с шага 1
|
||||||
SessionContinueEvent continueSessionBn = new SessionContinueEvent(SdfTable.SDF_01, SdfTable.SDF_57);
|
if (!sessionStarted) {
|
||||||
kafkaSender.sendRequestToQueue(Consts.CONTINUE_SESSION_BN_FIRST_PART, continueSessionBn);
|
SessionContinueEvent continueSessionBn = new SessionContinueEvent(SdfTable.SDF_01, SdfTable.SDF_57);
|
||||||
|
kafkaSender.sendRequestToQueue(Consts.CONTINUE_SESSION_BN_FIRST_PART, continueSessionBn);
|
||||||
|
}
|
||||||
log.info("pair sdf01/sdf57 processed successfully");
|
log.info("pair sdf01/sdf57 processed successfully");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -242,12 +244,13 @@ public class StatementServiceV2 {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processSdf57(StatementRequest statementRequest) {
|
private boolean processSdf57(StatementRequest statementRequest) {
|
||||||
Imdg<SDf57> sdfImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_SDf57, SDf57.class);
|
Imdg<SDf57> sdfImdg = imdgProvider.getImdg(IMDGDistributedNames.Map_SDf57, SDf57.class);
|
||||||
Collection<? extends SpcexObjectBase> sdfGroup = sdfImdg.getCollectionObjectsByFieldValues(Map.of(
|
Collection<? extends SpcexObjectBase> sdfGroup = sdfImdg.getCollectionObjectsByFieldValues(Map.of(
|
||||||
"generationId", statementRequest.getGroupId()));
|
"generationId", statementRequest.getGroupId()));
|
||||||
AbstractExecutor service = sdf57Executor;
|
AbstractExecutor service = sdf57Executor;
|
||||||
Result res = service.execute(sdfGroup, statementRequest);
|
Result res = service.execute(sdfGroup, statementRequest);
|
||||||
|
return res.isSessionWasStarted();
|
||||||
// finishSendCommand(res, service, statementRequest);
|
// finishSendCommand(res, service, statementRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue