поправил баг в gateway

This commit is contained in:
etreschenkov 2023-07-12 13:52:11 +03:00
parent 656920e1ac
commit 8da9583854
3 changed files with 6 additions and 1 deletions

View file

@ -58,7 +58,7 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
super(kafkaQueue, kafkaProducer);
this.restTemplate = restTemplate;
this.userRoleVerification = userRoleVerification;
this.inboundServerSettings = null;
this.inboundServerSettings = gatewayApiSettings.getInboundServer();
this.sentAssets = sentAssets;
this.outboundRequestByUuid = outboundRequestByUuid;
}

View file

@ -10,6 +10,7 @@ public class MoneyMarketSecurityRequestAdapter {
public MoneyMarketSecurityNewRequest toMoneyMarketSecurityNewRequest(ExchangeInstrument exchangeInstrument) {
MoneyMarketSecurityNewRequest moneyMarketSecurityNewRequest = new MoneyMarketSecurityNewRequest();
moneyMarketSecurityNewRequest.setSecuritySymbol(exchangeInstrument.getCode().substring(0, 6));
moneyMarketSecurityNewRequest.setNominalCurrency(exchangeInstrument.getSettlementCurrencyLetterCode());
moneyMarketSecurityNewRequest.setInstrumentType(InstrumentType.RATE.getKey());
moneyMarketSecurityNewRequest.setShortName(exchangeInstrument.getName());

View file

@ -1,5 +1,6 @@
package ru.spcex.clearing.gatewayapi.service.processor;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@ -31,6 +32,9 @@ public class ListingMMProcessor {
for (ExchangeInstrument exchangeInstrument : exchangeInstrumentList) {
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());
}
MoneyMarketSecurityNewRequest moneyMarketSecurityNewRequest = moneyMarketSecurityRequestAdapter
.toMoneyMarketSecurityNewRequest(exchangeInstrument);