Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e3f5236aee
1 changed files with 34 additions and 25 deletions
|
|
@ -308,6 +308,7 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
|||
public synchronized Long accountNextId(String currency) {
|
||||
return accountNextId(currency, 810L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Сквозной номер инфо-счетов
|
||||
*
|
||||
|
|
@ -321,9 +322,17 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
|||
if (infoCounter == null) synchronized (this) {
|
||||
if (infoCounter == null) {
|
||||
log.debug("Init account-information counter.");
|
||||
Collection<Account> allInfoAcc = accountImdg.getCollectionObjectsByFieldValues(Map.of(
|
||||
"accountType", AccountType.Info.getKey(),
|
||||
"currency", currency
|
||||
ImdgPredicateBuilder predicateBuilder = accountImdg.predicateBuilder();
|
||||
ImdgPredicate currencyPredicate = predicateBuilder.equals("currency", currency);
|
||||
if (CurrencyCode.RUB.equalsByKey(currency)) {
|
||||
currencyPredicate = predicateBuilder.or(
|
||||
currencyPredicate,
|
||||
predicateBuilder.isNull("currency")
|
||||
);
|
||||
}
|
||||
Collection<Account> allInfoAcc = accountImdg.getCollectionObjectsByPredicate(predicateBuilder.and(
|
||||
predicateBuilder.equals("accountType", AccountType.Info.getKey()),
|
||||
currencyPredicate
|
||||
));
|
||||
if (allInfoAcc.isEmpty()) {
|
||||
infoCounter = new AtomicLong(1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue