поправлены баги при создании инструментов
This commit is contained in:
parent
97322f6e0f
commit
997118ceb8
4 changed files with 86 additions and 73 deletions
|
|
@ -13,6 +13,7 @@ import ru.spcex.clearing.platform.messaging.domain.cud.company.CompanySymbolNewR
|
|||
import ru.spcex.clearing.platform.messaging.domain.cud.company.ContactNewRequest;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.company.SecurityMkrGatewayRequest;
|
||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
|
@ -34,6 +35,7 @@ public class IssueCompanyService {
|
|||
public void sendRequest(FondListingsRequest request) {
|
||||
List<IssuerCompany> issuerCompanyList = request.getIssuerCompanyList();
|
||||
for (IssuerCompany issuerCompany : issuerCompanyList) {
|
||||
try {
|
||||
UUID companyId = issuerCompany.getId();
|
||||
log.debug("Grouping by companyId: {}", companyId);
|
||||
List<IssuerCompanySymbols> issuerCompanySymbolsList = groupByCompanyId(request.getIssuerCompanySymbolsList(), companyId);
|
||||
|
|
@ -56,6 +58,9 @@ public class IssueCompanyService {
|
|||
|
||||
//todo реализовать на стороне security-service обработку и правильную группировку
|
||||
// kafkaSender.sendRequestToQueue(Consts.DESTINATION_ISSUER_COMPANY_GATEWAY_REQUEST, securityMkrGatewayRequest);
|
||||
} catch (Throwable e) {
|
||||
log.error("{}", ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public class SecurityService {
|
|||
public void sendRequest(FondListingsRequest request) {
|
||||
List<FondSecurity> securityList = request.getSecurities();
|
||||
for (FondSecurity security : securityList) {
|
||||
try {
|
||||
log.debug("process security uuid: {}", security.getId());
|
||||
UUID securityId = security.getId();
|
||||
log.debug("Grouping by securityId: {}", securityId);
|
||||
|
|
@ -50,7 +51,6 @@ public class SecurityService {
|
|||
map(securityRequestAdapter::toFixedIncomeCashFlowRequest).toList();
|
||||
|
||||
SecurityFondGatewayRequest securityGatewayRequest;
|
||||
try {
|
||||
if (InstrumentType.BOND.equalsByKey(security.getInstrumentType())) {
|
||||
FixedIncomeSecurityNewRequest fixedIncomeSecurityNewRequest = securityRequestAdapter.toFixedIncomeSecurityRequest(security);
|
||||
securityGatewayRequest = new FixedIncomeGatewayRequest(fixedIncomeSecurityNewRequest);
|
||||
|
|
@ -67,7 +67,6 @@ public class SecurityService {
|
|||
} catch (Throwable e) {
|
||||
log.error("{}", ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import ru.spcex.clearing.platform.messaging.domain.Consts;
|
|||
import ru.spcex.clearing.platform.messaging.domain.cud.account.ClientCodeNewRequest;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.company.*;
|
||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
|
@ -31,6 +32,7 @@ public class CompanyProcessor {
|
|||
public void process(CompaniesRequest request) {
|
||||
List<Company> companyList = request.getCompanyList();
|
||||
for (Company memberCompany : companyList) {
|
||||
try {
|
||||
UUID companyId = memberCompany.getId();
|
||||
log.debug("Grouping by companyId: {}", companyId);
|
||||
List<CompanyClearingCategory> companyClearingCategories = groupByCompanyId(request.getCompanyClearingCategoryList(), companyId);
|
||||
|
|
@ -64,6 +66,9 @@ public class CompanyProcessor {
|
|||
companyGatewayRequest.setCategories(categories);
|
||||
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_COMPANY_GATEWAY_REQUEST, companyGatewayRequest);
|
||||
} catch (Throwable e) {
|
||||
log.error("{}", ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import ru.spcex.clearing.gatewayapi.service.adapter.MoneyMarketSecurityRequestAd
|
|||
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.securitites.MoneyMarketSecurityNewRequest;
|
||||
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
|
||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
|
@ -30,16 +31,19 @@ public class ListingMMProcessor {
|
|||
public void process(MMListingsRequest request) {
|
||||
List<ExchangeInstrument> exchangeInstrumentList = request.getExchangeInstrumentList();
|
||||
for (ExchangeInstrument exchangeInstrument : exchangeInstrumentList) {
|
||||
try {
|
||||
UUID exchangeInstrumentId = exchangeInstrument.getId();
|
||||
log.debug("Process exchangeInstrumentId : {}", exchangeInstrumentId);
|
||||
if (StringUtils.isEmpty(exchangeInstrument.getCode()) || exchangeInstrument.getCode().length() < 6) {
|
||||
log.warn("Incorrect code : {}, skip record", exchangeInstrument.getCode());
|
||||
continue;
|
||||
}
|
||||
|
||||
MoneyMarketSecurityNewRequest moneyMarketSecurityNewRequest = moneyMarketSecurityRequestAdapter
|
||||
.toMoneyMarketSecurityNewRequest(exchangeInstrument);
|
||||
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_GATEWAY_MONEY_MARKET_SECURITY, moneyMarketSecurityNewRequest);
|
||||
} catch (Throwable e) {
|
||||
log.error("{}", ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue