Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
ialbert 2024-05-03 14:31:41 +03:00
commit e3f5236aee

View file

@ -308,6 +308,7 @@ public class InformationAccountService extends QueueConsumer implements Initiali
public synchronized Long accountNextId(String currency) { public synchronized Long accountNextId(String currency) {
return accountNextId(currency, 810L); return accountNextId(currency, 810L);
} }
/** /**
* Сквозной номер инфо-счетов * Сквозной номер инфо-счетов
* *
@ -321,9 +322,17 @@ public class InformationAccountService extends QueueConsumer implements Initiali
if (infoCounter == null) synchronized (this) { if (infoCounter == null) synchronized (this) {
if (infoCounter == null) { if (infoCounter == null) {
log.debug("Init account-information counter."); log.debug("Init account-information counter.");
Collection<Account> allInfoAcc = accountImdg.getCollectionObjectsByFieldValues(Map.of( ImdgPredicateBuilder predicateBuilder = accountImdg.predicateBuilder();
"accountType", AccountType.Info.getKey(), ImdgPredicate currencyPredicate = predicateBuilder.equals("currency", currency);
"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()) { if (allInfoAcc.isEmpty()) {
infoCounter = new AtomicLong(1); infoCounter = new AtomicLong(1);