http://jira.mfd.msk:8088/browse/CLS-261 DDL правки mapstore. Осторожно: удаление классов!

This commit is contained in:
AKurakin 2023-04-11 14:46:37 +03:00
parent 57b912dee1
commit f71ae406a2
52 changed files with 4158 additions and 402 deletions

View file

@ -133,7 +133,7 @@ public class BankAccountService extends QueueConsumer implements InitializingBea
} else {
log.warn("Not found relation by condition: {}", relationSqlCondition);
}
account.setAccountStatus(AccountStatus.ACTIVE.getKey());
account.setStatus(AccountStatus.ACTIVE.getKey());
account.setProcessingSign(Allowed.ALLOWED.getKey());
account.setCreated(Instant.now());
account.setUpdated(Instant.now());
@ -176,7 +176,7 @@ public class BankAccountService extends QueueConsumer implements InitializingBea
BankAccount bankAccount = bankAccountMap.getSingleObjectByID(req.getId());
Account account = accountMap.getSingleObjectByID(bankAccount.getAccountId());
account.setAccountStatus(AccountStatus.BLOCKED.getKey());
account.setStatus(AccountStatus.BLOCKED.getKey());
account.setUpdated(Instant.now());
accountMap.update(account);

View file

@ -363,7 +363,7 @@ public class BankAccountServiceTest {
account.setId(id);
account.setAccount(acc);
account.setAccountType(AccountType.Bank.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
account.setProcessingSign(Allowed.ALLOWED.getKey());
return account;
}

View file

@ -33,7 +33,7 @@ public class AccountBackendGetAll extends BasicSpcexResponse {
singleItem.setAccount(account.getAccount());
singleItem.setAccountType(account.getAccountType());
singleItem.setRelationId(account.getRelationId());
singleItem.setStatus(account.getAccountStatus());
singleItem.setStatus(account.getStatus());
singleItem.setProcessingSign(account.getProcessingSign());
singleItem.setCreated(account.getCreated());
singleItem.setUpdated(account.getUpdated());

View file

@ -45,7 +45,7 @@ public enum AccountBalanceValidationRule implements IValidationRule<ImdgValidati
if (account == null) {
return of(BalanceError.AccountNotPresent);
}
if (!Status.Active.equalsByKey(account.getAccountStatus())) {
if (!Status.Active.equalsByKey(account.getStatus())) {
return of(BalanceError.AccountNotActive, account.getId());
}
context.storeObject(ValidationStored.Account, account);

View file

@ -114,7 +114,7 @@ public abstract class AbstractServiceTest {
account.setId(id);
account.setAccount(acc);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
return account;
}

View file

@ -109,7 +109,7 @@ class AccountBalanceServiceTest extends AbstractServiceTest {
companyImdg.insert(company);
Account account = new Account();
account.setId(accountIdNew);
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountImdg.insert(account);
predictableResult = new AccountResult(new EnumMessage(BalanceError.AccountNotPresent));
@ -119,7 +119,7 @@ class AccountBalanceServiceTest extends AbstractServiceTest {
//AccountNotPresent id=null
account.setId(null);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountImdg.insert(account);
predictableResult = new AccountResult(new EnumMessage(BalanceError.AccountNotPresent));
@ -129,14 +129,14 @@ class AccountBalanceServiceTest extends AbstractServiceTest {
//AccountNotActive accountStatus=null
account.setId(accountIdNew);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(null);
account.setStatus(null);
accountImdg.insert(account);
predictableResult = new AccountResult(new EnumMessage(BalanceError.AccountNotActive, account.getId()));
result = accountBalanceService.createAccountBalance(addresseeIdNew, accountIdNew, amountNew, cashMovementCurrencyCode);
ACCOUNT_BALANCE_MATCHER.assertMatch(result, predictableResult);
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountImdg.insert(account);
result = accountBalanceService.createAccountBalance(addresseeIdNew, null, amountNew, cashMovementCurrencyCode);
predictableResult = new AccountResult(new EnumMessage(BalanceError.AccountNotPresent));

View file

@ -120,14 +120,14 @@ class Sdf01ExecutorTest extends AbstractServiceTest {
companyMap.put(addresseeIdNew, company);
Account account = new Account();
account.setAccount(acc);
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountMap.put(accountIdNew, account);
checkErrorAccountNotPresent(company, sdf01);
//AccountNotPresent account=null
account.setAccount(null);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountMap.put(accountIdNew, account);
checkErrorAccountNotPresent(company, sdf01);

View file

@ -126,7 +126,7 @@ class Sdf09ExecutorTest extends AbstractServiceTest {
Account account = new Account();
account.setAccount(null);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountMap.put(accountIdNew, account);
checkErrorAccountNotPresent(company);

View file

@ -154,7 +154,7 @@ class Sdf16ExecutorTest extends AbstractServiceTest {
Account account = new Account();
account.setAccount(null);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus(Status.Active.getKey());
account.setStatus(Status.Active.getKey());
accountMap.put(accountIdNew, account);
checkErrorAccountNotPresent(company);

View file

@ -14,7 +14,7 @@ public class Account extends BusinessObject {
private String account;
private String accountType;
private Long relationId;
private String accountStatus;
private String status;
private String processingSign;
private Long companyId;
@ -42,12 +42,12 @@ public class Account extends BusinessObject {
this.relationId = value;
}
public String getAccountStatus() {
return accountStatus;
public String getStatus() {
return status;
}
public void setAccountStatus(String value) {
this.accountStatus = value;
public void setStatus(String value) {
this.status = value;
}
public String getProcessingSign() {

View file

@ -11,6 +11,7 @@ import java.time.LocalDate;
* <p>
* DB table: ACCOUNT_BALANCE
**/
@Deprecated
public class AccountBalance extends BusinessObject {
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
private Long companyId;

View file

@ -10,6 +10,7 @@ import java.io.Serial;
* <p>
* DB table: ACCOUNT_BALANCE_HISTORY
**/
@Deprecated
public class AccountBalanceHistory extends BusinessEvent<AccountBalance> {
@Serial
private static final long serialVersionUID = ConstSerializable.serialVersionUID;

View file

@ -1,45 +0,0 @@
package ru.clearing.classes.statics.data.account;
import ru.clearing.classes.ConstSerializable;
import ru.spcex.platform.classes.base.SpcexObjectBase;
import java.io.Serial;
/**
* Маршрутизация счета
* <p>
* DB table: ACCOUNT_ROUTING
**/
public class AccountRouting extends SpcexObjectBase {
@Serial
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
private Long destinationId;
private Long relationId;
private Long sourceId;
public Long getDestinationId() {
return destinationId;
}
public void setDestinationId(Long value) {
this.destinationId = value;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long value) {
this.relationId = value;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long value) {
this.sourceId = value;
}
}

View file

@ -1,26 +0,0 @@
package ru.clearing.classes.statics.data.account;
import ru.clearing.classes.ConstSerializable;
import ru.clearing.classes.objects.BusinessEvent;
import java.io.Serial;
/**
* Изменение состояния объекта Маршрутизация счета
*
* DB table: ACCOUNT_ROUTING_UPDATE
**/
public class AccountRoutingHistory extends BusinessEvent<AccountRouting> {
@Serial
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
private AccountRouting object;
@Override
public AccountRouting getObject() {
return object;
}
@Override
public void setObject(AccountRouting object) {
this.object = object;
}
}

View file

@ -200,7 +200,7 @@ public class VerificationResultComponent {
.map(sdf01 -> sdf01.getDeal())
.collect(Collectors.toSet());
Set<String> accountKeys = allAccount.stream()
.filter(account -> AccountType.Clrn.equalsByKey(account.getAccountType()) && "UNBL".equals(account.getAccountStatus()))
.filter(account -> AccountType.Clrn.equalsByKey(account.getAccountType()) && "UNBL".equals(account.getStatus()))
.map(sdf01 -> sdf01.getAccount())
.collect(Collectors.toSet());
boolean isOk = sDf01Keys.size() == accountKeys.size() &&

View file

@ -44,7 +44,7 @@ public enum ExecutionDepositValidationRule implements IValidationRule<ImdgValida
Relation relation = context.getStoredObject(ClrngValidationStored.relation);
Account account = accountImdg.getSingleObjectByFieldValues(
Map.of("id", validatedObject.getAccountId(), "relationId", relation.getId()));
if (account == null || !AccountStatus.ACTIVE.equalsByKey(account.getAccountStatus())) {
if (account == null || !AccountStatus.ACTIVE.equalsByKey(account.getStatus())) {
return of(ClearingErrorInternal.AccountNotActive);
}
return empty();

View file

@ -308,12 +308,12 @@ class ClearingServiceTest extends AbstractClearingTest {
executionDeposit = getExecutionDeposit(companyId, accountId, securityId, firstSettlementDate, secondSettlementDate);
executionDepositImdg.insert(executionDeposit);
account.setAccountStatus(AccountStatus.BLOCKED.getKey());
account.setStatus(AccountStatus.BLOCKED.getKey());
accountImdg.insert(account);
checkHaveSomeError(currentInteger.getAndIncrement());
//CompanyIsNotBlocked
account.setAccountStatus(AccountStatus.ACTIVE.getKey());
account.setStatus(AccountStatus.ACTIVE.getKey());
accountImdg.insert(account);
company.setWorkflowStatus(WorkflowStatus.Blocked.getKey());
companyImdg.insert(company);
@ -359,7 +359,7 @@ class ClearingServiceTest extends AbstractClearingTest {
account = new Account();
account.setId(accountId);
account.setRelationId(relationId);
account.setAccountStatus(AccountStatus.ACTIVE.getKey());
account.setStatus(AccountStatus.ACTIVE.getKey());
accountImdg.insert(account);
company = new Company();

View file

@ -83,7 +83,7 @@ class VerificationResultComponentTest extends AbstractClearingTest {
Account account = new Account();
account.setAccount(acc);
account.setAccountType(AccountType.Clrn.getKey());
account.setAccountStatus("UNBL");
account.setStatus("UNBL");
account.setCompanyId(companyId);
account.setCompanyId(companyId);
accountImdg.insert(account);

View file

@ -1,12 +0,0 @@
package ru.clearing.platform.dictionary;
/**
* Справочник статусов счетов
*
* Dictionary DB table: ACCOUNT_STATUS_DICTIONARY
**/
public class AccountStatusDictionary extends AbstractDictionary {
private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID;
}

View file

@ -1,11 +0,0 @@
package ru.clearing.platform.dictionary;
/**
* Справочник секторов
*
* Dictionary DB table: SECTOR_DICTIONARY
**/
public class SectorDictionary extends AbstractDictionary {
private static final long serialVersionUID = ConstDictionarySerializable.serialVersionUID;
}

View file

@ -30,7 +30,7 @@ public abstract class ASecurityHistoryMapStore<STH extends BusinessEvent<? exten
"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", "UUID"};
}
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
private final String insertToSecurityStatement = makeInsertSql("SECURITY_HISTORY",
getFieldsSecurity(), "id");
@ -38,7 +38,7 @@ public abstract class ASecurityHistoryMapStore<STH extends BusinessEvent<? exten
Security object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -8,7 +8,8 @@ import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
@Deprecated
//@Component
public class AccountBalanceHistoryMapStore extends TemplateEventMapStore<AccountBalanceHistory> {
public AccountBalanceHistoryMapStore(JdbcTemplate jdbcTemplate) {

View file

@ -28,7 +28,7 @@ public class AccountHistoryMapStore extends TemplateEventMapStore<AccountHistory
@Override
public String[] getFields() {
return new String[]{"ID", "EVENT_TIME", "EVENT_TYPE", "EVENT_USER_ID",
"ACCOUNT_ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "ACCOUNT_STATUS", "PROCESSING_SIGN", "COMPANY_ID"
"ACCOUNT_ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "STATUS", "PROCESSING_SIGN", "COMPANY_ID"
};
}
@ -47,7 +47,7 @@ public class AccountHistoryMapStore extends TemplateEventMapStore<AccountHistory
object.getAccount(),
object.getAccountType(),
object.getRelationId(),
object.getAccountStatus(),
object.getStatus(),
object.getProcessingSign(),
object.getCompanyId()
};

View file

@ -1,52 +0,0 @@
package ru.spcex.clearing.imdg.businessevent;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.account.AccountRouting;
import ru.clearing.classes.statics.data.account.AccountRoutingHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class AccountRoutingHistoryMapStore extends TemplateEventMapStore<AccountRoutingHistory> {
public AccountRoutingHistoryMapStore(JdbcTemplate jdbcTemplate) {
super(jdbcTemplate);
}
@Override
public String getMapName() {
return IMDGDistributedNames.Map_AccountRoutingHistory;
}
@Override
public String getTableName() {
return "ACCOUNT_ROUTING_HISTORY";
}
@Override
public String[] getFields() {
return new String[]{"ID", "EVENT_TIME", "EVENT_TYPE", "EVENT_USER_ID",
"ACCOUNT_ROUTING_ID", "DESTINATION_ID", "RELATION_ID", "SOURCE_ID"
};
}
@Override
public Object[] objectToField(AccountRoutingHistory updateLog) {
AccountRouting object = updateLog.getObject();
Object[] args = new Object[]{
updateLog.getId(),
TimeUtil.toDateFromInstant(updateLog.getEventTime()),
updateLog.getEventType(),
updateLog.getUserId(),
object.getId(),
object.getDestinationId(),
object.getRelationId(),
object.getSourceId()
};
return args;
}
}

View file

@ -6,6 +6,7 @@ import ru.clearing.classes.statics.data.account.ClearingAccount;
import ru.clearing.classes.statics.data.account.ClearingAccountHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class ClearingAccountHistoryMapStore extends TemplateEventMapStore<ClearingAccountHistory> {
@ -36,7 +37,7 @@ public class ClearingAccountHistoryMapStore extends TemplateEventMapStore<Cleari
ClearingAccount object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -6,6 +6,7 @@ import ru.clearing.classes.statics.data.company.ClearingMemberCategory;
import ru.clearing.classes.statics.data.company.ClearingMemberCategoryHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class ClearingMemberCategoryHistoryMapStore extends TemplateEventMapStore<ClearingMemberCategoryHistory> {
@ -36,7 +37,7 @@ public class ClearingMemberCategoryHistoryMapStore extends TemplateEventMapStore
ClearingMemberCategory object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class ClientCodeHistoryMapStore extends TemplateEventMapStore<ClientCodeH
ClientCode object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -6,6 +6,7 @@ import ru.clearing.classes.statics.data.company.CompanySymbols;
import ru.clearing.classes.statics.data.company.CompanySymbolsHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class CompanySymbolsHistoryMapStore extends TemplateEventMapStore<CompanySymbolsHistory> {
@ -36,7 +37,7 @@ public class CompanySymbolsHistoryMapStore extends TemplateEventMapStore<Company
CompanySymbols object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class CouponPeriodHistoryMapStore extends TemplateEventMapStore<CouponPer
CouponPeriod object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -7,6 +7,7 @@ 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;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class CurrencyHistoryMapStore extends TemplateEventMapStore<CurrencyHistory> {
@ -37,7 +38,7 @@ public class CurrencyHistoryMapStore extends TemplateEventMapStore<CurrencyHisto
Currency object=historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -6,6 +6,7 @@ import ru.clearing.classes.statics.data.account.DepoAccount;
import ru.clearing.classes.statics.data.account.DepoAccountHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class DepoAccountHistoryMapStore extends TemplateEventMapStore<DepoAccountHistory> {
@ -36,7 +37,7 @@ public class DepoAccountHistoryMapStore extends TemplateEventMapStore<DepoAccoun
DepoAccount object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -5,6 +5,7 @@ import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.instrument.issue.EquitySecurity;
import ru.clearing.classes.statics.data.instrument.issue.EquitySecurityHistory;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.platform.utils.time.TimeUtil;
@Component
public class EquitySecurityHistoryMapStore extends ASecurityHistoryMapStore<EquitySecurityHistory> {
@ -36,7 +37,7 @@ public class EquitySecurityHistoryMapStore extends ASecurityHistoryMapStore<Equi
EquitySecurity equitySecurity = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -40,7 +40,7 @@ public class FixedIncomeCashFlowHistoryMapStore extends TemplateEventMapStore<Fi
FixedIncomeCashFlow fixedIncomeCashFlow = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -39,7 +39,7 @@ public class FixedIncomeSecurityHistoryMapStore extends ASecurityHistoryMapStore
FixedIncomeSecurity fixedIncomeSecurity = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class ListingHistoryMapStore extends TemplateEventMapStore<ListingHistory
Listing object=historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class MarketHistoryMapStore extends TemplateEventMapStore<MarketHistory>
Market object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -43,7 +43,7 @@ public class MoneyMarketSecurityHistoryMapStore extends ASecurityHistoryMapStore
MoneyMarketSecurity moneyMarketSecurity = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -38,7 +38,7 @@ public class ProfileDocumentHistoryMapStore extends TemplateEventMapStore<Profil
ProfileDocument object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class RegistryHistoryMapStore extends TemplateEventMapStore<RegistryHisto
Registry object = historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -37,7 +37,7 @@ public class TradingClearingRegistryHistoryMapStore extends TemplateEventMapStor
TradingClearingRegistry object=historyLog.getObject();
Object[] args = new Object[]{
historyLog.getId(),
historyLog.getEventTime(),
TimeUtil.toDateFromInstant(historyLog.getEventTime()),
historyLog.getUserId(),
historyLog.getEventType(),

View file

@ -11,7 +11,8 @@ import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
@Component
@Deprecated
//@Component
public class AccountBalanceMapStore extends TemplateMapStore<AccountBalance> {
public AccountBalanceMapStore(JdbcTemplate jdbcTemplate) {

View file

@ -30,7 +30,7 @@ public class AccountMapStore extends TemplateMapStore<Account> {
@Override
public String[] getFields() {
return new String[]{
"ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "ACCOUNT_STATUS", "PROCESSING_SIGN", "COMPANY_ID"
"ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "STATUS", "PROCESSING_SIGN", "COMPANY_ID"
};
}
@ -43,7 +43,7 @@ public class AccountMapStore extends TemplateMapStore<Account> {
object.setAccount(resultSet.getObject("ACCOUNT", String.class));
object.setAccountType(resultSet.getObject("ACCOUNT_TYPE", String.class));
object.setRelationId(resultSet.getObject("RELATION_ID", Long.class));
object.setAccountStatus(resultSet.getObject("ACCOUNT_STATUS", String.class));
object.setStatus(resultSet.getObject("STATUS", String.class));
object.setProcessingSign(resultSet.getObject("PROCESSING_SIGN", String.class));
object.setCompanyId(resultSet.getObject("COMPANY_ID", Long.class));
return object;
@ -58,7 +58,7 @@ public class AccountMapStore extends TemplateMapStore<Account> {
object.getAccount(),
object.getAccountType(),
object.getRelationId(),
object.getAccountStatus(),
object.getStatus(),
object.getProcessingSign(),
object.getCompanyId()
};

View file

@ -1,4 +1,4 @@
package ru.spcex.clearing.imdg.object;
package ru.spcex.clearing.imdg.businessobject;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@ -15,7 +15,7 @@ import java.util.List;
import java.util.Map;
@Component
public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSecurity> {
public class MoneyMarketSecurityMapStore extends ASecurityMapStore<MoneyMarketSecurity> {
private final String insertToSecurityStatement = makeInsertSql("SECURITY",
getFieldsSecurity(), "id");
@ -41,11 +41,7 @@ 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", "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", "ISIN", "WORKFLOW_STATUS"};
return new String[]{"ID", "SECURITY_ID", "DESCRIPTION", "START_DATE", "END_DATE", "NOMINAL_VALUE", "NOMINAL_CURRENCY", "TERM_TYPE"};
}
@Override
@ -72,33 +68,10 @@ 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.setLotSize(resultSet.getObject("LOT_SIZE", BigDecimal.class));
fillBySecurity(object, object.getSecurityId());
return object;
}
private void fillBySecurity(MoneyMarketSecurity object, Long securityId) {
List<MoneyMarketSecurity> 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(MoneyMarketSecurity moneyMarketSecurity) {
@ -110,45 +83,9 @@ public class MoneyMarketSecurityMapStore extends TemplateMapStore<MoneyMarketSec
TimeUtil.toDateFromLocalDate(moneyMarketSecurity.getEndDate()),
moneyMarketSecurity.getNominalValue(),
moneyMarketSecurity.getNominalCurrency(),
moneyMarketSecurity.getTermType(),
moneyMarketSecurity.getLotSize()
moneyMarketSecurity.getTermType()
};
return args;
}
protected Object[] securityField(MoneyMarketSecurity 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, MoneyMarketSecurity> map) {
List<Object[]> moneyMarketArgs = new ArrayList<>();
List<Object[]> securityArgs = new ArrayList<>();
for (Map.Entry<Long, MoneyMarketSecurity> entry : map.entrySet()) {
MoneyMarketSecurity 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);
}
}

View file

@ -1,31 +0,0 @@
package ru.spcex.clearing.imdg.dictionary;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import ru.clearing.platform.dictionary.AccountStatusDictionary;
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
@Component
public class AccountStatusDictionaryMapStore extends DictionaryTMapStore<AccountStatusDictionary> {
public AccountStatusDictionaryMapStore(JdbcTemplate jdbcTemplate) {
super(jdbcTemplate);
}
@Override
public String getMapName() {
return IMDGDistributedNames.Map_AccountStatusDictionary;
}
@Override
public String getTableName() {
return "ACCOUNT_STATUS_DICTIONARY";
}
@Override
public AccountStatusDictionary getDictionaryObject() {
return new AccountStatusDictionary();
}
}

View file

@ -1,32 +0,0 @@
package ru.spcex.clearing.imdg.dictionary;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import ru.clearing.platform.dictionary.SectorDictionary;
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
@Component
public class SectorDictionaryMapStore extends DictionaryTMapStore<SectorDictionary> {
public SectorDictionaryMapStore(JdbcTemplate jdbcTemplate) {
super(jdbcTemplate);
}
@Override
public String getMapName() {
return IMDGDistributedNames.Map_SectorDictionary;
}
@Override
public String getTableName() {
return "SECTOR_DICTIONARY";
}
@Override
public SectorDictionary getDictionaryObject() {
return new SectorDictionary();
}
}

View file

@ -1,58 +0,0 @@
package ru.spcex.clearing.imdg.object;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import ru.clearing.classes.statics.data.account.AccountRouting;
import ru.spcex.clearing.imdg.IMDGDistributedNames;
import ru.spcex.clearing.imdg.base.TemplateMapStore;
import java.sql.ResultSet;
import java.sql.SQLException;
@Component
public class AccountRoutingMapStore extends TemplateMapStore<AccountRouting> {
public AccountRoutingMapStore(JdbcTemplate jdbcTemplate) {
super(jdbcTemplate);
}
@Override
public String getMapName() {
return IMDGDistributedNames.Map_AccountRouting;
}
@Override
public String getTableName() {
return "ACCOUNT_ROUTING";
}
@Override
public String[] getFields() {
return new String[]{
"ID", "DESTINATION_ID", "RELATION_ID", "SOURCE_ID"
};
}
@Override
public AccountRouting objectReader(ResultSet resultSet) throws SQLException {
AccountRouting object = new AccountRouting();
object.setId(resultSet.getObject("ID", Long.class));
object.setDestinationId(resultSet.getObject("DESTINATION_ID", Long.class));
object.setRelationId(resultSet.getObject("RELATION_ID", Long.class));
object.setSourceId(resultSet.getObject("SOURCE_ID", Long.class));
return object;
}
@Override
public Object[] objectToField(AccountRouting object) {
Object[] args = new Object[]{
object.getId(),
object.getDestinationId(),
object.getRelationId(),
object.getSourceId()
};
return args;
}
}
// todo Сделать BusinessEventMapStore AccountRoutingUpdateMapStore

View file

@ -36,7 +36,6 @@ public class UpdateMapService extends AbstractUpdateMapService {
public void addingListenersToCards() {
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_AccountBalance).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_Account).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_AccountRouting).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_BankAccount).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_Company).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_CompanySymbols).addLocalEntryListener(this, Predicates.alwaysTrue(), true);
@ -71,11 +70,6 @@ public class UpdateMapService extends AbstractUpdateMapService {
createBusinessEvent(accountHistory, eventType);
accountHistory.setObject((Account) value);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_AccountHistory).put(accountHistory.getId(), accountHistory);
} else if (value instanceof AccountRouting) {
AccountRoutingHistory accountRoutingHistory = new AccountRoutingHistory();
createBusinessEvent(accountRoutingHistory, eventType);
accountRoutingHistory.setObject((AccountRouting) value);
hazelcastServerInstance.getMap(IMDGDistributedNames.Map_AccountRoutingHistory).put(accountRoutingHistory.getId(), accountRoutingHistory);
} else if (value instanceof BankAccount) {
BankAccountHistory bankAccountHistory = new BankAccountHistory();
createBusinessEvent(bankAccountHistory, eventType);

View file

@ -206,7 +206,7 @@ public class AllMapStoreTest {
}
//todo удалить если будет не нужна, пока не работает из-за "deleteIsSupported() return false" в SimpleObjectMapStore.
@Test
// @Test
public void checkDeletingForAllMapStoreTest() {
Assumptions.assumeTrue(false, "todo удалить если будет не нужна, пока не работает из-за \"deleteIsSupported() return false\" в SimpleObjectMapStore.");
saveBusinessObjectAndBusinessEventToMaps();

View file

@ -8,6 +8,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.init.DatabasePopulator;
import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import ru.spcex.clearing.imdg.error.ModuleInitializeException;
@ -51,7 +52,7 @@ public class DbTestConnectionConfig {
cpds.setNumHelperThreads(numHelperThreads);
cpds.setCheckoutTimeout(timeoutSec * 1000);
logTimeoutPart = String.format(" (timeout=%ds)", timeoutSec);
// DatabasePopulatorUtils.execute(createDatabasePopulator(), cpds);
// DatabasePopulatorUtils.execute(createDatabasePopulator(), cpds); // пересоздание таблиц по DDL
result = cpds;
String OPERATION_DATABASE_CONNECTION_CHECK = String.format("Database [%s] connection check", dbPath);

View file

@ -51,9 +51,8 @@ public class RunnableMapNamesForTesting {
dictionaryObjectForCheckMapStores = new LinkedList<>();
//business event
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalanceHistory, AccountBalanceHistory.class));
// businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalanceHistory, AccountBalanceHistory.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountHistory, AccountHistory.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountRoutingHistory, AccountRoutingHistory.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_BankAccountHistory, BankAccountHistory.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CompanyHistory, CompanyHistory.class,
usingIgnoringFieldsComparator("object.profile.clearingCode", "object.profile.fullName", "object.profile.registrationCode", "object.profile.shortName", "object.profile.tradingCode")));
@ -75,7 +74,7 @@ public class RunnableMapNamesForTesting {
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_CouponPeriodHistory, CouponPeriodHistory.class));
//business object
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalance, AccountBalance.class));
// businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountBalance, AccountBalance.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Account, Account.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_ClearingCalendar, ClearingCalendar.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_Company, Company.class,
@ -102,7 +101,6 @@ public class RunnableMapNamesForTesting {
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_FixedIncomeSecurity, FixedIncomeSecurity.class));
//dictionary
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AccountStatusDictionary, AccountStatusDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AccountTypeDictionary, AccountTypeDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_AllowedDictionary, AllowedDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_BalanceAccountTypeDictionary, BalanceAccountTypeDictionary.class));
@ -132,7 +130,6 @@ public class RunnableMapNamesForTesting {
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_OrganizationTypeDictionary, OrganizationTypeDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ParentDictionary, ParentDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ResultStatusDictionary, ResultStatusDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_SectorDictionary, SectorDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceDictionary, ServiceDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceProductDictionary, ServiceProductDictionary.class));
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ServiceStatusDictionary, ServiceStatusDictionary.class));
@ -159,7 +156,6 @@ public class RunnableMapNamesForTesting {
dictionaryObjectForCheckMapStores.add(new DictionaryObjectForCheckMapStore<>(IMDGDistributedNames.Map_ClearingAccountTypeDictionary, ClearingAccountTypeDictionary.class));
//object
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AccountRouting, AccountRouting.class));
businessObjectAndBusinessEventForCheckMapStores.add(new BusinessObjectAndBusinessEventForCheckMapStore<>(IMDGDistributedNames.Map_AdmittedDealRegister, AdmittedDealRegister.class,
new SettingOperation("setCreated", new Class[]{Instant.class}, new Object[]{generatingRandomInstant(true)}),
new SettingOperation("setUpdated", new Class[]{Instant.class}, new Object[]{generatingRandomInstant(true)}),

File diff suppressed because it is too large Load diff

View file

@ -23,8 +23,6 @@ public final class IMDGDistributedNames {
public static final String Map_BankAccount = "Map_BankAccount";
public static final String Map_BankAccountHistory = "Map_BankAccountHistory";
public static final String Map_ClearingMemberCategory = "Map_ClearingMemberCategory";
public static final String Map_AccountRouting = "Map_AccountRouting";
public static final String Map_AccountRoutingHistory = "Map_AccountRoutingHistory";
public static final String Map_InformationAccountHistory = "Map_InformationAccountHistory";
public static final String Map_InformationAccount = "Map_InformationAccount";
public static final String Map_Security = "Map_Security";
@ -86,7 +84,6 @@ public final class IMDGDistributedNames {
public static final String Map_OperationStatusDictionary = "Map_OperationStatusDictionary";
public static final String Map_OperationTypeDictionary = "Map_OperationTypeDictionary";
public static final String Map_ResultStatusDictionary = "Map_ResultStatusDictionary";
public static final String Map_SectorDictionary = "Map_SectorDictionary";
public static final String Map_ServiceDictionary = "Map_ServiceDictionary";
public static final String Map_ServiceProductDictionary = "Map_ServiceProductDictionary";
public static final String Map_ServiceStatusDictionary = "Map_ServiceStatusDictionary";
@ -102,7 +99,6 @@ public final class IMDGDistributedNames {
public static final String Map_UserRoleDictionary = "Map_UserRoleDictionary";
public static final String Map_UserSettings = "Map_UserSettings";
public static final String Map_UserRoleSession = "Map_UserRoleSession";
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";