Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9c868859db
4 changed files with 254 additions and 1 deletions
|
|
@ -0,0 +1,63 @@
|
||||||
|
package ru.spcex.clearing.registry.service;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.kafka.clients.consumer.Consumer;
|
||||||
|
import org.apache.kafka.clients.producer.Producer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import ru.clearing.classes.statics.data.register.AdmittedDealRegister;
|
||||||
|
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||||
|
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
|
||||||
|
import ru.spcex.clearing.platform.messaging.domain.Consts;
|
||||||
|
import ru.spcex.clearing.platform.messaging.domain.cud.registry.AdmittedDealRegisterNewRequest;
|
||||||
|
import ru.spcex.clearing.platform.messaging.service.QueueConsumer;
|
||||||
|
import ru.spcex.platform.imdg.api.Imdg;
|
||||||
|
import ru.spcex.platform.imdg.api.ImdgProvider;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AdmittedDealRegisterService extends QueueConsumer implements InitializingBean {
|
||||||
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
private final Imdg<AdmittedDealRegister> admittedDealRegisterMap;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AdmittedDealRegisterService(Consumer<String, Object> kafkaQueue, Producer<String, Object> kafkaProducer,
|
||||||
|
ImdgProvider imdgProvider) {
|
||||||
|
super(kafkaQueue, kafkaProducer);
|
||||||
|
this.admittedDealRegisterMap = imdgProvider.getImdg(IMDGDistributedNames.Map_AdmittedDealRegister, AdmittedDealRegister.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() {
|
||||||
|
callback(AdmittedDealRegisterNewRequest.class)
|
||||||
|
.setConsumer(this::admittedDealRegisterNew)
|
||||||
|
.forDestination(Consts.REGISTRY_ADMITTED_DEAL_REGISTER_NEW, callbacks::put);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void admittedDealRegisterNew(BaseRequest<AdmittedDealRegisterNewRequest> userRequest) {
|
||||||
|
AdmittedDealRegisterNewRequest req = userRequest.getRequestPayload();
|
||||||
|
log.debug("AdmittedDealRegisterNewRequest received");
|
||||||
|
AdmittedDealRegister register = new AdmittedDealRegister();
|
||||||
|
register.setExecutionId(req.getExecutionId());
|
||||||
|
register.setCompanyFullName(req.getCompanyFullName());
|
||||||
|
register.setTradingDate(req.getTradingDate());
|
||||||
|
register.setExchangeExecutionId(req.getExchangeExecutionId());
|
||||||
|
register.setExchangeExecutionTime(req.getExchangeExecutionTime());
|
||||||
|
register.setSecuritySymbol(req.getSecuritySymbol());
|
||||||
|
register.setSecurityFullName(req.getSecurityFullName());
|
||||||
|
register.setSellerFullName(req.getSellerFullName());
|
||||||
|
register.setSellerClearingCode(req.getSellerClearingCode());
|
||||||
|
register.setSellerAccount(req.getSellerAccount());
|
||||||
|
register.setBuyerFullName(req.getBuyerFullName());
|
||||||
|
register.setBuyerClearingCode(req.getBuyerClearingCode());
|
||||||
|
register.setBuyerAccount(req.getBuyerAccount());
|
||||||
|
register.setAmount(req.getAmount());
|
||||||
|
register.setClearingDate(req.getClearingDate());
|
||||||
|
admittedDealRegisterMap.insert(register);
|
||||||
|
log.debug("successfully processed, id {}", register.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -56,4 +56,5 @@ public interface Consts {
|
||||||
String REQUEST_INFO_UPDATE = "request-info-update";
|
String REQUEST_INFO_UPDATE = "request-info-update";
|
||||||
|
|
||||||
String REGISTRY_COVERED_DEAL_REGISTER_NEW = "registry-covered-deal-register-new";
|
String REGISTRY_COVERED_DEAL_REGISTER_NEW = "registry-covered-deal-register-new";
|
||||||
|
String REGISTRY_ADMITTED_DEAL_REGISTER_NEW = "registry-admitted-deal-register-new";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
package ru.spcex.clearing.platform.messaging.domain.cud.registry;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class AdmittedDealRegisterNewRequest {
|
||||||
|
@JsonProperty
|
||||||
|
public Long executionId;
|
||||||
|
@JsonProperty
|
||||||
|
public String companyFullName;
|
||||||
|
@JsonProperty
|
||||||
|
public LocalDate tradingDate;
|
||||||
|
@JsonProperty
|
||||||
|
public Long exchangeExecutionId;
|
||||||
|
@JsonProperty
|
||||||
|
public Instant exchangeExecutionTime;
|
||||||
|
@JsonProperty
|
||||||
|
public String securitySymbol;
|
||||||
|
@JsonProperty
|
||||||
|
public String securityFullName;
|
||||||
|
@JsonProperty
|
||||||
|
public String sellerFullName;
|
||||||
|
@JsonProperty
|
||||||
|
public String sellerClearingCode;
|
||||||
|
@JsonProperty
|
||||||
|
public String sellerAccount;
|
||||||
|
@JsonProperty
|
||||||
|
public String buyerFullName;
|
||||||
|
@JsonProperty
|
||||||
|
public String buyerClearingCode;
|
||||||
|
@JsonProperty
|
||||||
|
public String buyerAccount;
|
||||||
|
@JsonProperty
|
||||||
|
public BigDecimal amount;
|
||||||
|
@JsonProperty
|
||||||
|
public Long id;
|
||||||
|
@JsonProperty
|
||||||
|
public Instant createdAt;
|
||||||
|
@JsonProperty
|
||||||
|
public Instant updatedAt;
|
||||||
|
@JsonProperty
|
||||||
|
public LocalDate clearingDate;
|
||||||
|
|
||||||
|
public Long getExecutionId() {
|
||||||
|
return executionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutionId(Long executionId) {
|
||||||
|
this.executionId = executionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompanyFullName() {
|
||||||
|
return companyFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompanyFullName(String companyFullName) {
|
||||||
|
this.companyFullName = companyFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getTradingDate() {
|
||||||
|
return tradingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTradingDate(LocalDate tradingDate) {
|
||||||
|
this.tradingDate = tradingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getExchangeExecutionId() {
|
||||||
|
return exchangeExecutionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExchangeExecutionId(Long exchangeExecutionId) {
|
||||||
|
this.exchangeExecutionId = exchangeExecutionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getExchangeExecutionTime() {
|
||||||
|
return exchangeExecutionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExchangeExecutionTime(Instant exchangeExecutionTime) {
|
||||||
|
this.exchangeExecutionTime = exchangeExecutionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecuritySymbol() {
|
||||||
|
return securitySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecuritySymbol(String securitySymbol) {
|
||||||
|
this.securitySymbol = securitySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecurityFullName() {
|
||||||
|
return securityFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecurityFullName(String securityFullName) {
|
||||||
|
this.securityFullName = securityFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSellerFullName() {
|
||||||
|
return sellerFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSellerFullName(String sellerFullName) {
|
||||||
|
this.sellerFullName = sellerFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSellerClearingCode() {
|
||||||
|
return sellerClearingCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSellerClearingCode(String sellerClearingCode) {
|
||||||
|
this.sellerClearingCode = sellerClearingCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSellerAccount() {
|
||||||
|
return sellerAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSellerAccount(String sellerAccount) {
|
||||||
|
this.sellerAccount = sellerAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuyerFullName() {
|
||||||
|
return buyerFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyerFullName(String buyerFullName) {
|
||||||
|
this.buyerFullName = buyerFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuyerClearingCode() {
|
||||||
|
return buyerClearingCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyerClearingCode(String buyerClearingCode) {
|
||||||
|
this.buyerClearingCode = buyerClearingCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuyerAccount() {
|
||||||
|
return buyerAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyerAccount(String buyerAccount) {
|
||||||
|
this.buyerAccount = buyerAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(BigDecimal amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getCreatedAt() {
|
||||||
|
return createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedAt(Instant createdAt) {
|
||||||
|
this.createdAt = createdAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getUpdatedAt() {
|
||||||
|
return updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedAt(Instant updatedAt) {
|
||||||
|
this.updatedAt = updatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getClearingDate() {
|
||||||
|
return clearingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClearingDate(LocalDate clearingDate) {
|
||||||
|
this.clearingDate = clearingDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,6 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
public class CoveredDealRegisterNewRequest {
|
public class CoveredDealRegisterNewRequest {
|
||||||
|
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
public Long executionId;
|
public Long executionId;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue