From 70a0316d191549e5a4375b6886adf61305a6fdd3 Mon Sep 17 00:00:00 2001 From: etreschenkov Date: Thu, 3 Oct 2024 16:42:07 +0300 Subject: [PATCH] http://jira.mfd.msk:8088/browse/CLS-768 --- .../gatewayapi/config/GatewayApiSettings.java | 9 +++++++++ .../outbound/request/OutboundRequest.java | 12 ++++++++++++ .../gatewayapi/enums/ClearingSystems.java | 15 +++++++++++++++ .../gatewayapi/service/GatewayService.java | 5 +++++ .../src/main/resources/application.properties | 2 ++ 5 files changed, 43 insertions(+) create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/enums/ClearingSystems.java diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/config/GatewayApiSettings.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/config/GatewayApiSettings.java index c3aebf62c..04c9c7e3a 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/config/GatewayApiSettings.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/config/GatewayApiSettings.java @@ -16,6 +16,7 @@ public class GatewayApiSettings { private KafkaConsumerSettings kafkaConsumer; private InboundServerSettings inboundServer; private InboundExternalServerSettings inboundExternalServer; + private String clearingSystem; public HazelcastClientParams getHazelcast() { return hazelcast; @@ -56,4 +57,12 @@ public class GatewayApiSettings { public void setInboundExternalServer(InboundExternalServerSettings inboundExternalServer) { this.inboundExternalServer = inboundExternalServer; } + + public String getClearingSystem() { + return clearingSystem; + } + + public void setClearingSystem(String clearingSystem) { + this.clearingSystem = clearingSystem; + } } diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/outbound/request/OutboundRequest.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/outbound/request/OutboundRequest.java index f32281507..20357dfc7 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/outbound/request/OutboundRequest.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/outbound/request/OutboundRequest.java @@ -48,6 +48,10 @@ public class OutboundRequest { ) private String section = ""; + @JsonProperty("clearing_system") + @ApiModelProperty(value = "Клиринговая система", example = "SPVB/LCC") + private String clearingSystem; + // todo Пока так, чтобы отсылал null, в дальнейшем тип надо заменить на используемый в запросе. Возможно с помощью параметризации @JsonProperty("content") @ApiModelProperty( @@ -88,6 +92,14 @@ public class OutboundRequest { this.section = section; } + public String getClearingSystem() { + return clearingSystem; + } + + public void setClearingSystem(String clearingSystem) { + this.clearingSystem = clearingSystem; + } + public Map getContent() { return content; } diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/enums/ClearingSystems.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/enums/ClearingSystems.java new file mode 100644 index 000000000..b837f256d --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/enums/ClearingSystems.java @@ -0,0 +1,15 @@ +package ru.spcex.clearing.gatewayapi.enums; + +public enum ClearingSystems { + SPVB("SPVB"), + LCC("LCC"); + + private final String name; + ClearingSystems(final String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java index 516347aa8..968b692f7 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/GatewayService.java @@ -62,6 +62,7 @@ public class GatewayService extends QueueConsumer implements InitializingBean { private final RestTemplate restTemplate; private final InboundServerSettings inboundServerSettings; private final InboundExternalServerSettings inboundExternalServerSettings; + private final GatewayApiSettings gatewayApiSettings; private final Map> sentAssets; private final Map outboundRequestByUuid; protected final Imdg gatewayResultImdg; @@ -78,6 +79,7 @@ public class GatewayService extends QueueConsumer implements InitializingBean { super(kafkaQueue, kafkaProducer); this.restTemplate = restTemplate; this.userRoleVerification = userRoleVerification; + this.gatewayApiSettings = gatewayApiSettings; this.inboundServerSettings = gatewayApiSettings.getInboundServer(); this.inboundExternalServerSettings = gatewayApiSettings.getInboundExternalServer(); this.sentAssets = sentAssets; @@ -274,6 +276,8 @@ public class GatewayService extends QueueConsumer implements InitializingBean { case KS_REP_FIRM_DETAILS -> paramName = "ks_rep_firm_details"; case KS_SESSION_LIST -> paramName = "ks_session_list"; case KS_COMMISSION_TRADES -> paramName = "ks_commission_trades"; + case KS_REP_LCC_TRADES_REPORT -> paramName = "ks_rep_lcc_trades"; + case KS_REP_LCC_NETTO_REPORT -> paramName = "ks_rep_lcc_netto"; } if (paramName != null) { content.put(paramName, reportPart.getFileName()); @@ -281,6 +285,7 @@ public class GatewayService extends QueueConsumer implements InitializingBean { } private void sendRequest(OutboundRequest request) { + request.setClearingSystem(gatewayApiSettings.getClearingSystem()); if (inboundServerSettings.getAllowedTypes().isEmpty() || inboundServerSettings.getAllowedTypes().contains(request.getType())) { String url = formingInboundUrl(inboundServerSettings.getEnableSsl(), diff --git a/clearing-parent/gateway-api/src/main/resources/application.properties b/clearing-parent/gateway-api/src/main/resources/application.properties index f7041f34d..3b2df0ad6 100644 --- a/clearing-parent/gateway-api/src/main/resources/application.properties +++ b/clearing-parent/gateway-api/src/main/resources/application.properties @@ -25,6 +25,8 @@ gateway-api.kafka-consumer.auto-offset-reset=latest gateway-api.kafka-consumer.linger-ms=1 gateway-api.kafka-consumer.buffer-memory=33554432 +gateway-api.clearing-system=LCC + gateway-api.inbound-server.enable-ssl=false gateway-api.inbound-server.host=10.200.200.183 gateway-api.inbound-server.port=8084