SDF01 statement#clearingDate,securityId fix
This commit is contained in:
parent
0dbafe7972
commit
f04b094ac4
1 changed files with 5 additions and 11 deletions
|
|
@ -45,9 +45,7 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Service
|
||||
public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
||||
|
|
@ -136,15 +134,6 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
|||
|
||||
Optional<EnumMessage> err = validateActiveness(company, account);
|
||||
if (err.isEmpty()) {
|
||||
Consumer<Registry> update = rgs -> {
|
||||
updateReg(stmt, rgs);
|
||||
registryImdg.update(rgs);
|
||||
};
|
||||
Supplier<Registry> create = () -> {
|
||||
Registry registry = createRegistryByStatement(stmt, company, account);
|
||||
registryImdg.insert(registry);
|
||||
return registry;
|
||||
};
|
||||
Optional<Registry> reg = findReg(stmt);
|
||||
Registry rgs;
|
||||
if (reg.isPresent()) {
|
||||
|
|
@ -185,6 +174,11 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
|||
stmt.setOperationStatus(OperationStatus.Pending.getKey());
|
||||
stmt.setInSDfId(sdf01.getId());
|
||||
stmt.setInOutSDfType(InOutSDfType.type1.getKey());
|
||||
stmt.setClearingDate(LocalDate.now());
|
||||
Currency currency = currencyImdg.getSingleObjectByFieldValues(Map.of("currencyCode", CurrencyCode.RUB.getKey()));
|
||||
if (currency != null) {
|
||||
stmt.setSecurityId(currency.getId());
|
||||
}
|
||||
stmt.setCreated(Instant.now());
|
||||
return stmt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue