This commit is contained in:
parent
edce8ee854
commit
d2f7ca572d
5 changed files with 20 additions and 11 deletions
|
|
@ -210,9 +210,19 @@ public class TradingClearingRegistryListValidationConfig {
|
|||
|
||||
// Проверка отсутствия других TradingClearingRegistryList с этими счетами
|
||||
Imdg<TradingClearingRegistryList> tradingClearingRegistryListImdg = context.obtainMap(IMDGDistributedNames.Map_TradingClearingRegistryList, TradingClearingRegistryList.class);
|
||||
Long tkrId = tkrIdGetter.apply(validatedObject);
|
||||
ImdgPredicateBuilder pb = tradingClearingRegistryListImdg.predicateBuilder();
|
||||
|
||||
Collection<TradingClearingRegistryList> listWithAccountId = tradingClearingRegistryListImdg.getCollectionObjectsByPredicate(
|
||||
pb.and(
|
||||
pb.equals("accountId", accountId),
|
||||
pb.equals("status", WorkflowStatus.Active.getKey())
|
||||
));
|
||||
if (!listWithAccountId.isEmpty()){
|
||||
return of(AccountError.AccountForTradingClearingRegistryAlreadyUsed, byIdObject.getAccount(), fieldName); // (5023) «Данная счет %s уже используется»
|
||||
}
|
||||
Long tkrId = tkrIdGetter.apply(validatedObject);
|
||||
ImdgPredicate query = pb.and(
|
||||
pb.equals("tradingClearingRegistryId", tkrId),
|
||||
pb.equals("status", WorkflowStatus.Active.getKey()),
|
||||
pb.equals("currency", byIdObject.getCurrency()));
|
||||
if (idGetter != null) {
|
||||
|
|
@ -227,7 +237,7 @@ public class TradingClearingRegistryListValidationConfig {
|
|||
// .map(tradingClearingRegistryList ->
|
||||
// accountImdg.getSingleObjectByID(tradingClearingRegistryList.getAccountId()).getAccount())
|
||||
// .collect(Collectors.toSet());
|
||||
return of(AccountError.AccountForTradingClearingRegistryAlreadyUsed, byIdObject.getAccount(), fieldName); // (5023) «Счет %s уже используется»
|
||||
return of(AccountError.CurrencyForTradingClearingRegistryListAlreadyUsed, byIdObject.getCurrency(), fieldName); // (5023) «Данная валюта %s уже используется»
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,7 @@ public enum AccountError implements IErrorEnumId {
|
|||
TCR_NOT_FOUND_GTW(5028L),
|
||||
ACCOUNT_NOT_FOUND_GTW(5029L),
|
||||
COMPANY_NOT_FOUND_GTW(5030L),
|
||||
TCR_ALREADY_EXIST_GTW(5031L),
|
||||
DEPO_ACCOUNT_NOT_FOUND_GTW(5032L),
|
||||
TCR_LIST_ALREADY_EXIST_GTW(5033L),
|
||||
CurrencyForTradingClearingRegistryListAlreadyUsed(5031L),
|
||||
TradingClearingRegistryNotFound(3022L),
|
||||
CurrencyNotFound(1016L),
|
||||
;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public enum BackendClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
"status", Status.Active.getKey()
|
||||
));
|
||||
if (tcrByMoneyAccount != null) {
|
||||
return of(AccountError.TCR_ALREADY_EXIST_GTW);
|
||||
return of(AccountError.TradingClearingRegistryAlreadyExist);
|
||||
}
|
||||
|
||||
for (Long id : currencyIds) {
|
||||
|
|
@ -65,7 +65,7 @@ public enum BackendClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
"status", Status.Active.getKey()
|
||||
));
|
||||
if (tcrList != null) {
|
||||
return of(AccountError.TCR_LIST_ALREADY_EXIST_GTW);
|
||||
return of(AccountError.AccountForTradingClearingRegistryAlreadyUsed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public enum GatewayClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
);
|
||||
if (depoAccount == null) {
|
||||
context.storeObject(ClientCodeStoreObjects.DEPO_ACCOUNT, Optional.empty());
|
||||
return of(AccountError.DEPO_ACCOUNT_NOT_FOUND_GTW, "depo_account");
|
||||
return of(AccountError.DepoAccountNotFound, "depo_account");
|
||||
}
|
||||
|
||||
context.storeObject(ClientCodeStoreObjects.DEPO_ACCOUNT, depoAccount);
|
||||
|
|
@ -124,7 +124,7 @@ public enum GatewayClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
)
|
||||
);
|
||||
if (tcr != null) {
|
||||
return of(AccountError.TCR_ALREADY_EXIST_GTW, tcr.getCode(), "code");
|
||||
return of(AccountError.TradingClearingRegistryAlreadyExist, tcr.getCode(), "code");
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ public enum GatewayClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
predicateBuilder.equals("status", Status.Active.getKey())
|
||||
));
|
||||
if (!tcrList.isEmpty()) {
|
||||
return of(AccountError.TCR_ALREADY_EXIST_GTW, tcrList.iterator().next().getCurrency(), "currency");
|
||||
return of(AccountError.TradingClearingRegistryAlreadyExist, tcrList.iterator().next().getCurrency(), "currency");
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
-- DB version: 3.12.0.91
|
||||
-- DB version: 3.12
|
||||
-- DATA version: 3.12.0.91
|
||||
|
||||
|
||||
|
|
@ -893,6 +893,7 @@ INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5028, 'ACNT', 'Ука
|
|||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5029, 'ACNT', 'Счет %s не найден в клиринговой системе.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||
|
||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5030, 'ACNT', 'Компания %s не найдена в клиринговой системе.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5031, 'ACNT', 'Для данной валюты в ТКР уже задан счет.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||
|
||||
INSERT INTO ERROR_CODE_DICTIONARY(ID, CODE, NAME) values (5200, 'BLNC', 'Общая ошибка модуля balance-service.') ON CONFLICT (ID) DO UPDATE SET CODE = EXCLUDED.CODE, NAME = EXCLUDED.NAME;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue