http://jira.mfd.msk:8088/browse/CLS-301 some fixes
This commit is contained in:
parent
3a887732ac
commit
baa61228fa
7 changed files with 41 additions and 5 deletions
|
|
@ -74,7 +74,7 @@ public class PrepareIncomeSecurities extends Stage<FondListingsRequestParam> {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
if (filteredIncomeSecurities.isEmpty()) {
|
||||
return new ProcessResult(GatewayError.SecurityNotFound);
|
||||
return new ProcessResult(GatewayError.SecurityNotFound, securities.stream().map(fondSecurity -> fondSecurity.getId().toString()).collect(Collectors.joining(", ")));
|
||||
}
|
||||
|
||||
param.setSecurities(filteredIncomeSecurities);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class SendMessageToCompanyServiceWithIssuerCompanies extends Stage<FondLi
|
|||
companyInfoUpdateRequest.setResidence(companyInfo.getResidence());
|
||||
companyInfoUpdateRequest.setShortNameEng(companyInfo.getShortNameEng());
|
||||
companyInfoUpdateRequest.setFullNameEng(companyInfo.getFullNameEng());
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_COMPANY_UPDATE, companyInfoUpdateRequest);
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_COMPANY_INFO_UPDATE, companyInfoUpdateRequest);
|
||||
|
||||
for (IssuerCompanySymbols companySymbols : company.getIssuerCompanySymbolsList()) {
|
||||
if (companySymbols.isInvalidData()) continue;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public class ValidateIncomeSecurities extends Stage<FondListingsRequestParam> {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
if (filteredIncomeSecurities.isEmpty()) {
|
||||
return new ProcessResult(GatewayError.SecurityNotFound);
|
||||
return new ProcessResult(GatewayError.SecurityNotFound, securities.stream().map(fondSecurity -> fondSecurity.getId().toString()).collect(Collectors.joining(", ")));
|
||||
}
|
||||
|
||||
param.setSecurities(filteredIncomeSecurities);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class PrepareExchangeInstruments extends Stage<MMListingsRequestParam> {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
if (filteredExchangeInstrument.isEmpty()) {
|
||||
return new ProcessResult(GatewayError.SecurityNotFound);
|
||||
return new ProcessResult(GatewayError.SecurityNotFound, exchangeInstrumentList.stream().map(fondSecurity -> fondSecurity.getId().toString()).collect(Collectors.joining(", ")));
|
||||
}
|
||||
|
||||
param.setExchangeInstrumentsList(filteredExchangeInstrument);
|
||||
|
|
|
|||
|
|
@ -120,7 +120,8 @@ public class FondSecurity extends WithMapId {
|
|||
«E», если Общая информация\\Тип ценной бумаги = «E - Биржевая облигация»
|
||||
«I», если Общая информация\\Тип ценной бумаги = «I - Облигации с индексированным номиналом»
|
||||
«M», если Общая информация\\Тип ценной бумаги = «M - Облигации с амортизацией долга»
|
||||
"""
|
||||
""",
|
||||
example = "Z"
|
||||
)
|
||||
private String bondType;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import ru.spcex.clearing.platform.messaging.service.RequestInfoUpdate;
|
|||
import ru.spcex.clearing.util.security.UserRoleVerification;
|
||||
import ru.spcex.platform.enumeration.Task;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class GatewayService extends QueueConsumer implements InitializingBean {
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
|
@ -52,6 +54,8 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
|
|||
RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest);
|
||||
if (requestInfoUpdate != null) return requestInfoUpdate;
|
||||
|
||||
logUnknownProperties(userRequest);
|
||||
|
||||
String url = formingInboundUrl(inboundServerSettings.getPathLOCM());
|
||||
String response = restTemplate.getForObject(url, String.class);
|
||||
|
||||
|
|
@ -65,6 +69,8 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
|
|||
RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest);
|
||||
if (requestInfoUpdate != null) return requestInfoUpdate;
|
||||
|
||||
logUnknownProperties(userRequest);
|
||||
|
||||
String url = formingInboundUrl(inboundServerSettings.getPathLOSC());
|
||||
String response = restTemplate.getForObject(url, String.class);
|
||||
|
||||
|
|
@ -80,4 +86,16 @@ public class GatewayService extends QueueConsumer implements InitializingBean {
|
|||
path
|
||||
);
|
||||
}
|
||||
|
||||
private void logUnknownProperties(BaseRequest<GatewayTaskRequest> request) {
|
||||
Map<String, Object> unknownProperties = request.getUnknownProperties();
|
||||
for (Map.Entry<String, Object> unknownProperty : unknownProperties.entrySet()) {
|
||||
log.warn("Unknown property in request {} = {}", unknownProperty.getKey(), unknownProperty.getValue());
|
||||
}
|
||||
unknownProperties = request.getRequestPayload().getUnknownProperties();
|
||||
for (Map.Entry<String, Object> unknownProperty : unknownProperties.entrySet()) {
|
||||
log.warn("Unknown property in payload request {} = {}", unknownProperty.getKey(), unknownProperty.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,24 @@
|
|||
package ru.spcex.clearing.platform.messaging.domain.cud.gateway;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class GatewayTaskRequest {
|
||||
@JsonProperty
|
||||
public String task;
|
||||
|
||||
@JsonIgnore
|
||||
private final Map<String, Object> unknownProperties = new HashMap<>();
|
||||
|
||||
@JsonAnySetter
|
||||
public void add(String key, Object value) {
|
||||
unknownProperties.put(key, value);
|
||||
}
|
||||
|
||||
public String getTask() {
|
||||
return task;
|
||||
}
|
||||
|
|
@ -13,4 +26,8 @@ public class GatewayTaskRequest {
|
|||
public void setTask(String task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
public Map<String, Object> getUnknownProperties() {
|
||||
return unknownProperties;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue