balance-service поправил валидаторы с null BigInt
This commit is contained in:
parent
592b2cd02f
commit
9ae5936a01
2 changed files with 10 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package ru.spcex.clearing.balance.validation;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.clearing.classes.statics.data.account.Account;
|
||||
import ru.clearing.classes.statics.data.company.Company;
|
||||
import ru.clearing.classes.statics.data.company.CompanySymbols;
|
||||
|
|
@ -24,6 +25,9 @@ public enum Sdf09ValidationRule implements IValidationRule<ImdgValidationContext
|
|||
SDf09 sdf09 = context.getValidatedObject();
|
||||
Imdg<CompanySymbols> companySymbolImdg = context.obtainMap(IMDGDistributedNames.Map_CompanySymbols, CompanySymbols.class);
|
||||
Imdg<Company> companyImdg = context.obtainMap(IMDGDistributedNames.Map_Company, Company.class);
|
||||
if (sdf09.getInn() == null) {
|
||||
return of( BalanceError.CompanyNotFound, "empty inn");
|
||||
}
|
||||
String innStr = sdf09.getInn().setScale(0, RoundingMode.DOWN).toString();
|
||||
CompanySymbols symbol = companySymbolImdg
|
||||
.getSingleObjectByFieldValues(Map.of("companySymbol", CompanySymbol.INN.getKey(),
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ public enum Sdf16ValidationRule implements IValidationRule<ImdgValidationContext
|
|||
SDf16 sdf16 = context.getValidatedObject();
|
||||
Imdg<CompanySymbols> companySymbolsImdg = context.obtainMap(IMDGDistributedNames.Map_CompanySymbols, CompanySymbols.class);
|
||||
Imdg<Company> companyImdg = context.obtainMap(IMDGDistributedNames.Map_Company, Company.class);
|
||||
if (sdf16.getInn() == null) {
|
||||
return of(BalanceError.CompanyNotFound, "empty inn");
|
||||
}
|
||||
if (sdf16.getBic() == null) {
|
||||
return of(BalanceError.CompanyNotFound, "empty bic");
|
||||
}
|
||||
String innStr = sdf16.getInn().setScale(0, RoundingMode.DOWN).toString();
|
||||
String bicStr = sdf16.getBic().setScale(0, RoundingMode.DOWN).toString();
|
||||
CompanySymbols companySymbols = companySymbolsImdg.getSingleObjectBySQL(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue