SDF01 executor определение статуса сделки bugfix
SDF57 executor trim all whitespaces from statement#contract
This commit is contained in:
parent
c85d82c2b7
commit
0086bbf98b
2 changed files with 6 additions and 19 deletions
|
|
@ -160,7 +160,7 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
||||||
rgs = createRegistryByStatement(stmt, company, account);
|
rgs = createRegistryByStatement(stmt, company, account);
|
||||||
registryImdg.insert(rgs);
|
registryImdg.insert(rgs);
|
||||||
}
|
}
|
||||||
if (!BigDecimal.ZERO.equals(rgs.getDiffBalance())) {
|
if (!checkDiffBalance(rgs.getDiffBalance())) {
|
||||||
log.info("sdf01.id={}, stmt.id={}, registry.id={} diffBalance is not zero: {}",
|
log.info("sdf01.id={}, stmt.id={}, registry.id={} diffBalance is not zero: {}",
|
||||||
sdf01.getId(),
|
sdf01.getId(),
|
||||||
stmt.getId(),
|
stmt.getId(),
|
||||||
|
|
@ -186,6 +186,10 @@ public class Sdf01Executor extends AbstractExecutor<SDf01> {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkDiffBalance(BigDecimal diffBalance) {
|
||||||
|
return BigDecimalUtil.safeBD(diffBalance).compareTo(BigDecimal.ZERO) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yy");
|
private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yy");
|
||||||
private Statement createSdf01Statement(SDf01 sdf01, Company company, Account account) {
|
private Statement createSdf01Statement(SDf01 sdf01, Company company, Account account) {
|
||||||
Statement stmt = new Statement();
|
Statement stmt = new Statement();
|
||||||
|
|
|
||||||
|
|
@ -456,23 +456,6 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Registry> findRegByDesignation(Statement s, RegistryDesignation des) {
|
|
||||||
RegistryTradingParams p = new RegistryTradingParams(
|
|
||||||
des, RegistryInstrumentType.M, null, RegistryUnit.T
|
|
||||||
);
|
|
||||||
String sql = RegistryCodeSqlBuilder.getInstance(p).build();
|
|
||||||
ImdgPredicateBuilder pb = registryImdg.predicateBuilder();
|
|
||||||
ImdgPredicate rgstrPredicate = pb.and(pb.sql(sql),
|
|
||||||
pb.sql(sql),
|
|
||||||
pb.equals("companyId", s.getAddresseeId()),
|
|
||||||
pb.equals("accountId", s.getAccountId())
|
|
||||||
);
|
|
||||||
if (des.equals(RegistryDesignation.D) || des.equals(RegistryDesignation.O) && !TextUtil.isEmpty(s.getContract())) {
|
|
||||||
rgstrPredicate = pb.and(rgstrPredicate, pb.equals("contract", s.getContract()));
|
|
||||||
}
|
|
||||||
return Optional.ofNullable(registryImdg.getSingleObjectByPredicate(rgstrPredicate));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<Registry> findRegByUnit(Statement s, Registry registry, RegistryUnit unit) {
|
private Optional<Registry> findRegByUnit(Statement s, Registry registry, RegistryUnit unit) {
|
||||||
RegistryTradingParams p = new RegistryTradingParams(
|
RegistryTradingParams p = new RegistryTradingParams(
|
||||||
IEnumKey.getEnumByKey(RegistryDesignation.class, registry.getRegistryDesignation()),
|
IEnumKey.getEnumByKey(RegistryDesignation.class, registry.getRegistryDesignation()),
|
||||||
|
|
@ -509,7 +492,7 @@ public class Sdf57Executor extends AbstractExecutor<SDf57> {
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return specif.substring(index + 1);
|
return specif.substring(index + 1).replaceAll("\\s+", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue