clearing-service SDF12 fix
This commit is contained in:
parent
c1a519dc86
commit
6769f5cd20
6 changed files with 18 additions and 12 deletions
|
|
@ -338,7 +338,7 @@ public class FormingPaymentInstruction implements ISessionStage {
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12(); //todo remove
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
sDf12.setDirection("DELFREE");
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Collection<SdfTable> sdfTables = sendSdfs(paymentInstructions, sessionId);
|
Collection<SdfTable> sdfTables = sendSdfs(paymentInstructions, sessionId, dtrnAcc);
|
||||||
StageResult<PaymentInfo> stageResult = new StageResult<>(null, true);
|
StageResult<PaymentInfo> stageResult = new StageResult<>(null, true);
|
||||||
stageResult.setStageResult(new PaymentInfo(paymentInstructions, sdfTables));
|
stageResult.setStageResult(new PaymentInfo(paymentInstructions, sdfTables));
|
||||||
return stageResult;
|
return stageResult;
|
||||||
|
|
@ -307,7 +307,7 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
||||||
registryImdg.update(rgs);
|
registryImdg.update(rgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<SdfTable> sendSdfs(List<PaymentInstruction> formedPaymentInstructions, Long sessionId) {
|
private Collection<SdfTable> sendSdfs(List<PaymentInstruction> formedPaymentInstructions, Long sessionId, Account dtrnAcc) {
|
||||||
Collection<SdfTable> sentSdfs = new ArrayList<>();
|
Collection<SdfTable> sentSdfs = new ArrayList<>();
|
||||||
List<SDf03> sDf03Created = new ArrayList<>();
|
List<SDf03> sDf03Created = new ArrayList<>();
|
||||||
List<SDf12> sDf12Created = new ArrayList<>();
|
List<SDf12> sDf12Created = new ArrayList<>();
|
||||||
|
|
@ -320,7 +320,7 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
||||||
sDf03Created.add(sdf03Creator.create(paymentInstruction));
|
sDf03Created.add(sdf03Creator.create(paymentInstruction));
|
||||||
} else if (!InstrumentType.CRNC.equalsByKey(security.getInstrumentType()) &&
|
} else if (!InstrumentType.CRNC.equalsByKey(security.getInstrumentType()) &&
|
||||||
List.of(AccountType.Depo, AccountType.Dtrn).contains(IEnumKey.getEnumByKey(AccountType.class, account.getAccountType()))) {
|
List.of(AccountType.Depo, AccountType.Dtrn).contains(IEnumKey.getEnumByKey(AccountType.class, account.getAccountType()))) {
|
||||||
sDf12Created.add(newSDf12(paymentInstruction));
|
sDf12Created.add(newSDf12(paymentInstruction, dtrnAcc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,19 +368,25 @@ public class FormingPaymentInstructionAssets implements ISessionStage {
|
||||||
return sentSdfs;
|
return sentSdfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction, Account dtrnAcc) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12();
|
||||||
|
if (Objects.equals(paymentInstruction.getDebitLeg_accountId(), dtrnAcc.getId())) {
|
||||||
|
sDf12.setDirection("RECFREE");
|
||||||
|
sDf12.setDepoCodeSender(paymentInstruction.getDebitLeg_account());
|
||||||
|
sDf12.setDepoCodeAdressee(paymentInstruction.getCreditLeg_account());
|
||||||
|
} else if (Objects.equals(paymentInstruction.getCreditLeg_accountId(), dtrnAcc.getId())) {
|
||||||
|
sDf12.setDirection("DELFREE");
|
||||||
|
sDf12.setDepoCodeSender(paymentInstruction.getCreditLeg_account());
|
||||||
|
sDf12.setDepoCodeAdressee(paymentInstruction.getDebitLeg_account());
|
||||||
|
}
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
|
||||||
sDf12.setQuantity(BigDecimalUtil.limitDecimalPlaces(paymentInstruction.getCreditLeg_amount().toString(), 2));
|
sDf12.setQuantity(BigDecimalUtil.limitDecimalPlaces(paymentInstruction.getCreditLeg_amount().toString(), 2));
|
||||||
Security security = securitySelector.selectSecurityById(paymentInstruction.getCreditLeg_securityId());
|
Security security = securitySelector.selectSecurityById(paymentInstruction.getCreditLeg_securityId());
|
||||||
if (security != null) {
|
if (security != null) {
|
||||||
sDf12.setSecurityCode(security.getSecuritySymbol());
|
sDf12.setSecurityCode(security.getSecuritySymbol());
|
||||||
}
|
}
|
||||||
sDf12.setDepoCodeSender(paymentInstruction.getCreditLeg_account());
|
|
||||||
sDf12.setDepoCodeAdressee(paymentInstruction.getDebitLeg_account());
|
|
||||||
// sDf12.setTransactionNumber();
|
// sDf12.setTransactionNumber();
|
||||||
sDf12.setGenerationTime(Instant.now());
|
sDf12.setGenerationTime(Instant.now());
|
||||||
return sDf12;
|
return sDf12;
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ public class FormingPaymentInstructionDealsFinalMkr implements ISessionStage {
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12(); //todo remove
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
sDf12.setDirection("DELFREE");
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ public class FormingPaymentInstructionDepositReturn implements ISessionStage {
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12(); //todo remove
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
sDf12.setDirection("DELFREE");
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ public class FormingPaymentInstructionReturnMkr implements ISessionStage {
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12(); //todo remove
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
sDf12.setDirection("DELFREE");
|
||||||
|
|
|
||||||
|
|
@ -286,7 +286,7 @@ public class FormingPaymentInstructionSecondaryT0 implements ISessionStage {
|
||||||
|
|
||||||
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
private SDf12 newSDf12(PaymentInstruction paymentInstruction) {
|
||||||
log.debug("creating sdf12");
|
log.debug("creating sdf12");
|
||||||
SDf12 sDf12 = new SDf12();
|
SDf12 sDf12 = new SDf12(); //todo remove
|
||||||
sDf12.setId(idGenerator.nextId());
|
sDf12.setId(idGenerator.nextId());
|
||||||
sDf12.setOutDocument(sDf12.getId().toString());
|
sDf12.setOutDocument(sDf12.getId().toString());
|
||||||
sDf12.setDirection("DELFREE");
|
sDf12.setDirection("DELFREE");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue