fix stage 7
This commit is contained in:
parent
7b7baf52d3
commit
6af1575053
2 changed files with 13 additions and 8 deletions
|
|
@ -63,6 +63,7 @@ public abstract class AbstractSession {
|
||||||
protected void continueRunning(TaskType t) {
|
protected void continueRunning(TaskType t) {
|
||||||
synchronized (this.currStage) {
|
synchronized (this.currStage) {
|
||||||
this.currStage.set(t);
|
this.currStage.set(t);
|
||||||
|
this.currSession.setSessionStatus(t.getKey());
|
||||||
sessionImdg.update(this.currSession);
|
sessionImdg.update(this.currSession);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,17 +114,17 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setBalance(relatedRegistry.getBalance().subtract(obligationByMoney.getBalance()));
|
relatedRegistry.setBalance(safeBD(relatedRegistry.getBalance()).subtract(safeBD(obligationByMoney.getBalance())));
|
||||||
} else if (registryTradingParamsT.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
} else if (registryTradingParamsT.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setSettledDebit(relatedRegistry.getSettledDebit().add(obligationByMoney.getBalance()));
|
relatedRegistry.setSettledDebit(safeBD(relatedRegistry.getSettledDebit()).add(safeBD(obligationByMoney.getBalance())));
|
||||||
} else if (registryTradingParamsB.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
} else if (registryTradingParamsB.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setBalance(relatedRegistry.getBalance().add(obligationByMoney.getBalance()));
|
relatedRegistry.setBalance(safeBD(relatedRegistry.getBalance()).add(safeBD(obligationByMoney.getBalance())));
|
||||||
}
|
}
|
||||||
registryImdg.update(relatedRegistry);
|
registryImdg.update(relatedRegistry);
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setSettledDebit(relatedRegistry.getSettledDebit().add(requirementByIssue.getBalance()));
|
relatedRegistry.setSettledDebit(safeBD(relatedRegistry.getSettledDebit()).add(safeBD(requirementByIssue.getBalance())));
|
||||||
}
|
}
|
||||||
registryImdg.update(relatedRegistry);
|
registryImdg.update(relatedRegistry);
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +177,7 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setSettledDebit(relatedRegistry.getSettledDebit().add(requirementByMoney.getBalance()));
|
relatedRegistry.setSettledDebit(safeBD(relatedRegistry.getSettledDebit()).add(safeBD(requirementByMoney.getBalance())));
|
||||||
}
|
}
|
||||||
registryImdg.update(relatedRegistry);
|
registryImdg.update(relatedRegistry);
|
||||||
}
|
}
|
||||||
|
|
@ -208,17 +208,17 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setBalance(relatedRegistry.getBalance().subtract(obligationByIssue.getBalance()));
|
relatedRegistry.setBalance(safeBD(relatedRegistry.getBalance()).subtract(safeBD(obligationByIssue.getBalance())));
|
||||||
} else if (registryTradingParamsT.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
} else if (registryTradingParamsT.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setSettledDebit(relatedRegistry.getSettledDebit().add(obligationByIssue.getBalance()));
|
relatedRegistry.setSettledDebit(safeBD(relatedRegistry.getSettledDebit()).add(safeBD(obligationByIssue.getBalance())));
|
||||||
} else if (registryTradingParamsB.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
} else if (registryTradingParamsB.equalByRegistry(IEnumKey.getEnumByKey(RegistryDesignation.class, relatedRegistry.getRegistryDesignation()),
|
||||||
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
IEnumKey.getEnumByKey(RegistryInstrumentType.class, relatedRegistry.getRegistryInstrumentType()),
|
||||||
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
IEnumKey.getEnumByKey(RegistryCapacity.class, relatedRegistry.getRegistryCapacity()),
|
||||||
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
IEnumKey.getEnumByKey(RegistryUnit.class, relatedRegistry.getRegistryUnit()))) {
|
||||||
relatedRegistry.setBalance(relatedRegistry.getBalance().add(obligationByIssue.getBalance()));
|
relatedRegistry.setBalance(safeBD(relatedRegistry.getBalance()).add(safeBD(obligationByIssue.getBalance())));
|
||||||
}
|
}
|
||||||
registryImdg.update(relatedRegistry);
|
registryImdg.update(relatedRegistry);
|
||||||
}
|
}
|
||||||
|
|
@ -349,4 +349,8 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
sDf12.setGenerationId(sdf12GroupId);
|
sDf12.setGenerationId(sdf12GroupId);
|
||||||
sDf12Imdg.insert(sDf12);
|
sDf12Imdg.insert(sDf12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BigDecimal safeBD(BigDecimal value) {
|
||||||
|
return value != null ? value : BigDecimal.ZERO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue