backend-api account-service META accounts POST currency
This commit is contained in:
parent
6503baf710
commit
f6ffca32b4
14 changed files with 108 additions and 107 deletions
|
|
@ -48,6 +48,7 @@ public class AccountValidationConfig {
|
||||||
addImdg.accept(IMDGDistributedNames.Map_Account);
|
addImdg.accept(IMDGDistributedNames.Map_Account);
|
||||||
addImdg.accept(IMDGDistributedNames.Map_ServiceStatusDictionary);
|
addImdg.accept(IMDGDistributedNames.Map_ServiceStatusDictionary);
|
||||||
addImdg.accept(IMDGDistributedNames.Map_AccountTypeDictionary);
|
addImdg.accept(IMDGDistributedNames.Map_AccountTypeDictionary);
|
||||||
|
addImdg.accept(IMDGDistributedNames.Map_CurrencyCodeDictionary);
|
||||||
return new ValidatorImpl<>(context,
|
return new ValidatorImpl<>(context,
|
||||||
IdPresentRule.instance("companyId",
|
IdPresentRule.instance("companyId",
|
||||||
CorrespondentAccountNewRequest::getCompanyId,
|
CorrespondentAccountNewRequest::getCompanyId,
|
||||||
|
|
@ -106,6 +107,15 @@ public class AccountValidationConfig {
|
||||||
return DictionaryPresentRule.DICTIONARY_NOT_FOUND_DECORATOR_2.decorator(causeEmpty, errorCode, fieldName, fieldValue);
|
return DictionaryPresentRule.DICTIONARY_NOT_FOUND_DECORATOR_2.decorator(causeEmpty, errorCode, fieldName, fieldValue);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
||||||
|
DictionaryPresentRule.instance("currency",
|
||||||
|
CorrespondentAccountNewRequest::getCurrency,
|
||||||
|
IMDGDistributedNames.Map_CurrencyCodeDictionary,
|
||||||
|
ServiceStatusDictionary.class,
|
||||||
|
null,
|
||||||
|
AccountError.DictionaryNotFound,
|
||||||
|
false
|
||||||
|
),
|
||||||
new SameAccountValidationRule<>(AccountType.Corr, CorrespondentAccountNewRequest::getAccount)
|
new SameAccountValidationRule<>(AccountType.Corr, CorrespondentAccountNewRequest::getAccount)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public class InformationAccountValidationConfig {
|
||||||
addImdg.accept(IMDGDistributedNames.Map_InformationAccount);
|
addImdg.accept(IMDGDistributedNames.Map_InformationAccount);
|
||||||
addImdg.accept(IMDGDistributedNames.Map_ServiceStatusDictionary);
|
addImdg.accept(IMDGDistributedNames.Map_ServiceStatusDictionary);
|
||||||
addImdg.accept(IMDGDistributedNames.Map_AccountTypeDictionary);
|
addImdg.accept(IMDGDistributedNames.Map_AccountTypeDictionary);
|
||||||
|
addImdg.accept(IMDGDistributedNames.Map_CurrencyCodeDictionary);
|
||||||
addImdg.accept(IMDGDistributedNames.Map_Account);
|
addImdg.accept(IMDGDistributedNames.Map_Account);
|
||||||
return new ValidatorImpl<>(context,
|
return new ValidatorImpl<>(context,
|
||||||
IdPresentRule.instance("companyId",
|
IdPresentRule.instance("companyId",
|
||||||
|
|
@ -59,6 +60,10 @@ public class InformationAccountValidationConfig {
|
||||||
DictionaryPresentRule.instance("accountType", InformationAccountNewRequest::getAccountType,
|
DictionaryPresentRule.instance("accountType", InformationAccountNewRequest::getAccountType,
|
||||||
IMDGDistributedNames.Map_AccountTypeDictionary, AccountTypeDictionary.class,
|
IMDGDistributedNames.Map_AccountTypeDictionary, AccountTypeDictionary.class,
|
||||||
AccountError.RequiredFieldEmpty, AccountError.DictionaryNotFound, false),
|
AccountError.RequiredFieldEmpty, AccountError.DictionaryNotFound, false),
|
||||||
|
DictionaryPresentRule.instance("currency", InformationAccountNewRequest::getCurrency,
|
||||||
|
IMDGDistributedNames.Map_CurrencyCodeDictionary, ServiceStatusDictionary.class,
|
||||||
|
null, AccountError.DictionaryNotFound,false
|
||||||
|
),
|
||||||
new SameAccountValidationRule<>(AccountType.Info, InformationAccountNewRequest::getAccount)
|
new SameAccountValidationRule<>(AccountType.Info, InformationAccountNewRequest::getAccount)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -129,18 +129,20 @@ public class AccountService extends QueueConsumer implements InitializingBean {
|
||||||
if (requestInfoUpdate != null) return requestInfoUpdate;
|
if (requestInfoUpdate != null) return requestInfoUpdate;
|
||||||
|
|
||||||
CorrespondentAccountNewRequest req = userRequest.getRequestPayload();
|
CorrespondentAccountNewRequest req = userRequest.getRequestPayload();
|
||||||
|
String currency = req.getCurrency() == null ? CurrencyCode.RUB.getKey() : req.getCurrency();
|
||||||
|
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
Account account = new Account();
|
Account account = new Account();
|
||||||
account.setCompanyId(req.getCompanyId());
|
account.setCompanyId(req.getCompanyId());
|
||||||
account.setAccount(req.getAccount());
|
account.setAccount(req.getAccount());
|
||||||
if (AccountType.Info.equalsByKey(req.getAccountType())) {
|
if (AccountType.Info.equalsByKey(req.getAccountType())) {
|
||||||
Long infoSequenceId = informationAccountService.accountNextId();
|
Long infoSequenceId = informationAccountService.accountNextId(currency);
|
||||||
String accountValue = informationAccountService.generateInfoAccount(infoSequenceId);
|
String accountValue = informationAccountService.generateInfoAccount(infoSequenceId);
|
||||||
log.trace("New info-account SequenceId={} account={}", infoSequenceId, accountValue);
|
log.trace("New info-account SequenceId={} account={}", infoSequenceId, accountValue);
|
||||||
account.setAccount(accountValue);
|
account.setAccount(accountValue);
|
||||||
}
|
}
|
||||||
account.setAccountType(req.getAccountType());
|
account.setAccountType(req.getAccountType());
|
||||||
|
account.setCurrency(currency);
|
||||||
if (req.getStatus() == null) {
|
if (req.getStatus() == null) {
|
||||||
account.setStatus(WorkflowStatus.Active.getKey());
|
account.setStatus(WorkflowStatus.Active.getKey());
|
||||||
log.trace("Status not set in request. Use default: {}", account.getStatus());
|
log.trace("Status not set in request. Use default: {}", account.getStatus());
|
||||||
|
|
@ -198,10 +200,11 @@ public class AccountService extends QueueConsumer implements InitializingBean {
|
||||||
infoAcc.setAccountId(account.getId());
|
infoAcc.setAccountId(account.getId());
|
||||||
Account firstAccountAntl = accountMap.getFirstObjectByFieldValues(Map.of(
|
Account firstAccountAntl = accountMap.getFirstObjectByFieldValues(Map.of(
|
||||||
"companyId", Sender.One.getId(),
|
"companyId", Sender.One.getId(),
|
||||||
"accountType", AccountType.Anlt.getKey()
|
"accountType", AccountType.Anlt.getKey(),
|
||||||
|
"currency", account.getCurrency()
|
||||||
));
|
));
|
||||||
if (firstAccountAntl == null) {
|
if (firstAccountAntl == null) {
|
||||||
log.warn("Can not find 1 ANTL account for fill information ClearingAccountId.");
|
log.warn("Can not find 1 ANTL {} account for fill information ClearingAccountId.", account.getCurrency());
|
||||||
} else {
|
} else {
|
||||||
infoAcc.setClearingAccountId(firstAccountAntl.getId());
|
infoAcc.setClearingAccountId(firstAccountAntl.getId());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.account.InformationAccountNewRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.account.InformationAccountNewRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.registry.TradingClearingRegistryNewRequest;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.reports.NotificationRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.reports.NotificationRequest;
|
||||||
import ru.spcex.clearing.platform.messaging.serialization.LogFormatter;
|
import ru.spcex.clearing.platform.messaging.serialization.LogFormatter;
|
||||||
import ru.spcex.clearing.platform.messaging.service.QueueConsumer;
|
import ru.spcex.clearing.platform.messaging.service.QueueConsumer;
|
||||||
|
|
@ -26,6 +25,7 @@ import ru.spcex.clearing.util.security.UserRoleVerification;
|
||||||
import ru.spcex.clearing.util.services.RequestHelper;
|
import ru.spcex.clearing.util.services.RequestHelper;
|
||||||
import ru.spcex.clearing.validation.common.ValidationHelper;
|
import ru.spcex.clearing.validation.common.ValidationHelper;
|
||||||
import ru.spcex.platform.enumeration.AccountType;
|
import ru.spcex.platform.enumeration.AccountType;
|
||||||
|
import ru.spcex.platform.enumeration.CurrencyCode;
|
||||||
import ru.spcex.platform.enumeration.ServiceStatus;
|
import ru.spcex.platform.enumeration.ServiceStatus;
|
||||||
import ru.spcex.platform.enumeration.WorkflowStatus;
|
import ru.spcex.platform.enumeration.WorkflowStatus;
|
||||||
import ru.spcex.platform.imdg.api.Imdg;
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
|
|
@ -40,6 +40,7 @@ import ru.spcex.platform.utils.validation.IValidator;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
@ -63,7 +64,7 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
* Кэш-счётчик сквозных номеров счетов.
|
* Кэш-счётчик сквозных номеров счетов.
|
||||||
* См. accountNextId()
|
* См. accountNextId()
|
||||||
*/
|
*/
|
||||||
protected AtomicLong infoCounter;
|
protected Map<String, AtomicLong> infoCounterByCurrency = new HashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public InformationAccountService(Consumer<String, Object> kafkaQueue,
|
public InformationAccountService(Consumer<String, Object> kafkaQueue,
|
||||||
|
|
@ -115,15 +116,17 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
if (requestInfoUpdate != null) return requestInfoUpdate;
|
if (requestInfoUpdate != null) return requestInfoUpdate;
|
||||||
|
|
||||||
InformationAccountNewRequest req = userRequest.getRequestPayload();
|
InformationAccountNewRequest req = userRequest.getRequestPayload();
|
||||||
|
String currency = req.getCurrency() == null ? CurrencyCode.RUB.getKey() : req.getCurrency(); //userRequest.getRequestPayload().getCurrency();
|
||||||
|
|
||||||
Long newId = informationAccountImdg.nextIDSequenceFor();
|
Long newId = informationAccountImdg.nextIDSequenceFor();
|
||||||
Long infoSequenceId = accountNextId();
|
Long infoSequenceId = accountNextId(currency);
|
||||||
String accountValue = generateInfoAccount(infoSequenceId);
|
String accountValue = generateInfoAccount(infoSequenceId);
|
||||||
log.trace("New info-account id={}, sequenceId={}, account={}", newId, infoSequenceId, accountValue);
|
log.trace("New info-account id={}, sequenceId={}, account={}", newId, infoSequenceId, accountValue);
|
||||||
|
|
||||||
ImdgPredicateBuilder accountPredicateBuilder = accountImdg.predicateBuilder();
|
ImdgPredicateBuilder accountPredicateBuilder = accountImdg.predicateBuilder();
|
||||||
ImdgPredicate companyIdPredicate = accountPredicateBuilder.equals("companyId", 1L);
|
ImdgPredicate companyIdPredicate = accountPredicateBuilder.equals("companyId", 1L);
|
||||||
ImdgPredicate accountTypePredicate = accountPredicateBuilder.equals("accountType", AccountType.Anlt.getKey());
|
ImdgPredicate accountTypePredicate = accountPredicateBuilder.and(accountPredicateBuilder.equals("accountType", AccountType.Anlt.getKey()),
|
||||||
|
accountPredicateBuilder.equals("currency", currency));
|
||||||
ImdgPredicate andPredicate = accountPredicateBuilder.and(companyIdPredicate, accountTypePredicate);
|
ImdgPredicate andPredicate = accountPredicateBuilder.and(companyIdPredicate, accountTypePredicate);
|
||||||
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
||||||
if (accountsAnlt.isEmpty()) {
|
if (accountsAnlt.isEmpty()) {
|
||||||
|
|
@ -209,8 +212,11 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String currency = userRequest.getRequestPayload().getCurrency();
|
||||||
|
if (currency == null)
|
||||||
|
currency = CurrencyCode.RUB.getKey();
|
||||||
Long newId = informationAccountImdg.nextIDSequenceFor();
|
Long newId = informationAccountImdg.nextIDSequenceFor();
|
||||||
Long infoSequenceId = accountNextId(); // требуется последовательность n+1
|
Long infoSequenceId = accountNextId(currency); // требуется последовательность n+1
|
||||||
String accountValue = generateInfoAccount(infoSequenceId);
|
String accountValue = generateInfoAccount(infoSequenceId);
|
||||||
log.trace("New info-account id={}, sequenceId={}, account={}", newId, infoSequenceId, accountValue);
|
log.trace("New info-account id={}, sequenceId={}, account={}", newId, infoSequenceId, accountValue);
|
||||||
|
|
||||||
|
|
@ -218,7 +224,8 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
{
|
{
|
||||||
ImdgPredicate andPredicate = pb.and(
|
ImdgPredicate andPredicate = pb.and(
|
||||||
pb.equals("companyId", 1L),
|
pb.equals("companyId", 1L),
|
||||||
pb.equals("accountType", AccountType.Anlt.getKey())
|
pb.equals("accountType", AccountType.Anlt.getKey()),
|
||||||
|
pb.equals("currency", currency)
|
||||||
);
|
);
|
||||||
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
Collection<Account> accountsAnlt = accountImdg.getCollectionObjectsByPredicate(andPredicate);
|
||||||
if (accountsAnlt.isEmpty()) {
|
if (accountsAnlt.isEmpty()) {
|
||||||
|
|
@ -302,13 +309,20 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
/**
|
/**
|
||||||
* Сквозной номер инфо-счетов
|
* Сквозной номер инфо-счетов
|
||||||
*
|
*
|
||||||
|
* @param
|
||||||
* @return infoCounter++
|
* @return infoCounter++
|
||||||
*/
|
*/
|
||||||
public synchronized Long accountNextId() {
|
public synchronized Long accountNextId(String currency) {
|
||||||
|
if (currency == null)
|
||||||
|
currency = CurrencyCode.RUB.getKey(); // default
|
||||||
|
AtomicLong infoCounter = infoCounterByCurrency.get(currency);
|
||||||
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("accountType", AccountType.Info.getKey()));
|
Collection<Account> allInfoAcc = accountImdg.getCollectionObjectsByFieldValues(Map.of(
|
||||||
|
"accountType", AccountType.Info.getKey(),
|
||||||
|
"currency", currency
|
||||||
|
));
|
||||||
if (allInfoAcc.isEmpty()) {
|
if (allInfoAcc.isEmpty()) {
|
||||||
infoCounter = new AtomicLong(1);
|
infoCounter = new AtomicLong(1);
|
||||||
log.debug("No account information on map. n={}", infoCounter.get());
|
log.debug("No account information on map. n={}", infoCounter.get());
|
||||||
|
|
@ -341,6 +355,7 @@ public class InformationAccountService extends QueueConsumer implements Initiali
|
||||||
if (parsedCount == 0 && lastAccount != null)
|
if (parsedCount == 0 && lastAccount != null)
|
||||||
log.debug("Last unparseable account: {}", lastAccount);
|
log.debug("Last unparseable account: {}", lastAccount);
|
||||||
}
|
}
|
||||||
|
infoCounterByCurrency.put(currency, infoCounter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return infoCounter.incrementAndGet();
|
return infoCounter.incrementAndGet();
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ public class TradingClearingRegistryService extends QueueConsumer implements Ini
|
||||||
if (sId.length() > 5)
|
if (sId.length() > 5)
|
||||||
sId = sId.substring(sId.length() - 5);
|
sId = sId.substring(sId.length() - 5);
|
||||||
code += sId;
|
code += sId;
|
||||||
return code; // 12 имволов
|
return code; // 12 символов
|
||||||
}
|
}
|
||||||
|
|
||||||
public RequestInfoUpdate tradingClearingRegistryUpdate(BaseRequest<TradingClearingRegistryUpdateRequest> userRequest) {
|
public RequestInfoUpdate tradingClearingRegistryUpdate(BaseRequest<TradingClearingRegistryUpdateRequest> userRequest) {
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ class InformationAccountServiceTest {
|
||||||
Account accountAnlt = new Account();
|
Account accountAnlt = new Account();
|
||||||
accountAnlt.setAccountType(AccountType.Anlt.getKey());
|
accountAnlt.setAccountType(AccountType.Anlt.getKey());
|
||||||
accountAnlt.setCompanyId(1L);
|
accountAnlt.setCompanyId(1L);
|
||||||
|
accountAnlt.setCurrency("RUB");
|
||||||
anltAccountId = accountImdg.insert(accountAnlt);
|
anltAccountId = accountImdg.insert(accountAnlt);
|
||||||
|
|
||||||
new TestObjectCreator(hazelcastServiceTest).createUserAdmin(1000L);
|
new TestObjectCreator(hazelcastServiceTest).createUserAdmin(1000L);
|
||||||
|
|
@ -134,6 +135,7 @@ class InformationAccountServiceTest {
|
||||||
InformationAccountNewRequest InformationAccountNewRequest = new InformationAccountNewRequest();
|
InformationAccountNewRequest InformationAccountNewRequest = new InformationAccountNewRequest();
|
||||||
InformationAccountNewRequest.setCompanyId(companyId);
|
InformationAccountNewRequest.setCompanyId(companyId);
|
||||||
InformationAccountNewRequest.setAccount(account);
|
InformationAccountNewRequest.setAccount(account);
|
||||||
|
InformationAccountNewRequest.setCurrency(null);
|
||||||
|
|
||||||
String jsonString = getJsonStringForNew(InformationAccountNewRequest, 0L);
|
String jsonString = getJsonStringForNew(InformationAccountNewRequest, 0L);
|
||||||
|
|
||||||
|
|
@ -178,11 +180,13 @@ class InformationAccountServiceTest {
|
||||||
Account account = new Account();
|
Account account = new Account();
|
||||||
account.setId(120L);
|
account.setId(120L);
|
||||||
account.setAccountType(AccountType.Info.getKey());
|
account.setAccountType(AccountType.Info.getKey());
|
||||||
|
account.setCurrency(CurrencyCode.RUB.getKey());
|
||||||
account.setCompanyId(10L);
|
account.setCompanyId(10L);
|
||||||
account.setAccount("39911810000000127000");
|
account.setAccount("39911810000000127000");
|
||||||
accountImdg.insert(account);
|
accountImdg.insert(account);
|
||||||
InformationAccount accountInfo = new InformationAccount();
|
InformationAccount accountInfo = new InformationAccount();
|
||||||
accountInfo.setId(121L);
|
accountInfo.setId(121L);
|
||||||
|
account.setCurrency(CurrencyCode.RUB.getKey());
|
||||||
accountInfo.setAccountId(account.getId());
|
accountInfo.setAccountId(account.getId());
|
||||||
accountInfo.setCompanyId(account.getCompanyId());
|
accountInfo.setCompanyId(account.getCompanyId());
|
||||||
accountInfoImdg.insert(accountInfo);
|
accountInfoImdg.insert(accountInfo);
|
||||||
|
|
@ -190,9 +194,17 @@ class InformationAccountServiceTest {
|
||||||
UserRoleVerification userRoleVerification = Mockito.mock(UserRoleVerification.class);
|
UserRoleVerification userRoleVerification = Mockito.mock(UserRoleVerification.class);
|
||||||
InformationAccountService infoAccSvc=new InformationAccountService(null,null,null,
|
InformationAccountService infoAccSvc=new InformationAccountService(null,null,null,
|
||||||
null, userRoleVerification, hazelcastServiceTest, null, null, null, null);
|
null, userRoleVerification, hazelcastServiceTest, null, null, null, null);
|
||||||
Long n = infoAccSvc.accountNextId();
|
Long n = infoAccSvc.accountNextId(null);
|
||||||
Assertions.assertEquals(13L, n);
|
Assertions.assertEquals(13L, n);
|
||||||
n = infoAccSvc.accountNextId();
|
n = infoAccSvc.accountNextId(null);
|
||||||
Assertions.assertEquals(14L, n);
|
Assertions.assertEquals(14L, n);
|
||||||
|
|
||||||
|
// Другие валюты
|
||||||
|
n = infoAccSvc.accountNextId(CurrencyCode.RUB.getKey());
|
||||||
|
Assertions.assertEquals(15L, n);
|
||||||
|
n = infoAccSvc.accountNextId("CNY");
|
||||||
|
Assertions.assertEquals(2L, n);
|
||||||
|
n = infoAccSvc.accountNextId("CNY");
|
||||||
|
Assertions.assertEquals(3L, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17,6 +17,9 @@ public class AccountInformationNewAction implements IAction<InformationAccountNe
|
||||||
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
@ApiModelProperty(value = "Наименование статуса", example = "ACTV")
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String status;
|
private String status;
|
||||||
|
@ApiModelProperty(value = "Код валюты", example = "RUB")
|
||||||
|
@JsonProperty
|
||||||
|
public String currency;
|
||||||
@ApiModelProperty(value = "Наименование типа счета", example = "INFO")
|
@ApiModelProperty(value = "Наименование типа счета", example = "INFO")
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String accountType;
|
private String accountType;
|
||||||
|
|
@ -26,6 +29,7 @@ public class AccountInformationNewAction implements IAction<InformationAccountNe
|
||||||
var req = new InformationAccountNewRequest();
|
var req = new InformationAccountNewRequest();
|
||||||
req.setCompanyId(this.companyId);
|
req.setCompanyId(this.companyId);
|
||||||
req.setAccount(this.account);
|
req.setAccount(this.account);
|
||||||
|
req.setCurrency(this.currency);
|
||||||
req.setStatus(this.status);
|
req.setStatus(this.status);
|
||||||
req.setAccountType(this.accountType);
|
req.setAccountType(this.accountType);
|
||||||
return req;
|
return req;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ public class AccountNewAction implements IAction<AccountNewRequest> {
|
||||||
@ApiModelProperty(value = "Наименование типа счета", example = "CLRN")
|
@ApiModelProperty(value = "Наименование типа счета", example = "CLRN")
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String accountType;
|
private String accountType;
|
||||||
|
@ApiModelProperty(value = "Код валюты", example = "RUB")
|
||||||
|
@JsonProperty
|
||||||
|
private String currency;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccountNewRequest toRequest() {
|
public AccountNewRequest toRequest() {
|
||||||
|
|
@ -37,6 +40,7 @@ public class AccountNewAction implements IAction<AccountNewRequest> {
|
||||||
req.setAccount(this.account);
|
req.setAccount(this.account);
|
||||||
req.setStatus(this.status);
|
req.setStatus(this.status);
|
||||||
req.setAccountType(this.accountType);
|
req.setAccountType(this.accountType);
|
||||||
|
req.setCurrency(this.currency);
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,4 +81,12 @@ public class AccountNewAction implements IAction<AccountNewRequest> {
|
||||||
public void setAccountType(String accountType) {
|
public void setAccountType(String accountType) {
|
||||||
this.accountType = accountType;
|
this.accountType = accountType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCurrency() {
|
||||||
|
return currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrency(String currency) {
|
||||||
|
this.currency = currency;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
"version": "3.11.0.83",
|
"version": "3.11.0.84",
|
||||||
|
|
||||||
"enums": {
|
"enums": {
|
||||||
|
|
||||||
|
|
@ -4764,6 +4764,10 @@
|
||||||
{"code": "accountType",
|
{"code": "accountType",
|
||||||
"type": 12,"name": "Наименование типа счета","shortname": "Тип","link": "accountType","required": true,"visible": false
|
"type": 12,"name": "Наименование типа счета","shortname": "Тип","link": "accountType","required": true,"visible": false
|
||||||
}
|
}
|
||||||
|
,
|
||||||
|
{"code": "currency",
|
||||||
|
"type": 12,"name": "Код валюты","shortname": "Валюта","visible": true,"link": "currencyCode","linkCode": "code"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
|
<!--?xml-stylesheet type="text/xsl" href="\..\corp-reports\src\data\meta\meta.server.xslt"?-->
|
||||||
<meta version="3.11.0.83">
|
<meta version="3.11.0.84">
|
||||||
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
|
<!-- _xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" _xsi:noNamespaceSchemaLocation="file:///E:/d/projects/meta/from/meta.xsd" -->
|
||||||
<!--Здесь словари-->
|
<!--Здесь словари-->
|
||||||
<enums>
|
<enums>
|
||||||
|
|
@ -1105,6 +1105,7 @@
|
||||||
<account type="2" length="50" name="Номер счета" shortname="Счет"/>
|
<account type="2" length="50" name="Номер счета" shortname="Счет"/>
|
||||||
<status type="12" name="Наименование статуса" shortname="Статус" link="serviceStatus"/>
|
<status type="12" name="Наименование статуса" shortname="Статус" link="serviceStatus"/>
|
||||||
<accountType type="12" name="Наименование типа счета" shortname="Тип" link="accountType" required="true" visible="false"/>
|
<accountType type="12" name="Наименование типа счета" shortname="Тип" link="accountType" required="true" visible="false"/>
|
||||||
|
<currency type="12" name="Код валюты" shortname="Валюта" visible="true" link="currencyCode" linkCode="code"/>
|
||||||
</post>
|
</post>
|
||||||
<put name="Изменение счета" confirmation="companyId,account,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.AccountUpdateAction">
|
<put name="Изменение счета" confirmation="companyId,account,status" class="ru.spcex.clearing.backendapi.controller.request.cud.account.AccountUpdateAction">
|
||||||
<id type="1" name="Идентификатор записи" shortname="ID" link="account" linkCode="id" required="true"/>
|
<id type="1" name="Идентификатор записи" shortname="ID" link="account" linkCode="id" required="true"/>
|
||||||
|
|
|
||||||
|
|
@ -2,45 +2,6 @@ package ru.spcex.clearing.platform.messaging.domain.cud.account;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class AccountNewRequest {
|
@Deprecated
|
||||||
@JsonProperty
|
public class AccountNewRequest extends CorrespondentAccountNewRequest {
|
||||||
public Long companyId;
|
|
||||||
@JsonProperty
|
|
||||||
public String account;
|
|
||||||
@JsonProperty
|
|
||||||
public String status;
|
|
||||||
@JsonProperty
|
|
||||||
public String accountType;
|
|
||||||
|
|
||||||
public Long getCompanyId() {
|
|
||||||
return companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompanyId(Long companyId) {
|
|
||||||
this.companyId = companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAccount() {
|
|
||||||
return account;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAccount(String account) {
|
|
||||||
this.account = account;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAccountType() {
|
|
||||||
return accountType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAccountType(String accountType) {
|
|
||||||
this.accountType = accountType;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,55 +2,7 @@ package ru.spcex.clearing.platform.messaging.domain.cud.account;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
public class AccountUpdateRequest {
|
|
||||||
@JsonProperty
|
|
||||||
public Long id;
|
|
||||||
@JsonProperty
|
|
||||||
public Long companyId;
|
|
||||||
@JsonProperty
|
|
||||||
public String account;
|
|
||||||
@JsonProperty
|
|
||||||
public String status;
|
|
||||||
@JsonProperty
|
|
||||||
public String accountType;
|
|
||||||
|
|
||||||
public Long getId() {
|
@Deprecated
|
||||||
return id;
|
public class AccountUpdateRequest extends CorrespondentAccountUpdateRequest{
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCompanyId() {
|
|
||||||
return companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompanyId(Long companyId) {
|
|
||||||
this.companyId = companyId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAccount() {
|
|
||||||
return account;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAccount(String account) {
|
|
||||||
this.account = account;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAccountType() {
|
|
||||||
return accountType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAccountType(String accountType) {
|
|
||||||
this.accountType = accountType;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ public class CorrespondentAccountNewRequest {
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
public String accountType;
|
public String accountType;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
public String currency;
|
||||||
|
|
||||||
public Long getCompanyId() {
|
public Long getCompanyId() {
|
||||||
return companyId;
|
return companyId;
|
||||||
}
|
}
|
||||||
|
|
@ -46,4 +49,12 @@ public class CorrespondentAccountNewRequest {
|
||||||
public void setAccountType(String accountType) {
|
public void setAccountType(String accountType) {
|
||||||
this.accountType = accountType;
|
this.accountType = accountType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCurrency() {
|
||||||
|
return currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrency(String currency) {
|
||||||
|
this.currency = currency;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ public class InformationAccountNewRequest {
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String currency;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String accountType;
|
private String accountType;
|
||||||
|
|
||||||
|
|
@ -39,6 +42,14 @@ public class InformationAccountNewRequest {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCurrency() {
|
||||||
|
return currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrency(String currency) {
|
||||||
|
this.currency = currency;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAccountType() {
|
public String getAccountType() {
|
||||||
return accountType;
|
return accountType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue