http://jira.mfd.msk:8088/browse/CLS-252 DDL этап 1
This commit is contained in:
parent
611801e965
commit
3ed83781f2
44 changed files with 5413 additions and 4065 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -30,38 +30,41 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="type" mode="types">
|
||||
-- <xsl:value-of select="@id"/>. <xsl:value-of select="name()"/> : <xsl:value-of select="@type"/> - <xsl:value-of select="@name"/>
|
||||
<xsl:variable name="dbNameComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
-- <xsl:value-of select="@id"/>. <xsl:value-of select="name()"/> : <xsl:value-of select="@type"/> - <xsl:value-of select="$dbNameComment"/>
|
||||
<xsl:if test="position() != last()">,</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="enums">
|
||||
-- <xsl:value-of select="name()"/> - <xsl:value-of select="@name"/>
|
||||
<xsl:variable name="dbNameComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
-- <xsl:value-of select="name()"/> - <xsl:value-of select="$dbNameComment"/>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='concat(name(),"Dictionary")'/></xsl:call-template></xsl:variable>
|
||||
DROP TABLE IF EXISTS <xsl:value-of select="$dbTableName"/>;
|
||||
CREATE TABLE <xsl:value-of select="$dbTableName"/>(<xsl:apply-templates select="*" mode="field"/>);
|
||||
COMMENT ON TABLE <xsl:value-of select="$dbTableName"/> IS '<xsl:value-of select="@name"/>';
|
||||
COMMENT ON TABLE <xsl:value-of select="$dbTableName"/> IS '<xsl:value-of select="$dbNameComment"/>';
|
||||
<xsl:apply-templates select="*" mode="comment-enums"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="objects">
|
||||
-- <xsl:value-of select="name()"/> - <xsl:value-of select="@name"/>
|
||||
<xsl:variable name="dbNameTComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
-- <xsl:value-of select="name()"/> - <xsl:value-of select="$dbNameTComment"/>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:variable>
|
||||
DROP TABLE IF EXISTS <xsl:value-of select="$dbTableName"/>;
|
||||
CREATE TABLE <xsl:value-of select="$dbTableName"/>(<xsl:apply-templates select="*[@name or @type]" mode="field"/>);
|
||||
COMMENT ON TABLE <xsl:value-of select="$dbTableName"/> IS '<xsl:value-of select="@name"/>';
|
||||
<xsl:apply-templates select="*[@name or @type]" mode="comment-objects"/>
|
||||
CREATE TABLE <xsl:value-of select="$dbTableName"/>(<xsl:apply-templates select="*[@name or @dbname or @type]" mode="field"/>);
|
||||
COMMENT ON TABLE <xsl:value-of select="$dbTableName"/> IS '<xsl:value-of select="$dbNameTComment"/>';
|
||||
<xsl:apply-templates select="*[@name or @dbname or @type]" mode="comment-objects"/>
|
||||
<xsl:if test="@logUpdates">
|
||||
|
||||
-- History log of <xsl:value-of select="name()"/> - <xsl:value-of select="@name"/>
|
||||
-- History log of <xsl:value-of select="name()"/> - <xsl:value-of select="$dbNameTComment"/>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template></xsl:variable>
|
||||
DROP TABLE IF EXISTS <xsl:value-of select="$dbTableName"/>_HISTORY;
|
||||
CREATE TABLE <xsl:value-of select="$dbTableName"/>_HISTORY(<xsl:value-of select="$dbTableName"/>_ID BIGINT NOT NULL, EVENT_TIME timestamp, EVENT_USER_ID BIGINT, EVENT_TYPE VARCHAR(4), <xsl:apply-templates select="*[@name or @type]" mode="field"/>);
|
||||
CREATE TABLE <xsl:value-of select="$dbTableName"/>_HISTORY(<xsl:value-of select="$dbTableName"/>_ID BIGINT NOT NULL, EVENT_TIME timestamp, EVENT_USER_ID BIGINT, EVENT_TYPE VARCHAR(4), <xsl:apply-templates select="*[@name or @dbname or @type]" mode="field"/>);
|
||||
COMMENT ON TABLE <xsl:value-of select="$dbTableName"/>_HISTORY IS 'История изменений таблицы <xsl:value-of select="name()"/>';
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.<xsl:value-of select="$dbTableName"/>_ID IS 'Идентификатор записи в таблице <xsl:value-of select="$dbTableName"/>';
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.EVENT_TIME IS 'Дата и время изменения';
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.EVENT_USER_ID IS 'Инициатор изменения';
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.EVENT_TYPE IS 'Тип изменения';
|
||||
<xsl:apply-templates select="*[@name or @type]" mode="comment-history-objects"/>
|
||||
<xsl:apply-templates select="*[@name or @dbname or @type]" mode="comment-history-objects"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
|
@ -86,7 +89,8 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.EVENT_TYPE IS '
|
|||
|
||||
<xsl:template match="*" mode="comment-enums">
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='concat(name(parent::*),"Dictionary")'/></xsl:call-template></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="@name"><xsl:value-of select="@name"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
<xsl:variable name="dbNameComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="$dbNameComment"><xsl:value-of select="$dbNameComment"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
|
@ -96,7 +100,8 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name=
|
|||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name(parent::*)'/></xsl:call-template></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="@name"><xsl:value-of select="@name"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
<xsl:variable name="dbNameComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="$dbNameComment"><xsl:value-of select="$dbNameComment"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
</xsl:otherwise></xsl:choose></xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="comment-history-objects"><!-- todo похож на comment-objects только именем таблицы различается попробовать объединить -->
|
||||
|
|
@ -105,7 +110,8 @@ COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>.<xsl:call-template name=
|
|||
<xsl:when test="@extends"></xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="dbTableName"><xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name(parent::*)'/></xsl:call-template></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="@name"><xsl:value-of select="@name"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
<xsl:variable name="dbNameComment"><xsl:choose><xsl:when test="@dbname"><xsl:value-of select="@dbname"/></xsl:when><xsl:otherwise><xsl:value-of select="@name"/></xsl:otherwise></xsl:choose></xsl:variable>
|
||||
COMMENT ON COLUMN <xsl:value-of select="$dbTableName"/>_HISTORY.<xsl:call-template name='convertDbStyle'><xsl:with-param name='toconvert' select='name()'/></xsl:call-template> IS '<xsl:if test="$dbNameComment"><xsl:value-of select="$dbNameComment"/></xsl:if> <xsl:if test="@link"> (linked to <xsl:value-of select="@link"/>)</xsl:if>';
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class CompanyRoleSetControllerTest extends AbstractControllerTest {
|
|||
//ARRANGE
|
||||
CompanyRoleSet existBankAccount = new CompanyRoleSet();
|
||||
existBankAccount.setCompanyId(11L);
|
||||
existBankAccount.setRoleId(12L);
|
||||
existBankAccount.setCompanyRole("CLRM");
|
||||
existBankAccount.setId(currentId.get());
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class MarketControllerTest extends AbstractControllerTest {
|
|||
liabilitiesClaimsAssets.setName("name");
|
||||
liabilitiesClaimsAssets.setCode("man");
|
||||
liabilitiesClaimsAssets.setSettlementCurrency("res");
|
||||
liabilitiesClaimsAssets.setSector("sec");
|
||||
liabilitiesClaimsAssets.setSection("sec");
|
||||
|
||||
//ACT and ASSERT
|
||||
checkGettingAllFromRestApi(IMDGDistributedNames.Map_Market, liabilitiesClaimsAssets, REST_URL);
|
||||
|
|
|
|||
|
|
@ -10,23 +10,32 @@ public class CompanyRoleSet extends SpcexObjectBase {
|
|||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Long companyId;
|
||||
private Long roleId;
|
||||
private String companyRole;
|
||||
private String workflowStatus;
|
||||
|
||||
|
||||
public Long getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Long companyId) {
|
||||
this.companyId = companyId;
|
||||
public void setCompanyId(Long value) {
|
||||
this.companyId = value;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
public String getCompanyRole() {
|
||||
return companyRole;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
public void setCompanyRole(String value) {
|
||||
this.companyRole = value;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
||||
public void setWorkflowStatus(String value) {
|
||||
this.workflowStatus = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package ru.clearing.classes.statics.data.instrument.issue;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.spcex.platform.classes.base.SpcexObjectBase;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Купонное расписание
|
||||
*
|
||||
* DB table: COUPON_PERIOD
|
||||
**/
|
||||
public class CouponPeriod extends SpcexObjectBase {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Long securityId;
|
||||
private BigDecimal couponRate;
|
||||
private Long number;
|
||||
private LocalDate periodEndDate;
|
||||
private LocalDate periodStartDate;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
}
|
||||
public void setSecurityId(Long value) {
|
||||
this.securityId=value;
|
||||
}
|
||||
|
||||
public BigDecimal getCouponRate() {
|
||||
return couponRate;
|
||||
}
|
||||
public void setCouponRate(BigDecimal value) {
|
||||
this.couponRate=value;
|
||||
}
|
||||
|
||||
public Long getNumber() {
|
||||
return number;
|
||||
}
|
||||
public void setNumber(Long value) {
|
||||
this.number=value;
|
||||
}
|
||||
|
||||
public LocalDate getPeriodEndDate() {
|
||||
return periodEndDate;
|
||||
}
|
||||
public void setPeriodEndDate(LocalDate value) {
|
||||
this.periodEndDate=value;
|
||||
}
|
||||
|
||||
public LocalDate getPeriodStartDate() {
|
||||
return periodStartDate;
|
||||
}
|
||||
public void setPeriodStartDate(LocalDate value) {
|
||||
this.periodStartDate=value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package ru.clearing.classes.statics.data.instrument.issue;
|
||||
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.statics.data.security.Security;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Equity
|
||||
* Акции
|
||||
*
|
||||
* DB table: EQUITY_SECURITY
|
||||
**/
|
||||
public class EquitySecurity extends Security {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Long securityId;
|
||||
private String shareType;
|
||||
private BigDecimal lotSize;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
}
|
||||
public void setSecurityId(Long value) {
|
||||
this.securityId=value;
|
||||
}
|
||||
|
||||
public String getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
public void setShareType(String value) {
|
||||
this.shareType=value;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
public void setLotSize(BigDecimal value) {
|
||||
this.lotSize=value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package ru.clearing.classes.statics.data.instrument.issue;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.spcex.platform.classes.base.SpcexObjectBase;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Выплаты по купонам
|
||||
* <p>
|
||||
* DB table: FIXED_INCOME_CASH_FLOW
|
||||
**/
|
||||
public class FixedIncomeCashFlow extends SpcexObjectBase {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Long securityId;
|
||||
private BigDecimal accruedCoupon;
|
||||
private BigDecimal nominalValue;
|
||||
private Long number;
|
||||
private LocalDate valueDate;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
}
|
||||
|
||||
public void setSecurityId(Long value) {
|
||||
this.securityId = value;
|
||||
}
|
||||
|
||||
public BigDecimal getAccruedCoupon() {
|
||||
return accruedCoupon;
|
||||
}
|
||||
|
||||
public void setAccruedCoupon(BigDecimal value) {
|
||||
this.accruedCoupon = value;
|
||||
}
|
||||
|
||||
public BigDecimal getNominalValue() {
|
||||
return nominalValue;
|
||||
}
|
||||
|
||||
public void setNominalValue(BigDecimal value) {
|
||||
this.nominalValue = value;
|
||||
}
|
||||
|
||||
public Long getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Long value) {
|
||||
this.number = value;
|
||||
}
|
||||
|
||||
public LocalDate getValueDate() {
|
||||
return valueDate;
|
||||
}
|
||||
|
||||
public void setValueDate(LocalDate value) {
|
||||
this.valueDate = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package ru.clearing.classes.statics.data.instrument.issue;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.statics.data.security.Security;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* FixedIncome
|
||||
* Облигации
|
||||
*
|
||||
* DB table: FIXED_INCOME_SECURITY
|
||||
**/
|
||||
public class FixedIncomeSecurity extends Security {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Long securityId;
|
||||
private String bondType;
|
||||
private LocalDate maturityDate;
|
||||
private BigDecimal nominalValue;
|
||||
private String nominalCurrency;
|
||||
private BigDecimal coupon;
|
||||
private Long couponFrequency;
|
||||
private BigDecimal lotSize;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
}
|
||||
public void setSecurityId(Long value) {
|
||||
this.securityId=value;
|
||||
}
|
||||
|
||||
public String getBondType() {
|
||||
return bondType;
|
||||
}
|
||||
public void setBondType(String value) {
|
||||
this.bondType=value;
|
||||
}
|
||||
|
||||
public LocalDate getMaturityDate() {
|
||||
return maturityDate;
|
||||
}
|
||||
public void setMaturityDate(LocalDate value) {
|
||||
this.maturityDate=value;
|
||||
}
|
||||
|
||||
public BigDecimal getNominalValue() {
|
||||
return nominalValue;
|
||||
}
|
||||
public void setNominalValue(BigDecimal value) {
|
||||
this.nominalValue=value;
|
||||
}
|
||||
|
||||
public String getNominalCurrency() {
|
||||
return nominalCurrency;
|
||||
}
|
||||
public void setNominalCurrency(String value) {
|
||||
this.nominalCurrency=value;
|
||||
}
|
||||
|
||||
public BigDecimal getCoupon() {
|
||||
return coupon;
|
||||
}
|
||||
public void setCoupon(BigDecimal value) {
|
||||
this.coupon=value;
|
||||
}
|
||||
|
||||
public Long getCouponFrequency() {
|
||||
return couponFrequency;
|
||||
}
|
||||
public void setCouponFrequency(Long value) {
|
||||
this.couponFrequency=value;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
public void setLotSize(BigDecimal value) {
|
||||
this.lotSize=value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,17 +13,17 @@ import java.time.LocalDate;
|
|||
public class ErrorText extends BusinessObject {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private String errorCode;
|
||||
private Long errorCodeId;
|
||||
private String text;
|
||||
private Long userId;
|
||||
private LocalDate clearingDate;
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
public Long getErrorCodeId() {
|
||||
return errorCodeId;
|
||||
}
|
||||
|
||||
public void setErrorCode(String value) {
|
||||
this.errorCode = value;
|
||||
public void setErrorCodeId(Long errorCodeId) {
|
||||
this.errorCodeId = errorCodeId;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessEvent;
|
||||
import java.io.Serial;
|
||||
/**
|
||||
* Изменение состояния объекта Валюты
|
||||
*
|
||||
* DB table: CURRENCY_HISTORY
|
||||
**/
|
||||
public class CurrencyHistory extends BusinessEvent<Currency> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Currency object;
|
||||
|
||||
@Override
|
||||
public Currency getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(Currency object) {
|
||||
this.object = object;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessEvent;
|
||||
import java.io.Serial;
|
||||
/**
|
||||
* Изменение состояния объекта Листинг инструментов
|
||||
*
|
||||
* DB table: LISTING_HISTORY
|
||||
**/
|
||||
public class ListingHistory extends BusinessEvent<Listing> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Listing object;
|
||||
|
||||
@Override
|
||||
public Listing getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(Listing object) {
|
||||
this.object = object;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ public class Market extends BusinessObject {
|
|||
private String name;
|
||||
private String code;
|
||||
private String settlementCurrency;
|
||||
private String sector;
|
||||
private String section;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
|
|
@ -51,11 +51,11 @@ public class Market extends BusinessObject {
|
|||
this.settlementCurrency = settlementCurrency;
|
||||
}
|
||||
|
||||
public String getSector() {
|
||||
return sector;
|
||||
public String getSection() {
|
||||
return section;
|
||||
}
|
||||
|
||||
public void setSector(String sector) {
|
||||
this.sector = sector;
|
||||
public void setSection(String section) {
|
||||
this.section = section;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessEvent;
|
||||
import java.io.Serial;
|
||||
/**
|
||||
* Изменение состояния объекта Торговые секции
|
||||
*
|
||||
* DB table: MARKET_HISTORY
|
||||
**/
|
||||
public class MarketHistory extends BusinessEvent<Market> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private Market object;
|
||||
|
||||
@Override
|
||||
public Market getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(Market object) {
|
||||
this.object = object;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ public class MoneyMarketSecurity extends Security {
|
|||
private BigDecimal nominalValue;
|
||||
private String nominalCurrency; // (linked to currencyCode)
|
||||
private String termType;
|
||||
private BigDecimal lotSize;
|
||||
|
||||
public Long getSecurityId() {
|
||||
return securityId;
|
||||
|
|
@ -74,4 +75,12 @@ public class MoneyMarketSecurity extends Security {
|
|||
public void setTermType(String termType) {
|
||||
this.termType = termType;
|
||||
}
|
||||
|
||||
public BigDecimal getLotSize() {
|
||||
return lotSize;
|
||||
}
|
||||
|
||||
public void setLotSize(BigDecimal lotSize) {
|
||||
this.lotSize = lotSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package ru.clearing.classes.statics.data.misc;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessEvent;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* DB table: MONEY_MARKET_SECURITY_HISTORY
|
||||
**/
|
||||
public class MoneyMarketSecurityHistory extends BusinessEvent<MoneyMarketSecurity> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private MoneyMarketSecurity object;
|
||||
|
||||
@Override
|
||||
public MoneyMarketSecurity getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(MoneyMarketSecurity object) {
|
||||
this.object = object;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,6 @@ package ru.clearing.classes.statics.data.security;
|
|||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessObject;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Инструменты
|
||||
* <p>
|
||||
|
|
@ -20,6 +18,7 @@ public class Security extends BusinessObject {
|
|||
private String shortNameEng;
|
||||
private String fullNameEng;
|
||||
private String securitySymbol;
|
||||
private String isin;
|
||||
private String workflowStatus;
|
||||
|
||||
public String getInstrumentType() {
|
||||
|
|
@ -78,6 +77,14 @@ public class Security extends BusinessObject {
|
|||
this.securitySymbol = value;
|
||||
}
|
||||
|
||||
public String getIsin() {
|
||||
return isin;
|
||||
}
|
||||
|
||||
public void setIsin(String value) {
|
||||
this.isin = value;
|
||||
}
|
||||
|
||||
public String getWorkflowStatus() {
|
||||
return workflowStatus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ public class UserConnect extends BusinessObject {
|
|||
private String clientIp;
|
||||
private String connectionState;
|
||||
private LocalDate clearingDate;
|
||||
private Long errorCode;
|
||||
private String errorText;
|
||||
private Long errorCodeId;
|
||||
private Long errorTextId;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
|
|
@ -80,20 +80,20 @@ public class UserConnect extends BusinessObject {
|
|||
this.clearingDate = value;
|
||||
}
|
||||
|
||||
public Long getErrorCode() {
|
||||
return errorCode;
|
||||
public Long getErrorCodeId() {
|
||||
return errorCodeId;
|
||||
}
|
||||
|
||||
public void setErrorCode(Long value) {
|
||||
this.errorCode = value;
|
||||
public void setErrorCodeId(Long errorCodeId) {
|
||||
this.errorCodeId = errorCodeId;
|
||||
}
|
||||
|
||||
public String getErrorText() {
|
||||
return errorText;
|
||||
public Long getErrorTextId() {
|
||||
return errorTextId;
|
||||
}
|
||||
|
||||
public void setErrorText(String value) {
|
||||
this.errorText = value;
|
||||
public void setErrorTextId(Long errorTextId) {
|
||||
this.errorTextId = errorTextId;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,11 @@
|
|||
package ru.clearing.platform.dictionary;
|
||||
|
||||
/**
|
||||
* Справочник типов облигаций
|
||||
*
|
||||
* Dictionary DB table: BOND_TYPE_DICTIONARY
|
||||
**/
|
||||
public class BondTypeDictionary extends AbstractDictionary {
|
||||
private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package ru.clearing.platform.dictionary;
|
||||
|
||||
|
||||
/**
|
||||
* Справочник секций
|
||||
*
|
||||
* Dictionary DB table: SECTION_DICTIONARY
|
||||
**/
|
||||
public class SectionDictionary extends AbstractDictionary {
|
||||
private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package ru.clearing.platform.dictionary;
|
||||
|
||||
|
||||
/**
|
||||
* Dictionary DB table: SHARE_TYPE_DICTIONARY
|
||||
**/
|
||||
public class ShareTypeDictionary extends AbstractDictionary {
|
||||
private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID;
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package ru.spcex.clearing.imdg.businessevent;
|
||||
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.clearing.classes.statics.data.misc.Currency;
|
||||
import ru.clearing.classes.statics.data.misc.CurrencyHistory;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
|
||||
@Component
|
||||
public class CurrencyHistoryMapStore extends TemplateEventMapStore<CurrencyHistory> {
|
||||
|
||||
public CurrencyHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_CurrencyHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "CURRENCY_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID","EVENT_TIME", "EVENT_USER_ID", "EVENT_TYPE",
|
||||
"CURRENCY_ID", "COUNTRY_CODE", "CURRENCY_CODE"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(CurrencyHistory historyLog) {
|
||||
Currency object=historyLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
historyLog.getId(),
|
||||
historyLog.getEventTime(),
|
||||
historyLog.getUserId(),
|
||||
historyLog.getEventType(),
|
||||
|
||||
object.getId(),
|
||||
object.getCountryCode(),
|
||||
object.getCurrencyCode(),
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package ru.spcex.clearing.imdg.businessevent;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.clearing.classes.statics.data.misc.Listing;
|
||||
import ru.clearing.classes.statics.data.misc.ListingHistory;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
@Component
|
||||
public class ListingHistoryMapStore extends TemplateEventMapStore<ListingHistory> {
|
||||
|
||||
public ListingHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_ListingHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "LISTING_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID","EVENT_TIME", "EVENT_USER_ID", "EVENT_TYPE",
|
||||
"LISTING_ID", "CREATED_AT", "UPDATED_AT", "SECURITY_ID", "LOT_SIZE", "MARKET", "SYMBOL_CODE", "SYMBOL_NAME", "TRADING_CURRENCY", "WORKFLOW_STATUS"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(ListingHistory historyLog) {
|
||||
Listing object=historyLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
historyLog.getId(),
|
||||
historyLog.getEventTime(),
|
||||
historyLog.getUserId(),
|
||||
historyLog.getEventType(),
|
||||
|
||||
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,56 @@
|
|||
package ru.spcex.clearing.imdg.businessevent;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.clearing.classes.statics.data.misc.Market;
|
||||
import ru.clearing.classes.statics.data.misc.MarketHistory;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
@Component
|
||||
public class MarketHistoryMapStore extends TemplateEventMapStore<MarketHistory> {
|
||||
|
||||
public MarketHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_MarketHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "MARKET_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_USER_ID", "EVENT_TYPE",
|
||||
"MARKET_ID", "CREATED_AT", "UPDATED_AT", "DESCRIPTION", "EXCHANGE_ID", "NAME", "CODE", "SETTLEMENT_CURRENCY", "SECTION",
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(MarketHistory historyLog) {
|
||||
Market object = historyLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
historyLog.getId(),
|
||||
historyLog.getEventTime(),
|
||||
historyLog.getUserId(),
|
||||
historyLog.getEventType(),
|
||||
|
||||
object.getId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getDescription(),
|
||||
object.getExchangeId(),
|
||||
object.getName(),
|
||||
object.getCode(),
|
||||
object.getSettlementCurrency(),
|
||||
object.getSection(),
|
||||
};
|
||||
return args;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package ru.spcex.clearing.imdg.businessevent;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.clearing.classes.statics.data.misc.MoneyMarketSecurity;
|
||||
import ru.clearing.classes.statics.data.misc.MoneyMarketSecurityHistory;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class MoneyMarketSecurityHistoryMapStore extends TemplateEventMapStore<MoneyMarketSecurityHistory> {
|
||||
|
||||
public MoneyMarketSecurityHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_MoneyMarketSecurityHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "MONEY_MARKET_SECURITY_HISTORY";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "EVENT_TIME", "EVENT_USER_ID", "EVENT_TYPE",
|
||||
"MONEY_MARKET_SECURITY_ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY", "TERM_TYPE", "LOT_SIZE"};
|
||||
}
|
||||
|
||||
public String[] getFieldsSecurity() {
|
||||
return new String[]{
|
||||
"ID", "EVENT_TIME", "EVENT_USER_ID", "EVENT_TYPE",
|
||||
"SECURITY_ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"};
|
||||
}
|
||||
|
||||
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
|
||||
getFieldsSecurity(), "id");
|
||||
|
||||
|
||||
@Override
|
||||
protected Object[] objectToField(MoneyMarketSecurityHistory historyLog) {
|
||||
MoneyMarketSecurity moneyMarketSecurity = historyLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
historyLog.getId(),
|
||||
historyLog.getEventTime(),
|
||||
historyLog.getUserId(),
|
||||
historyLog.getEventType(),
|
||||
|
||||
moneyMarketSecurity.getId(),
|
||||
moneyMarketSecurity.getSecurityId(),
|
||||
moneyMarketSecurity.getDescription(),
|
||||
TimeUtil.toDateFromLocalDate(moneyMarketSecurity.getStartDate()),
|
||||
TimeUtil.toDateFromLocalDate(moneyMarketSecurity.getEndDate()),
|
||||
moneyMarketSecurity.getNominalValue(),
|
||||
moneyMarketSecurity.getNominalCurrency(),
|
||||
moneyMarketSecurity.getTermType(),
|
||||
moneyMarketSecurity.getLotSize()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
protected Object[] securityField(MoneyMarketSecurityHistory historyLog) {
|
||||
MoneyMarketSecurity object = historyLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
historyLog.getId(),
|
||||
historyLog.getEventTime(),
|
||||
historyLog.getUserId(),
|
||||
historyLog.getEventType(),
|
||||
|
||||
object.getSecurityId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getInstrumentType(),
|
||||
object.getIssuerId(),
|
||||
object.getShortName(),
|
||||
object.getFullName(),
|
||||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void store(Map<Long, MoneyMarketSecurityHistory> map) {
|
||||
List<Object[]> moneyMarketArgs = new ArrayList<>();
|
||||
List<Object[]> securityArgs = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<Long, MoneyMarketSecurityHistory> entry : map.entrySet()) {
|
||||
MoneyMarketSecurityHistory obj = entry.getValue();
|
||||
Object[] args = objectToField(obj);
|
||||
if (args.length != validateSize) {
|
||||
throw new IllegalArgumentException("objectToField return " + args.length + " arguments, but expected " + validateSize);
|
||||
}
|
||||
moneyMarketArgs.add(args);
|
||||
securityArgs.add(securityField(obj));
|
||||
}
|
||||
batchInsertUpdate(insertStatement, moneyMarketArgs);
|
||||
batchInsertUpdate(insertToSecurityStatement, securityArgs);
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ public class SecurityHistoryMapStore extends TemplateEventMapStore<SecurityHisto
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_TYPE", "EVENT_USER_ID",
|
||||
"SECURITY_ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "WORKFLOW_STATUS"
|
||||
"SECURITY_ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -51,6 +51,7 @@ public class SecurityHistoryMapStore extends TemplateEventMapStore<SecurityHisto
|
|||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class UserConnectHistoryMapStore extends TemplateEventMapStore<UserConnec
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_TYPE", "EVENT_USER_ID",
|
||||
"USER_CONNECT_ID", "CREATED_AT", "UPDATED_AT", "USER_ID", "CONNECTION_TIME", "DISCONNECTION_TIME", "SERVER_IP", "CLIENT_IP", "CONNECTION_STATE", "CLEARING_DATE", "ERROR_CODE", "ERROR_TEXT"
|
||||
"USER_CONNECT_ID", "CREATED_AT", "UPDATED_AT", "USER_ID", "CONNECTION_TIME", "DISCONNECTION_TIME", "SERVER_IP", "CLIENT_IP", "CONNECTION_STATE", "CLEARING_DATE", "ERROR_CODE_ID", "ERROR_TEXT_ID"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ public class UserConnectHistoryMapStore extends TemplateEventMapStore<UserConnec
|
|||
object.getClientIp(),
|
||||
object.getConnectionState(),
|
||||
TimeUtil.toDateFromLocalDate(object.getClearingDate()),
|
||||
object.getErrorCode(),
|
||||
object.getErrorText()
|
||||
object.getErrorCodeId(),
|
||||
object.getErrorTextId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
package ru.spcex.clearing.imdg.businessobject;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.EquitySecurity;
|
||||
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;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class EquitySecurityMapStore extends TemplateMapStore<EquitySecurity> {
|
||||
|
||||
public EquitySecurityMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_EquitySecurity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "EQUITY_SECURITY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "SECURITY_ID", "SHARE_TYPE"
|
||||
};
|
||||
}
|
||||
|
||||
public String[] getFieldsSecurity() {
|
||||
return new String[]{"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"};
|
||||
}
|
||||
|
||||
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
|
||||
getFieldsSecurity(), "id");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected EquitySecurity objectReader(ResultSet resultSet) throws SQLException {
|
||||
EquitySecurity object = new EquitySecurity();
|
||||
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setSecurityId(resultSet.getObject("SECURITY_ID", Long.class));
|
||||
object.setShareType(resultSet.getObject("SHARE_TYPE", String.class));
|
||||
fillBySecurity(object, object.getSecurityId());
|
||||
return object;
|
||||
}
|
||||
|
||||
private void fillBySecurity(EquitySecurity object, Long securityId) {
|
||||
List<EquitySecurity> resouts = jdbcTemplate.query(
|
||||
"SELECT * FROM SECURITY WHERE id = ?", new Object[]{securityId},
|
||||
(rs, rowNum) -> {
|
||||
object.setCreated(getInstantFromTimestamp(rs, "CREATED_AT"));
|
||||
object.setUpdated(getInstantFromTimestamp(rs, "UPDATED_AT"));
|
||||
object.setInstrumentType(rs.getObject("INSTRUMENT_TYPE", String.class));
|
||||
object.setIssuerId(rs.getObject("issuer_id", Long.class));
|
||||
object.setShortName(rs.getObject("short_name", String.class));
|
||||
object.setFullName(rs.getObject("FULL_NAME", String.class));
|
||||
object.setShortNameEng(rs.getObject("short_name_eng", String.class));
|
||||
object.setFullNameEng(rs.getObject("full_name_eng", String.class));
|
||||
object.setSecuritySymbol(rs.getObject("SECURITY_SYMBOL", String.class));
|
||||
object.setIsin(rs.getObject("ISIN", String.class));
|
||||
object.setWorkflowStatus(rs.getObject("workflow_status", String.class));
|
||||
return object;
|
||||
}
|
||||
);
|
||||
if (resouts.size() != 1) {
|
||||
log.warn("Result size={} not expected for table MONEY_MARKET_SECURITY where id={}", resouts.size(), securityId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] objectToField(EquitySecurity equity) {
|
||||
Object[] args = new Object[]{
|
||||
equity.getId(),
|
||||
equity.getSecurityId(),
|
||||
equity.getShareType()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
protected Object[] securityField(EquitySecurity object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getSecurityId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getInstrumentType(),
|
||||
object.getIssuerId(),
|
||||
object.getShortName(),
|
||||
object.getFullName(),
|
||||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void store(Map<Long, EquitySecurity> map) {
|
||||
List<Object[]> moneyMarketArgs = new ArrayList<>();
|
||||
List<Object[]> securityArgs = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<Long, EquitySecurity> entry : map.entrySet()) {
|
||||
EquitySecurity obj = entry.getValue();
|
||||
Object[] args = objectToField(obj);
|
||||
if (args.length != validateSize) {
|
||||
throw new IllegalArgumentException("objectToField return " + args.length + " arguments, but expected " + validateSize);
|
||||
}
|
||||
moneyMarketArgs.add(args);
|
||||
securityArgs.add(securityField(obj));
|
||||
}
|
||||
batchInsertUpdate(insertStatement, moneyMarketArgs);
|
||||
batchInsertUpdate(insertToSecurityStatement, securityArgs);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ public class ErrorTextMapStore extends TemplateMapStore<ErrorText> {
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "ERROR_CODE", "TEXT", "USER_ID", "CLEARING_DATE"
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "ERROR_CODE_ID", "TEXT", "USER_ID", "CLEARING_DATE"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class ErrorTextMapStore extends TemplateMapStore<ErrorText> {
|
|||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setCreated(getInstantFromTimestamp(resultSet, "CREATED_AT"));
|
||||
object.setUpdated(getInstantFromTimestamp(resultSet, "UPDATED_AT"));
|
||||
object.setErrorCode(resultSet.getObject("ERROR_CODE", String.class));
|
||||
object.setErrorCodeId(resultSet.getObject("ERROR_CODE_ID", Long.class));
|
||||
object.setText(resultSet.getObject("TEXT", String.class));
|
||||
object.setUserId(resultSet.getObject("USER_ID", Long.class));
|
||||
object.setClearingDate(getLocalDateFromSqlDate(resultSet, "CLEARING_DATE"));
|
||||
|
|
@ -53,7 +53,7 @@ public class ErrorTextMapStore extends TemplateMapStore<ErrorText> {
|
|||
object.getId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getErrorCode(),
|
||||
object.getErrorCodeId(),
|
||||
object.getText(),
|
||||
object.getUserId(),
|
||||
TimeUtil.toDateFromLocalDate(object.getClearingDate())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
package ru.spcex.clearing.imdg.businessobject;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeSecurity;
|
||||
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;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class FixedIncomeSecurityMapStore extends TemplateMapStore<FixedIncomeSecurity> {
|
||||
|
||||
public FixedIncomeSecurityMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_FixedIncomeSecurity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "FIXED_INCOME_SECURITY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "SECURITY_ID", "BOND_TYPE", "MATURITY_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY", "COUPON", "COUPON_FREQUENCY"
|
||||
};
|
||||
}
|
||||
|
||||
public String[] getFieldsSecurity() {
|
||||
return new String[]{"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"};
|
||||
}
|
||||
|
||||
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
|
||||
getFieldsSecurity(), "id");
|
||||
|
||||
|
||||
@Override
|
||||
protected FixedIncomeSecurity objectReader(ResultSet resultSet) throws SQLException {
|
||||
FixedIncomeSecurity object = new FixedIncomeSecurity();
|
||||
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setSecurityId(resultSet.getObject("SECURITY_ID", Long.class));
|
||||
object.setBondType(resultSet.getObject("BOND_TYPE", String.class));
|
||||
object.setMaturityDate(getLocalDateFromSqlDate(resultSet, "MATURITY_DATE"));
|
||||
object.setNominalValue(resultSet.getObject("NOMINAL_VALUE", BigDecimal.class));
|
||||
object.setNominalCurrency(resultSet.getObject("NOMINAL_CURRENCY", String.class));
|
||||
object.setCoupon(resultSet.getObject("COUPON", BigDecimal.class));
|
||||
object.setCouponFrequency(resultSet.getObject("COUPON_FREQUENCY", Long.class));
|
||||
|
||||
fillBySecurity(object, object.getSecurityId());
|
||||
return object;
|
||||
}
|
||||
|
||||
private void fillBySecurity(FixedIncomeSecurity object, Long securityId) {
|
||||
List<FixedIncomeSecurity> resouts = jdbcTemplate.query(
|
||||
"SELECT * FROM SECURITY WHERE id = ?", new Object[]{securityId},
|
||||
(rs, rowNum) -> {
|
||||
object.setCreated(getInstantFromTimestamp(rs, "CREATED_AT"));
|
||||
object.setUpdated(getInstantFromTimestamp(rs, "UPDATED_AT"));
|
||||
object.setInstrumentType(rs.getObject("INSTRUMENT_TYPE", String.class));
|
||||
object.setIssuerId(rs.getObject("issuer_id", Long.class));
|
||||
object.setShortName(rs.getObject("short_name", String.class));
|
||||
object.setFullName(rs.getObject("FULL_NAME", String.class));
|
||||
object.setShortNameEng(rs.getObject("short_name_eng", String.class));
|
||||
object.setFullNameEng(rs.getObject("full_name_eng", String.class));
|
||||
object.setSecuritySymbol(rs.getObject("SECURITY_SYMBOL", String.class));
|
||||
object.setIsin(rs.getObject("ISIN", String.class));
|
||||
object.setWorkflowStatus(rs.getObject("workflow_status", String.class));
|
||||
return object;
|
||||
}
|
||||
);
|
||||
if (resouts.size() != 1) {
|
||||
log.warn("Result size={} not expected for table MONEY_MARKET_SECURITY where id={}", resouts.size(), securityId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] objectToField(FixedIncomeSecurity equity) {
|
||||
Object[] args = new Object[]{
|
||||
equity.getId(),
|
||||
equity.getSecurityId(),
|
||||
equity.getBondType(),
|
||||
TimeUtil.toDateFromLocalDate(equity.getMaturityDate()),
|
||||
equity.getNominalValue(),
|
||||
equity.getNominalCurrency(),
|
||||
equity.getCoupon(),
|
||||
equity.getCouponFrequency()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
protected Object[] securityField(FixedIncomeSecurity object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getSecurityId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getInstrumentType(),
|
||||
object.getIssuerId(),
|
||||
object.getShortName(),
|
||||
object.getFullName(),
|
||||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void store(Map<Long, FixedIncomeSecurity> map) {
|
||||
List<Object[]> moneyMarketArgs = new ArrayList<>();
|
||||
List<Object[]> securityArgs = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<Long, FixedIncomeSecurity> entry : map.entrySet()) {
|
||||
FixedIncomeSecurity obj = entry.getValue();
|
||||
Object[] args = objectToField(obj);
|
||||
if (args.length != validateSize) {
|
||||
throw new IllegalArgumentException("objectToField return " + args.length + " arguments, but expected " + validateSize);
|
||||
}
|
||||
moneyMarketArgs.add(args);
|
||||
securityArgs.add(securityField(obj));
|
||||
}
|
||||
batchInsertUpdate(insertStatement, moneyMarketArgs);
|
||||
batchInsertUpdate(insertToSecurityStatement, securityArgs);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public class MarketMapStore extends TemplateMapStore<Market> {
|
|||
"name",
|
||||
"code",
|
||||
"settlement_currency",
|
||||
"sector"
|
||||
"section"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ public class MarketMapStore extends TemplateMapStore<Market> {
|
|||
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));
|
||||
object.setSection(resultSet.getObject("SECTION", String.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public class MarketMapStore extends TemplateMapStore<Market> {
|
|||
object.getName(),
|
||||
object.getCode(),
|
||||
object.getSettlementCurrency(),
|
||||
object.getSector()
|
||||
object.getSection()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class SecurityMapStore extends TemplateMapStore<Security> {
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "WORKFLOW_STATUS"
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -47,6 +47,7 @@ public class SecurityMapStore extends TemplateMapStore<Security> {
|
|||
object.setShortNameEng(resultSet.getObject("SHORT_NAME_ENG", String.class));
|
||||
object.setFullNameEng(resultSet.getObject("FULL_NAME_ENG", String.class));
|
||||
object.setSecuritySymbol(resultSet.getObject("SECURITY_SYMBOL", String.class));
|
||||
object.setIsin(resultSet.getObject("ISIN", String.class));
|
||||
object.setWorkflowStatus(resultSet.getObject("WORKFLOW_STATUS", String.class));
|
||||
return object;
|
||||
}
|
||||
|
|
@ -64,7 +65,8 @@ public class SecurityMapStore extends TemplateMapStore<Security> {
|
|||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getWorkflowStatus()
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus(),
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class UserConnectMapStore extends TemplateMapStore<UserConnect> {
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "USER_ID", "CONNECTION_TIME", "DISCONNECTION_TIME", "SERVER_IP", "CLIENT_IP", "CONNECTION_STATE", "CLEARING_DATE", "ERROR_CODE", "ERROR_TEXT"
|
||||
"ID", "CREATED_AT", "UPDATED_AT", "USER_ID", "CONNECTION_TIME", "DISCONNECTION_TIME", "SERVER_IP", "CLIENT_IP", "CONNECTION_STATE", "CLEARING_DATE", "ERROR_CODE_ID", "ERROR_TEXT_ID"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -47,8 +47,8 @@ public class UserConnectMapStore extends TemplateMapStore<UserConnect> {
|
|||
object.setClientIp(resultSet.getObject("CLIENT_IP", String.class));
|
||||
object.setConnectionState(resultSet.getObject("CONNECTION_STATE", String.class));
|
||||
object.setClearingDate(getLocalDateFromSqlDate(resultSet, "CLEARING_DATE"));
|
||||
object.setErrorCode(resultSet.getObject("ERROR_CODE", Long.class));
|
||||
object.setErrorText(resultSet.getObject("ERROR_TEXT", String.class));
|
||||
object.setErrorCodeId(resultSet.getObject("ERROR_CODE_ID", Long.class));
|
||||
object.setErrorTextId(resultSet.getObject("ERROR_TEXT_ID", Long.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
@ -65,8 +65,8 @@ public class UserConnectMapStore extends TemplateMapStore<UserConnect> {
|
|||
object.getClientIp(),
|
||||
object.getConnectionState(),
|
||||
TimeUtil.toDateFromLocalDate(object.getClearingDate()),
|
||||
object.getErrorCode(),
|
||||
object.getErrorText()
|
||||
object.getErrorCodeId(),
|
||||
object.getErrorTextId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package ru.spcex.clearing.imdg.dictionary;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.platform.dictionary.BondTypeDictionary;
|
||||
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
@Component
|
||||
public class BondTypeDictionaryMapStore extends DictionaryTMapStore<BondTypeDictionary> {
|
||||
|
||||
public BondTypeDictionaryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_BondTypeDictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "BOND_TYPE_DICTIONARY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public BondTypeDictionary getDictionaryObject() {
|
||||
return new BondTypeDictionary();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package ru.spcex.clearing.imdg.dictionary;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.platform.dictionary.SectionDictionary;
|
||||
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
@Component
|
||||
public class SectionDictionaryMapStore extends DictionaryTMapStore<SectionDictionary> {
|
||||
|
||||
public SectionDictionaryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_SectionDictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "SECTION_DICTIONARY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectionDictionary getDictionaryObject() {
|
||||
return new SectionDictionary();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package ru.spcex.clearing.imdg.dictionary;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.platform.dictionary.ShareTypeDictionary;
|
||||
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
@Component
|
||||
public class ShareTypeDictionaryMapStore extends DictionaryTMapStore<ShareTypeDictionary> {
|
||||
|
||||
public ShareTypeDictionaryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_ShareTypeDictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "SHARE_TYPE_DICTIONARY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShareTypeDictionary getDictionaryObject() {
|
||||
return new ShareTypeDictionary();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -28,30 +28,33 @@ public class CompanyRoleSetMapStore extends TemplateMapStore<CompanyRoleSet> {
|
|||
|
||||
@Override
|
||||
public String[] getIndexingField() {
|
||||
return new String[]{};// список индексируемых полей
|
||||
return new String[]{"companyId"};// список индексируемых полей
|
||||
}
|
||||
// IMDGDistributedNames.Map_CompanyRoleSet
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "ROLE_ID", "COMPANY_ID"};
|
||||
return new String[]{
|
||||
"COMPANY_ID", "COMPANY_ROLE", "WORKFLOW_STATUS", "ID"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CompanyRoleSet objectReader(ResultSet resultSet) throws SQLException {
|
||||
CompanyRoleSet companyRoleSet = new CompanyRoleSet();
|
||||
companyRoleSet.setId(resultSet.getObject("ID", Long.class));
|
||||
companyRoleSet.setRoleId(resultSet.getObject("ROLE_ID", Long.class));
|
||||
companyRoleSet.setCompanyId(resultSet.getObject("COMPANY_ID", Long.class));
|
||||
return companyRoleSet;
|
||||
public CompanyRoleSet objectReader(ResultSet resultSet) throws SQLException {
|
||||
CompanyRoleSet object = new CompanyRoleSet();
|
||||
object.setCompanyId(resultSet.getObject("COMPANY_ID", Long.class));
|
||||
object.setCompanyRole(resultSet.getObject("COMPANY_ROLE", String.class));
|
||||
object.setWorkflowStatus(resultSet.getObject("WORKFLOW_STATUS", String.class));
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object[] objectToField(CompanyRoleSet partnerList) {
|
||||
public Object[] objectToField(CompanyRoleSet object) {
|
||||
Object[] args = new Object[]{
|
||||
partnerList.getId(),
|
||||
partnerList.getRoleId(),
|
||||
partnerList.getCompanyId(),
|
||||
object.getCompanyId(),
|
||||
object.getCompanyRole(),
|
||||
object.getWorkflowStatus(),
|
||||
object.getId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package ru.spcex.clearing.imdg.object;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.CouponPeriod;
|
||||
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 CouponPeriodMapStore extends TemplateMapStore<CouponPeriod> {
|
||||
|
||||
public CouponPeriodMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_CouponPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "COUPON_PERIOD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"SECURITY_ID", "COUPON_RATE", "NUMBER", "PERIOD_END_DATE", "PERIOD_START_DATE", "ID"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public CouponPeriod objectReader(ResultSet resultSet) throws SQLException {
|
||||
CouponPeriod object = new CouponPeriod();
|
||||
object.setSecurityId(resultSet.getObject("SECURITY_ID", Long.class));
|
||||
object.setCouponRate(resultSet.getObject("COUPON_RATE", BigDecimal.class));
|
||||
object.setNumber(resultSet.getObject("NUMBER", Long.class));
|
||||
object.setPeriodEndDate(getLocalDateFromSqlDate(resultSet, "PERIOD_END_DATE"));
|
||||
object.setPeriodStartDate(getLocalDateFromSqlDate(resultSet, "PERIOD_START_DATE"));
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(CouponPeriod object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getSecurityId(),
|
||||
object.getCouponRate(),
|
||||
object.getNumber(),
|
||||
TimeUtil.toDateFromLocalDate(object.getPeriodEndDate()),
|
||||
TimeUtil.toDateFromLocalDate(object.getPeriodStartDate()),
|
||||
object.getId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package ru.spcex.clearing.imdg.object;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeCashFlow;
|
||||
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 FixedIncomeCashFlowMapStore extends TemplateMapStore<FixedIncomeCashFlow> {
|
||||
|
||||
public FixedIncomeCashFlowMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_FixedIncomeCashFlow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "FIXED_INCOME_CASH_FLOW";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"SECURITY_ID", "ACCRUED_COUPON", "NOMINAL_VALUE", "NUMBER", "VALUE_DATE", "ID"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public FixedIncomeCashFlow objectReader(ResultSet resultSet) throws SQLException {
|
||||
FixedIncomeCashFlow object = new FixedIncomeCashFlow();
|
||||
object.setSecurityId(resultSet.getObject("SECURITY_ID", Long.class));
|
||||
object.setAccruedCoupon(resultSet.getObject("ACCRUED_COUPON", BigDecimal.class));
|
||||
object.setNominalValue(resultSet.getObject("NOMINAL_VALUE", BigDecimal.class));
|
||||
object.setNumber(resultSet.getObject("NUMBER", Long.class));
|
||||
object.setValueDate(getLocalDateFromSqlDate(resultSet, "VALUE_DATE"));
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(FixedIncomeCashFlow object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getSecurityId(),
|
||||
object.getAccruedCoupon(),
|
||||
object.getNominalValue(),
|
||||
object.getNumber(),
|
||||
TimeUtil.toDateFromLocalDate(object.getValueDate()),
|
||||
object.getId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -41,11 +41,11 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY", "TERM_TYPE"};
|
||||
return new String[]{"ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY", "TERM_TYPE", "LOT_SIZE"};
|
||||
}
|
||||
|
||||
public String[] getFieldsSecurity() {
|
||||
return new String[]{"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "WORKFLOW_STATUS"};
|
||||
return new String[]{"ID", "CREATED_AT", "UPDATED_AT", "INSTRUMENT_TYPE", "ISSUER_ID", "SHORT_NAME", "FULL_NAME", "SHORT_NAME_ENG", "FULL_NAME_ENG", "SECURITY_SYMBOL", "ISIN", "WORKFLOW_STATUS"};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -72,6 +72,7 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
object.setNominalValue(resultSet.getObject("NOMINAL_VALUE", BigDecimal.class));
|
||||
object.setNominalCurrency(resultSet.getObject("NOMINAL_CURRENCY", String.class));
|
||||
object.setTermType(resultSet.getObject("TERM_TYPE", String.class));
|
||||
object.setTermType(resultSet.getObject("LOT_SIZE", String.class));
|
||||
fillBySecurity(object, object.getSecurityId());
|
||||
return object;
|
||||
}
|
||||
|
|
@ -89,6 +90,7 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
object.setShortNameEng(rs.getObject("short_name_eng", String.class));
|
||||
object.setFullNameEng(rs.getObject("full_name_eng", String.class));
|
||||
object.setSecuritySymbol(rs.getObject("SECURITY_SYMBOL", String.class));
|
||||
object.setIsin(rs.getObject("ISIN", String.class));
|
||||
object.setWorkflowStatus(rs.getObject("workflow_status", String.class));
|
||||
return object;
|
||||
}
|
||||
|
|
@ -108,7 +110,8 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
TimeUtil.toDateFromLocalDate(moneyMarketSecurity.getEndDate()),
|
||||
moneyMarketSecurity.getNominalValue(),
|
||||
moneyMarketSecurity.getNominalCurrency(),
|
||||
moneyMarketSecurity.getTermType()
|
||||
moneyMarketSecurity.getTermType(),
|
||||
moneyMarketSecurity.getLotSize()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
@ -125,6 +128,7 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
|
|||
object.getShortNameEng(),
|
||||
object.getFullNameEng(),
|
||||
object.getSecuritySymbol(),
|
||||
object.getIsin(),
|
||||
object.getWorkflowStatus()
|
||||
};
|
||||
return args;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import ru.clearing.classes.statics.data.company.Company;
|
|||
import ru.clearing.classes.statics.data.company.CompanyHistory;
|
||||
import ru.clearing.classes.statics.data.company.relation.Relation;
|
||||
import ru.clearing.classes.statics.data.company.relation.RelationHistory;
|
||||
import ru.clearing.classes.statics.data.misc.*;
|
||||
import ru.clearing.classes.statics.data.security.Security;
|
||||
import ru.clearing.classes.statics.data.security.SecurityHistory;
|
||||
import ru.clearing.classes.statics.data.user.User;
|
||||
|
|
@ -41,6 +42,10 @@ public class UpdateMapService extends AbstractUpdateMapService {
|
|||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_Security).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_UserConnect).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_User).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_Currency).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_MoneyMarketSecurity).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_Listing).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_MarketHistory).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -82,11 +87,6 @@ public class UpdateMapService extends AbstractUpdateMapService {
|
|||
createBusinessEvent(relationHistory, eventType);
|
||||
relationHistory.setObject((Relation) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_RelationHistory).put(relationHistory.getId(), relationHistory);
|
||||
} else if (value instanceof Security) {
|
||||
SecurityHistory securityHistory = new SecurityHistory();
|
||||
createBusinessEvent(securityHistory, eventType);
|
||||
securityHistory.setObject((Security) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_SecurityHistory).put(securityHistory.getId(), securityHistory);
|
||||
} else if (value instanceof UserConnect) {
|
||||
UserConnectHistory userConnectHistory = new UserConnectHistory();
|
||||
createBusinessEvent(userConnectHistory, eventType);
|
||||
|
|
@ -97,6 +97,33 @@ public class UpdateMapService extends AbstractUpdateMapService {
|
|||
createBusinessEvent(userHistory, eventType);
|
||||
userHistory.setObject((User) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_UserHistory).put(userHistory.getId(), userHistory);
|
||||
} else if (value instanceof Currency) {
|
||||
CurrencyHistory currencyHistory = new CurrencyHistory();
|
||||
createBusinessEvent(currencyHistory, eventType);
|
||||
currencyHistory.setObject((Currency) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_CurrencyHistory).put(currencyHistory.getId(), currencyHistory);
|
||||
} else if (value instanceof MoneyMarketSecurity) {
|
||||
MoneyMarketSecurityHistory moneyMarketSecurityHistory = new MoneyMarketSecurityHistory();
|
||||
createBusinessEvent(moneyMarketSecurityHistory, eventType);
|
||||
moneyMarketSecurityHistory.setObject((MoneyMarketSecurity) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_MoneyMarketSecurityHistory).put(moneyMarketSecurityHistory.getId(), moneyMarketSecurityHistory);
|
||||
} else if (value instanceof Listing) {
|
||||
ListingHistory listingHistory = new ListingHistory();
|
||||
createBusinessEvent(listingHistory, eventType);
|
||||
listingHistory.setObject((Listing) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_ListingHistory).put(listingHistory.getId(), listingHistory);
|
||||
} else if (value instanceof Market) {
|
||||
MarketHistory marketHistory = new MarketHistory();
|
||||
createBusinessEvent(marketHistory, eventType);
|
||||
marketHistory.setObject((Market) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_MarketHistory).put(marketHistory.getId(), marketHistory);
|
||||
|
||||
|
||||
} else if (value instanceof Security) { // Существуют наследники этой таблицы, по этому в последнюю очередь делать эту проверку.
|
||||
SecurityHistory securityHistory = new SecurityHistory();
|
||||
createBusinessEvent(securityHistory, eventType);
|
||||
securityHistory.setObject((Security) value);
|
||||
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_SecurityHistory).put(securityHistory.getId(), securityHistory);
|
||||
} else {
|
||||
log.error("unexpected event {}", event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ import ru.clearing.classes.statics.data.company.relation.Relation;
|
|||
import ru.clearing.classes.statics.data.company.relation.RelationHistory;
|
||||
import ru.clearing.classes.statics.data.execution.ExecutionDeposit;
|
||||
import ru.clearing.classes.statics.data.generated.ClearingMemberCategory;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.CouponPeriod;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.EquitySecurity;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeCashFlow;
|
||||
import ru.clearing.classes.statics.data.instrument.issue.FixedIncomeSecurity;
|
||||
import ru.clearing.classes.statics.data.journal.InDocumentJournal;
|
||||
import ru.clearing.classes.statics.data.journal.ManagementJournal;
|
||||
import ru.clearing.classes.statics.data.journal.OutDocumentJournal;
|
||||
|
|
@ -64,6 +68,10 @@ public class RunnableMapNamesForTesting {
|
|||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_SecurityHistory, SecurityHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserConnectHistory, UserConnectHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserHistory, UserHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CurrencyHistory, CurrencyHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_MoneyMarketSecurityHistory, MoneyMarketSecurityHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ListingHistory, ListingHistory.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_MarketHistory, MarketHistory.class));
|
||||
|
||||
//business object
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalance, AccountBalance.class));
|
||||
|
|
@ -89,6 +97,8 @@ public class RunnableMapNamesForTesting {
|
|||
new SettingOperation("setAmount", new Class[]{BigDecimal.class}, new Object[]{new BigDecimal("23.22")})));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_UserConnect, UserConnect.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_User, User.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_EquitySecurity, EquitySecurity.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_FixedIncomeSecurity, FixedIncomeSecurity.class));
|
||||
|
||||
//dictionary
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AccountStatusDictionary, AccountStatusDictionary.class));
|
||||
|
|
@ -131,6 +141,9 @@ public class RunnableMapNamesForTesting {
|
|||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_TermTypeDictionary, TermTypeDictionary.class));
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_UserRoleDictionary, UserRoleDictionary.class));
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_WorkflowStatusDictionary, WorkflowStatusDictionary.class));
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_SectionDictionary, SectionDictionary.class));
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ShareTypeDictionary, ShareTypeDictionary.class));
|
||||
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_BondTypeDictionary, BondTypeDictionary.class));
|
||||
|
||||
//object
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountRouting, AccountRouting.class));
|
||||
|
|
@ -210,5 +223,7 @@ public class RunnableMapNamesForTesting {
|
|||
new SettingOperation("setInSum", new Class[]{BigDecimal.class}, new Object[]{generatingRandomBigDecimal(2)}),
|
||||
new SettingOperation("setOutExtSum", new Class[]{BigDecimal.class}, new Object[]{generatingRandomBigDecimal(2)}),
|
||||
new SettingOperation("setOutIntSum", new Class[]{BigDecimal.class}, new Object[]{generatingRandomBigDecimal(2)})));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_FixedIncomeCashFlow, FixedIncomeCashFlow.class));
|
||||
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CouponPeriod, CouponPeriod.class));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,6 +122,17 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_OrderRegister = "Map_OrderRegister";
|
||||
public static final String Map_VerificationResult = "Map_VerificationResult";
|
||||
public static final String Map_STrade = "Map_STrade";
|
||||
public static final String Map_SectionDictionary = "Map_SectionDictionary";
|
||||
public static final String Map_ShareTypeDictionary = "Map_ShareTypeDictionary";
|
||||
public static final String Map_BondTypeDictionary = "Map_BondTypeDictionary";
|
||||
public static final String Map_CurrencyHistory = "Map_CurrencyHistory";
|
||||
public static final String Map_MoneyMarketSecurityHistory = "Map_MoneyMarketSecurityHistory";
|
||||
public static final String Map_EquitySecurity = "Map_EquitySecurity";
|
||||
public static final String Map_FixedIncomeSecurity = "Map_FixedIncomeSecurity";
|
||||
public static final String Map_FixedIncomeCashFlow = "Map_FixedIncomeCashFlow";
|
||||
public static final String Map_CouponPeriod = "Map_CouponPeriod";
|
||||
public static final String Map_ListingHistory = "Map_ListingHistory";
|
||||
public static final String Map_MarketHistory = "Map_MarketHistory";
|
||||
|
||||
public static final String MAP_SEQUENCE_NAME = "MAP_SEQUENCE_NAME";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue