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