From 6d47a2e3224db2d7ce53677fbf8037702d8bb2bb Mon Sep 17 00:00:00 2001 From: etreschenkov Date: Fri, 24 May 2024 13:37:12 +0300 Subject: [PATCH] http://jira.mfd.msk:8088/browse/CLS-684 --- clearing-parent/gateway-api/pom.xml | 4 + .../controller/GatewayController.java | 44 +++++++++-- .../request/tkr/request/InfoAccount.java | 77 +++++++++++++++++++ .../request/tkr/request/MoneyAccount.java | 26 +++++++ .../request/tkr/request/TkrRequest.java | 49 ++++++++++++ .../tkr/response/MoneyAccountResponse.java | 10 +++ .../request/tkr/response/TkrElemResponse.java | 23 ++++++ .../gatewayapi/service/GatewayService.java | 43 +++++++++-- .../gatewayapi/service/TkrService.java | 30 ++++++++ .../service/adapter/TkrAdapter.java | 32 ++++++++ .../builders/TkrListResultBuilder.java | 31 ++++++++ .../platform/messaging/domain/Consts.java | 1 + .../domain/cud/gateway/MoneyAccountMsg.java | 26 +++++++ .../domain/cud/gateway/SendTkrRequest.java | 28 +++++++ .../domain/cud/gateway/TkrAccount.java | 77 +++++++++++++++++++ .../cud/gateway/TkrAccountsResponse.java | 17 ++++ 16 files changed, 505 insertions(+), 13 deletions(-) create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/InfoAccount.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/MoneyAccount.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/TkrRequest.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/MoneyAccountResponse.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/TkrElemResponse.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/TkrService.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/TkrAdapter.java create mode 100644 clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/builders/TkrListResultBuilder.java create mode 100644 platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/MoneyAccountMsg.java create mode 100644 platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/SendTkrRequest.java create mode 100644 platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccount.java create mode 100644 platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccountsResponse.java diff --git a/clearing-parent/gateway-api/pom.xml b/clearing-parent/gateway-api/pom.xml index e8fae9d63..eeb56e8ca 100644 --- a/clearing-parent/gateway-api/pom.xml +++ b/clearing-parent/gateway-api/pom.xml @@ -80,6 +80,10 @@ test-clearing test + + jakarta.validation + jakarta.validation-api + diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/GatewayController.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/GatewayController.java index 47bfb56d9..bfb4c19bc 100644 --- a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/GatewayController.java +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/GatewayController.java @@ -3,13 +3,23 @@ package ru.spcex.clearing.gatewayapi.controller; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutorService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; import ru.spcex.clearing.gatewayapi.controller.inbound.request.CommonRequest; import ru.spcex.clearing.gatewayapi.controller.inbound.request.company.CompaniesRequest; import ru.spcex.clearing.gatewayapi.controller.inbound.request.limit.LimitRequest; @@ -17,10 +27,12 @@ import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.curr.mkr. import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.fond.FondListingsRequest; import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.mkr.MMListingsRequest; import ru.spcex.clearing.gatewayapi.controller.inbound.request.operations.OperationsRequest; +import ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request.TkrRequest; import ru.spcex.clearing.gatewayapi.controller.inbound.response.CommonResponse; import ru.spcex.clearing.gatewayapi.exception.GatewayException; import ru.spcex.clearing.gatewayapi.service.NotificationService; import ru.spcex.clearing.gatewayapi.service.OperationService; +import ru.spcex.clearing.gatewayapi.service.TkrService; import ru.spcex.clearing.gatewayapi.service.processor.CompanyProcessor; import ru.spcex.clearing.gatewayapi.service.processor.ListingCurrProcessor; import ru.spcex.clearing.gatewayapi.service.processor.ListingFondProcessor; @@ -28,12 +40,6 @@ import ru.spcex.clearing.gatewayapi.service.processor.ListingMMProcessor; import ru.spcex.platform.utils.enumeration.EnumMessage; import ru.spcex.platform.utils.enumeration.IMessageResolver; -import java.time.Instant; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutorService; - @Controller @RequestMapping("/") public class GatewayController { @@ -47,6 +53,7 @@ public class GatewayController { private final ExecutorService executor; private final OperationService operationService; private final NotificationService notificationService; + private final TkrService tkrService; private List validTypes = Arrays.asList("DAY_START", "ON_DEMAND"); @@ -57,7 +64,8 @@ public class GatewayController { ListingCurrProcessor listingCurrProcessor, @Qualifier("gatewayExecutor") ExecutorService executor, OperationService operationService, - NotificationService notificationService) { + NotificationService notificationService, + TkrService tkrService) { this.messageResolver = messageResolver; this.companiesProcessor = companiesProcessor; this.listingFondProcessor = listingFondProcessor; @@ -66,6 +74,7 @@ public class GatewayController { this.executor = executor; this.operationService = operationService; this.notificationService = notificationService; + this.tkrService = tkrService; } @@ -182,6 +191,25 @@ public class GatewayController { return createCommonResponse(request.getId()); } + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = CommonResponse.class), + @ApiResponse(code = 400, message = "Ошибка валидации", response = CommonResponse.class) + }) + @RequestMapping( + path = "/member_request_tkr", + method = RequestMethod.POST, + consumes = MediaType.APPLICATION_JSON_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE + ) + @ResponseBody + public CommonResponse requestTkr(@RequestBody TkrRequest request) { + log.debug("Received message: {}", request); + executor.submit(() -> { + tkrService.processedTkrRequest(request); + }); + return createCommonResponse(request.getId()); + } + @ResponseStatus(value = HttpStatus.BAD_REQUEST) @ResponseBody @ExceptionHandler(GatewayException.class) diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/InfoAccount.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/InfoAccount.java new file mode 100644 index 000000000..368f62b01 --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/InfoAccount.java @@ -0,0 +1,77 @@ +package ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class InfoAccount { + @JsonProperty("company_id") + private String companyId; + @JsonProperty("trading_code") + private Long tradingCode; + @JsonProperty("client_code") + private String clientCode; + @JsonProperty("enabled") + private Boolean enabled; + @JsonProperty("tkr_code") + private String tkrCode; + @JsonProperty("depo_account") + private String depoAccount; + @JsonProperty("money_account") + private List moneyAccounts; + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public Long getTradingCode() { + return tradingCode; + } + + public void setTradingCode(Long tradingCode) { + this.tradingCode = tradingCode; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getTkrCode() { + return tkrCode; + } + + public void setTkrCode(String tkrCode) { + this.tkrCode = tkrCode; + } + + public String getDepoAccount() { + return depoAccount; + } + + public void setDepoAccount(String depoAccount) { + this.depoAccount = depoAccount; + } + + public List getMoneyAccounts() { + return moneyAccounts; + } + + public void setMoneyAccounts(List moneyAccounts) { + this.moneyAccounts = moneyAccounts; + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/MoneyAccount.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/MoneyAccount.java new file mode 100644 index 000000000..4e914f121 --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/MoneyAccount.java @@ -0,0 +1,26 @@ +package ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MoneyAccount { + @JsonProperty("curr_code") + private String currCode; + @JsonProperty("account") + private String account; + + public String getCurrCode() { + return currCode; + } + + public void setCurrCode(String currCode) { + this.currCode = currCode; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/TkrRequest.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/TkrRequest.java new file mode 100644 index 000000000..fd9cb5bea --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/request/TkrRequest.java @@ -0,0 +1,49 @@ +package ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TkrRequest { + @JsonProperty("id") + private UUID id; + @JsonProperty("datetime") + private LocalDateTime datetime; + @JsonProperty("type") + private String type; + @JsonProperty("sent_info_accounts") + private List infoAccount; + + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public LocalDateTime getDatetime() { + return datetime; + } + + public void setDatetime(LocalDateTime datetime) { + this.datetime = datetime; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getInfoAccount() { + return infoAccount; + } + + public void setInfoAccount(List infoAccount) { + this.infoAccount = infoAccount; + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/MoneyAccountResponse.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/MoneyAccountResponse.java new file mode 100644 index 000000000..7e2d7e041 --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/MoneyAccountResponse.java @@ -0,0 +1,10 @@ +package ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.response; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MoneyAccountResponse { + @JsonProperty("curr_code") + private String currCode; + @JsonProperty("account") + private String account; +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/TkrElemResponse.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/TkrElemResponse.java new file mode 100644 index 000000000..e92b1a6f8 --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/controller/inbound/request/tkr/response/TkrElemResponse.java @@ -0,0 +1,23 @@ +package ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.response; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TkrElemResponse { + @JsonProperty("company_id") + private String companyId; + @JsonProperty("trading_code") + private Long tradingCode; + @JsonProperty("client_code") + private String clientCode; + @JsonProperty("tkr_code") + private String tkrCode; + @JsonProperty("tkr_type") + private String tkrType; + @JsonProperty("account_type_name") + private String accountTypeName; + @JsonProperty("depo_account") + private String depoAccount; + @JsonProperty("money_account") + private List moneyAccounts; +} 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 87389b7e5..2749d4031 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 @@ -1,5 +1,14 @@ package ru.spcex.clearing.gatewayapi.service; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.regex.Pattern; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.kafka.clients.consumer.Consumer; import org.apache.kafka.clients.producer.Producer; @@ -7,7 +16,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.http.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import ru.clearing.classes.statics.data.register.GatewayResult; @@ -39,10 +52,6 @@ import ru.spcex.platform.imdg.api.Imdg; import ru.spcex.platform.imdg.api.ImdgProvider; import ru.spcex.platform.utils.enumeration.IEnumKey; -import java.math.BigDecimal; -import java.util.*; -import java.util.regex.Pattern; - @Service public class GatewayService extends QueueConsumer implements InitializingBean { private final Logger log = LoggerFactory.getLogger(getClass()); @@ -258,6 +267,30 @@ public class GatewayService extends QueueConsumer implements InitializingBean { } } + public void requestOnTkr(BaseRequest request) { + SendReportRequest reportRequest = request.getRequestPayload(); + ReportType reportType = IEnumKey.getEnumByKey(ReportType.class, reportRequest.getType()); + if (reportType == null) { + log.warn("Undefined type of request: {}; skip", reportRequest.getType()); + return; + } + + Map content = new HashMap<>(); + reportRequest.getReports().forEach(reportPart -> makeContentByReportRequest(content, reportPart)); + OutboundRequest outboundRequest = OutboundRequestBuilder.builder() + .section(Section.FOND.getKey()) + .type(reportType.getKey()) + .content(content).build(); + + String url = formingInboundUrl(inboundServerSettings.getPathLOCM()); + HttpEntity r = makeDefaultRequest(outboundRequest); + ResponseEntity response = restTemplate.exchange(url, HttpMethod.POST, r, SuccessResponse.class); + SuccessResponse bodyResponse = response.getBody(); + if (bodyResponse != null) { + log.debug("Response from service: {}", bodyResponse); + } + } + protected void makeContentByReportRequest(Map content, ReportPart reportPart) { ReportKeys reportKey = IEnumKey.getEnumByKey(ReportKeys.class, reportPart.getReportType()); if (reportKey == null) { diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/TkrService.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/TkrService.java new file mode 100644 index 000000000..85be2e9ea --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/TkrService.java @@ -0,0 +1,30 @@ +package ru.spcex.clearing.gatewayapi.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request.TkrRequest; +import ru.spcex.clearing.gatewayapi.service.adapter.TkrAdapter; +import ru.spcex.clearing.platform.messaging.domain.Consts; +import ru.spcex.clearing.platform.messaging.domain.cud.gateway.TkrAccount; +import ru.spcex.clearing.platform.messaging.domain.cud.gateway.TkrAccountsResponse; +import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender; + +@Service +public class TkrService { + private final KafkaSender kafkaSender; + private final TkrAdapter tkrAdapter; + + public TkrService(KafkaSender kafkaSender, + TkrAdapter tkrAdapter) { + this.kafkaSender = kafkaSender; + this.tkrAdapter = tkrAdapter; + } + + public void processedTkrRequest(TkrRequest tkrRequest) { + List tkrAccounts = tkrRequest.getInfoAccount().stream() + .map(tkrAdapter::toTkrResponse).toList(); + TkrAccountsResponse tkrAccountsResponse = new TkrAccountsResponse(); + tkrAccountsResponse.setAccounts(tkrAccounts); + kafkaSender.sendRequestToQueue(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_CHECK, tkrAccountsResponse); + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/TkrAdapter.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/TkrAdapter.java new file mode 100644 index 000000000..1899d861b --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/adapter/TkrAdapter.java @@ -0,0 +1,32 @@ +package ru.spcex.clearing.gatewayapi.service.adapter; + +import java.util.List; +import org.springframework.stereotype.Service; +import ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request.InfoAccount; +import ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.request.MoneyAccount; +import ru.spcex.clearing.platform.messaging.domain.cud.gateway.MoneyAccountMsg; +import ru.spcex.clearing.platform.messaging.domain.cud.gateway.TkrAccount; + +@Service +public class TkrAdapter { + public TkrAccount toTkrResponse(InfoAccount infoAccount) { + TkrAccount tkrResponse = new TkrAccount(); + tkrResponse.setCompanyId(infoAccount.getCompanyId()); + tkrResponse.setTradingCode(infoAccount.getTradingCode()); + tkrResponse.setClientCode(infoAccount.getClientCode()); + tkrResponse.setEnabled(infoAccount.getEnabled()); + tkrResponse.setTkrCode(infoAccount.getTkrCode()); + tkrResponse.setDepoAccount(infoAccount.getDepoAccount()); + List moneyAccountMsgs = infoAccount.getMoneyAccounts().stream() + .map(this::toMoneyAccountMsg).toList(); + tkrResponse.setMoneyAccounts(moneyAccountMsgs); + return tkrResponse; + } + + private MoneyAccountMsg toMoneyAccountMsg(MoneyAccount moneyAccount) { + MoneyAccountMsg moneyAccountMsg = new MoneyAccountMsg(); + moneyAccountMsg.setAccount(moneyAccount.getAccount()); + moneyAccountMsg.setCurrCode(moneyAccount.getCurrCode()); + return moneyAccountMsg; + } +} diff --git a/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/builders/TkrListResultBuilder.java b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/builders/TkrListResultBuilder.java new file mode 100644 index 000000000..13fe320b3 --- /dev/null +++ b/clearing-parent/gateway-api/src/main/java/ru/spcex/clearing/gatewayapi/service/builders/TkrListResultBuilder.java @@ -0,0 +1,31 @@ +package ru.spcex.clearing.gatewayapi.service.builders; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import ru.spcex.clearing.gatewayapi.controller.inbound.request.tkr.response.TkrElemResponse; + +public class TkrListResultBuilder { + private final List tkrElems; + + private TkrListResultBuilder() { + this.tkrElems = new ArrayList<>(); + } + + public static TkrListResultBuilder builder() { + return new TkrListResultBuilder(); + } + + public TkrListResultBuilder elemOfList() { + TkrElemResponse tkrElemResponse = new TkrElemResponse(); + tkrElems.add(tkrElemResponse); + return this; + } + + public Map> build() { + Map> map = new HashMap<>(); + map.put("tkr_list", this.tkrElems); + return map; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java index b5327eb6d..71ed89182 100644 --- a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/Consts.java @@ -110,6 +110,7 @@ public interface Consts { String DESTINATION_TRADING_CLEARING_REGISTRY_AUTO_NEW = "trading-clearing-registry-auto-new"; String DESTINATION_TRADING_CLEARING_REGISTRY_UPDATE = "trading-clearing-registry-update"; String DESTINATION_TRADING_CLEARING_REGISTRY_BLOCK = "trading-clearing-registry-block"; + String DESTINATION_TRADING_CLEARING_REGISTRY_CHECK = "trading-clearing-registry-check"; String CLEARING_NOTIFICATION_FEEDBACK = "clearing-notification-feedback"; String ACCOUNT_NOTIFICATION_FEEDBACK = "account-notification-feedback"; diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/MoneyAccountMsg.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/MoneyAccountMsg.java new file mode 100644 index 000000000..a8991c3bd --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/MoneyAccountMsg.java @@ -0,0 +1,26 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.gateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MoneyAccountMsg { + @JsonProperty("curr_code") + private String currCode; + @JsonProperty("account") + private String account; + + public String getCurrCode() { + return currCode; + } + + public void setCurrCode(String currCode) { + this.currCode = currCode; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/SendTkrRequest.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/SendTkrRequest.java new file mode 100644 index 000000000..dda555468 --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/SendTkrRequest.java @@ -0,0 +1,28 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.gateway; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SendTkrRequest { + @JsonProperty + private List tkrs; + + public class Tkr { + @JsonProperty + private String companyId; + @JsonProperty + private Long tradingCode; + @JsonProperty + private String clientCode; + @JsonProperty + private String tkrCode; + @JsonProperty + private String tkrType; + @JsonProperty + private String accountTypeName; + @JsonProperty + private String depoAccount; + @JsonProperty + private List moneyAccounts; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccount.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccount.java new file mode 100644 index 000000000..10670728d --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccount.java @@ -0,0 +1,77 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.gateway; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TkrAccount { + @JsonProperty + private String companyId; + @JsonProperty + private Long tradingCode; + @JsonProperty + private String clientCode; + @JsonProperty + private Boolean enabled; + @JsonProperty + private String tkrCode; + @JsonProperty + private String depoAccount; + @JsonProperty + private List moneyAccounts; + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public Long getTradingCode() { + return tradingCode; + } + + public void setTradingCode(Long tradingCode) { + this.tradingCode = tradingCode; + } + + public String getClientCode() { + return clientCode; + } + + public void setClientCode(String clientCode) { + this.clientCode = clientCode; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getTkrCode() { + return tkrCode; + } + + public void setTkrCode(String tkrCode) { + this.tkrCode = tkrCode; + } + + public String getDepoAccount() { + return depoAccount; + } + + public void setDepoAccount(String depoAccount) { + this.depoAccount = depoAccount; + } + + public List getMoneyAccounts() { + return moneyAccounts; + } + + public void setMoneyAccounts(List moneyAccounts) { + this.moneyAccounts = moneyAccounts; + } +} diff --git a/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccountsResponse.java b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccountsResponse.java new file mode 100644 index 000000000..d557f429a --- /dev/null +++ b/platform-parent/platform-messaging/src/main/java/ru/spcex/clearing/platform/messaging/domain/cud/gateway/TkrAccountsResponse.java @@ -0,0 +1,17 @@ +package ru.spcex.clearing.platform.messaging.domain.cud.gateway; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TkrAccountsResponse { + @JsonProperty + private List accounts; + + public List getAccounts() { + return accounts; + } + + public void setAccounts(List accounts) { + this.accounts = accounts; + } +}