SDF57 processing
This commit is contained in:
parent
a8e5bcc1ee
commit
93f2a6ecc9
1 changed files with 10 additions and 10 deletions
|
|
@ -123,11 +123,13 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
//create by companyDeb
|
//create by companyDeb
|
||||||
Company companyDeb = validator.getStored(ValidationStored.Sdf57CompanyDeb);
|
Company companyDeb = validator.getStored(ValidationStored.Sdf57CompanyDeb);
|
||||||
Account accountDeb = validator.getStored(ValidationStored.Sdf57AccountDeb);
|
Account accountDeb = validator.getStored(ValidationStored.Sdf57AccountDeb);
|
||||||
Optional<Statement> statementDeb = createStatementIfNeeded.apply(companyDeb, accountDeb, InOutDirection.out);
|
|
||||||
//create by companyCred
|
|
||||||
Company companyCred = validator.getStored(ValidationStored.Sdf57CompanyCred);
|
Company companyCred = validator.getStored(ValidationStored.Sdf57CompanyCred);
|
||||||
Account accountCred = validator.getStored(ValidationStored.Sdf57AccountCred);
|
Account accountCred = validator.getStored(ValidationStored.Sdf57AccountCred);
|
||||||
Optional<Statement> statementCred = createStatementIfNeeded.apply(companyCred, accountCred, InOutDirection.in);
|
|
||||||
|
//адресат CREDIT / владелец DEBIT
|
||||||
|
Optional<Statement> statementDeb = createStatementIfNeeded.apply(companyCred, accountDeb, InOutDirection.out);
|
||||||
|
//адресат DEBIT / владелец CREDIT
|
||||||
|
Optional<Statement> statementCred = createStatementIfNeeded.apply(companyDeb, accountCred, InOutDirection.in);
|
||||||
|
|
||||||
Consumer<StmtCmpAcc> createRegistryIfNeeded = stmtCmpAcc -> {
|
Consumer<StmtCmpAcc> createRegistryIfNeeded = stmtCmpAcc -> {
|
||||||
Statement stmt = stmtCmpAcc.statement();
|
Statement stmt = stmtCmpAcc.statement();
|
||||||
|
|
@ -180,7 +182,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
statement.setAccountId(accountDeb.getId());
|
statement.setAccountId(accountDeb.getId());
|
||||||
statement.setAccount(accountDeb.getAccount());
|
statement.setAccount(accountDeb.getAccount());
|
||||||
statement.setInOutDirection(inOutDirection.getKey());
|
statement.setInOutDirection(inOutDirection.getKey());
|
||||||
statement.setSettlementDate(payDate(sdf57.getPay_date())); //fixme ! pay_date format
|
statement.setSettlementDate(payDate(sdf57.getPay_date()));
|
||||||
statement.setAmount(TextUtil.isEmpty(sdf57.getSum_deb()) ? null : new BigDecimal(sdf57.getSum_deb()));
|
statement.setAmount(TextUtil.isEmpty(sdf57.getSum_deb()) ? null : new BigDecimal(sdf57.getSum_deb()));
|
||||||
statement.setOperationStatus(OperationStatus.Pending.getKey());
|
statement.setOperationStatus(OperationStatus.Pending.getKey());
|
||||||
statement.setInSDfId(sdf57.getId());
|
statement.setInSDfId(sdf57.getId());
|
||||||
|
|
@ -212,7 +214,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
rgs.setSecuritySymbol(security.getSecuritySymbol());
|
rgs.setSecuritySymbol(security.getSecuritySymbol());
|
||||||
}
|
}
|
||||||
InOutDirection inOutDirection = IEnumKey.getEnumByKey(InOutDirection.class, statement.getInOutDirection());
|
InOutDirection inOutDirection = IEnumKey.getEnumByKey(InOutDirection.class, statement.getInOutDirection());
|
||||||
//fixme ! считаю balance при создании нулевым и исхожу из этого
|
//считаю balance при создании нулевым и исхожу из этого
|
||||||
//При добавлении (на базе изменения statement по sDf57):
|
//При добавлении (на базе изменения statement по sDf57):
|
||||||
//Если значение statement.inOutDirection=IN, то:
|
//Если значение statement.inOutDirection=IN, то:
|
||||||
//= текущее значение registry.balance + statement.amount
|
//= текущее значение registry.balance + statement.amount
|
||||||
|
|
@ -230,10 +232,8 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
//fixme rgs.setRefundDate();
|
//fixme rgs.setRefundDate();
|
||||||
//fixme rgs.setValueDate();
|
//fixme rgs.setValueDate();
|
||||||
rgs.setContract(statement.getContract());
|
rgs.setContract(statement.getContract());
|
||||||
//FIXME !!! я думал что создается на базе stmt, companyDeb, accountDeb
|
//создается на базе stmt, companyCred, accountDeb
|
||||||
//получается на самом деле создается по четверке stmt, companyDeb, accountDeb, companyCred, accountCred
|
rgs.setCounterPartyId(statement.getAddresseeId());
|
||||||
//половинка идет в CompanyId AccountId, вторая идет в counterPartyId???
|
|
||||||
rgs.setCounterPartyId(statement.getAccountId());
|
|
||||||
rgs.setCreated(Instant.now());
|
rgs.setCreated(Instant.now());
|
||||||
return rgs;
|
return rgs;
|
||||||
}
|
}
|
||||||
|
|
@ -263,7 +263,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTimeFormatter payDateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
DateTimeFormatter payDateFormatter = DateTimeFormatter.ofPattern("yy.MM.dd");
|
||||||
|
|
||||||
private LocalDate payDate(String payDate) {
|
private LocalDate payDate(String payDate) {
|
||||||
if (TextUtil.isEmpty(payDate)) {
|
if (TextUtil.isEmpty(payDate)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue