This commit is contained in:
parent
ee3bca8ed2
commit
89ba1d2122
7 changed files with 359 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.spcex.platform.classes.base.SpcexObjectBase;
|
||||
|
||||
|
||||
public class Currency extends SpcexObjectBase {
|
||||
private String countryCode;
|
||||
private String currencyCode;
|
||||
|
||||
public String getCountryCode() {
|
||||
return countryCode;
|
||||
}
|
||||
|
||||
public void setCountryCode(String countryCode) {
|
||||
this.countryCode = countryCode;
|
||||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return currencyCode;
|
||||
}
|
||||
|
||||
public void setCurrencyCode(String currencyCode) {
|
||||
this.currencyCode = currencyCode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.objects.BusinessObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
public class Listing extends BusinessObject {
|
||||
private Long securityId;
|
||||
private BigDecimal lotSize;
|
||||
private String market;
|
||||
private String symbolCode;
|
||||
private String symbolName;
|
||||
private String tradingCurrency;
|
||||
private String workflowStatus;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
}
|
||||
|
||||
public void setSecurityId(Long securityId) {
|
||||
this.securityId = securityId;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
|
||||
public String getMarket() {
|
||||
return market;
|
||||
}
|
||||
|
||||
public void setMarket(String market) {
|
||||
this.market = market;
|
||||
}
|
||||
|
||||
public String getSymbolCode() {
|
||||
return symbolCode;
|
||||
}
|
||||
|
||||
public void setSymbolCode(String symbolCode) {
|
||||
this.symbolCode = symbolCode;
|
||||
}
|
||||
|
||||
public String getSymbolName() {
|
||||
return symbolName;
|
||||
}
|
||||
|
||||
public void setSymbolName(String symbolName) {
|
||||
this.symbolName = symbolName;
|
||||
}
|
||||
|
||||
public String getTradingCurrency() {
|
||||
return tradingCurrency;
|
||||
}
|
||||
|
||||
public void setTradingCurrency(String tradingCurrency) {
|
||||
this.tradingCurrency = tradingCurrency;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String workflowStatus) {
|
||||
this.workflowStatus = workflowStatus;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.objects.BusinessObject;
|
||||
|
||||
|
||||
public class Market extends BusinessObject {
|
||||
private String description;
|
||||
private Long exchangeId;
|
||||
private String name;
|
||||
private String code;
|
||||
private String settlementCurrency;
|
||||
private String sector;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getExchangeId() {
|
||||
return exchangeId;
|
||||
}
|
||||
|
||||
public void setExchangeId(Long exchangeId) {
|
||||
this.exchangeId = exchangeId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getSettlementCurrency() {
|
||||
return settlementCurrency;
|
||||
}
|
||||
|
||||
public void setSettlementCurrency(String settlementCurrency) {
|
||||
this.settlementCurrency = settlementCurrency;
|
||||
}
|
||||
|
||||
public String getSector() {
|
||||
return sector;
|
||||
}
|
||||
|
||||
public void setSector(String sector) {
|
||||
this.sector = sector;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package ru.spcex.clearing.imdg.businessobject;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.misc.Listing;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
public class ListingMapStore extends TemplateMapStore<Listing> {
|
||||
|
||||
public ListingMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_Listing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "LISTING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "CREATED_AT", "UPDATED_AT", "SECURITY_ID", "LOT_SIZE", "MARKET", "SYMBOL_CODE", "SYMBOL_NAME", "TRADING_CURRENCY", "WORKFLOW_STATUS"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listing objectReader(ResultSet resultSet) throws SQLException {
|
||||
Listing object = new Listing();
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setCreated(getInstantFromTimestamp(resultSet, "CREATED_AT"));
|
||||
object.setUpdated(getInstantFromTimestamp(resultSet, "UPDATED_AT"));
|
||||
object.setSecurityId(resultSet.getObject("SECURITY_ID", Long.class));
|
||||
object.setLotSize(resultSet.getObject("LOT_SIZE", BigDecimal.class));
|
||||
object.setMarket(resultSet.getObject("MARKET", String.class));
|
||||
object.setSymbolCode(resultSet.getObject("SYMBOL_CODE", String.class));
|
||||
object.setSymbolName(resultSet.getObject("SYMBOL_NAME", String.class));
|
||||
object.setTradingCurrency(resultSet.getObject("TRADING_CURRENCY", String.class));
|
||||
object.setWorkflowStatus(resultSet.getObject("WORKFLOW_STATUS", String.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(Listing object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getSecurityId(),
|
||||
object.getLotSize(),
|
||||
object.getMarket(),
|
||||
object.getSymbolCode(),
|
||||
object.getSymbolName(),
|
||||
object.getTradingCurrency(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package ru.spcex.clearing.imdg.businessobject;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.misc.Market;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
public class MarketMapStore extends TemplateMapStore<Market> {
|
||||
|
||||
public MarketMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_Market;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "MARKET";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"id",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"description",
|
||||
"exchange_id",
|
||||
"name",
|
||||
"code",
|
||||
"settlement_currency",
|
||||
"sector"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Market objectReader(ResultSet resultSet) throws SQLException {
|
||||
Market object = new Market();
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setCreated(getInstantFromTimestamp(resultSet, "CREATED_AT"));
|
||||
object.setUpdated(getInstantFromTimestamp(resultSet, "UPDATED_AT"));
|
||||
object.setDescription(resultSet.getObject("DESCRIPTION", String.class));
|
||||
object.setExchangeId(resultSet.getObject("EXCHANGE_ID", Long.class));
|
||||
object.setName(resultSet.getObject("NAME", String.class));
|
||||
object.setCode(resultSet.getObject("CODE", String.class));
|
||||
object.setSettlementCurrency(resultSet.getObject("SETTLEMENT_CURRENCY", String.class));
|
||||
object.setSector(resultSet.getObject("SECTOR", String.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(Market object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getDescription(),
|
||||
object.getExchangeId(),
|
||||
object.getName(),
|
||||
object.getCode(),
|
||||
object.getSettlementCurrency(),
|
||||
object.getSector()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package ru.spcex.clearing.imdg.object;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.misc.Currency;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
public class CurrencyMapStore extends TemplateMapStore<Currency> {
|
||||
|
||||
public CurrencyMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "CURRENCY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_Currency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "COUNTRY_CODE", "CURRENCY_CODE"};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Currency objectReader(ResultSet resultSet) throws SQLException {
|
||||
Currency object = new Currency();
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setCountryCode(resultSet.getObject("COUNTRY_CODE", String.class));
|
||||
object.setCurrencyCode(resultSet.getObject("CURRENCY_CODE", String.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] objectToField(Currency currency) {
|
||||
Object[] args = new Object[]{
|
||||
currency.getId(),
|
||||
currency.getCountryCode(),
|
||||
currency.getCurrencyCode()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -17,6 +17,8 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_Relation = "Map_Relation";
|
||||
public static final String Map_ClearingAccount = "Map_ClearingAccount";
|
||||
public static final String Map_ClearingAccountHistory = "Map_ClearingAccountHistory";
|
||||
public static final String Map_Listing = "Map_Listing";
|
||||
public static final String Map_Market = "Map_Market";
|
||||
public static final String Map_BankAccount = "Map_BankAccount";
|
||||
public static final String Map_BankAccountHistory = "Map_BankAccountHistory";
|
||||
public static final String Map_ClearingMemberCategory = "Map_ClearingMemberCategory";
|
||||
|
|
@ -100,6 +102,7 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_AccountStatusDictionary = "Map_AccountStatusDictionary";
|
||||
public static final String Map_KeyRate = "Map_KeyRate";
|
||||
public static final String Map_MoneyMarketSecurity = "Map_MoneyMarketSecurity";
|
||||
public static final String Map_Currency = "Map_Currency";
|
||||
public static final String Map_RequestInfo = "Map_RequestInfo";
|
||||
public static final String MAP_SEQUENCE_NAME = "MAP_SEQUENCE_NAME"; // todo вынести idGenerator отдельно и завернуть в метод, чтобы не напрямую обращаться.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue