Added AccountBalanceHistoryMapStore and AccountBalanceHistory
This commit is contained in:
parent
245e4d03b6
commit
93d8f1b856
3 changed files with 102 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
package ru.clearing.classes.statics.data.account;
|
||||
|
||||
import ru.clearing.classes.ConstSerializable;
|
||||
import ru.clearing.classes.objects.BusinessEvent;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Изменение состояния объекта Счета
|
||||
* <p>
|
||||
* DB table: ACCOUNT_BALANCE_HISTORY
|
||||
**/
|
||||
public class AccountBalanceHistory extends BusinessEvent<AccountBalance> {
|
||||
@Serial
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
||||
private AccountBalance object;
|
||||
|
||||
@Override
|
||||
public AccountBalance getObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(AccountBalance object) {
|
||||
this.object = object;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package ru.spcex.clearing.imdg.businessevent;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.account.AccountBalance;
|
||||
import ru.clearing.classes.statics.data.account.AccountBalanceHistory;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
import ru.spcex.platform.utils.time.TimeUtil;
|
||||
|
||||
@Component
|
||||
public class AccountBalanceHistoryMapStore extends TemplateEventMapStore<AccountBalanceHistory> {
|
||||
|
||||
public AccountBalanceHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_AccountBalanceHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "ACCOUNT_BALANCE_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_USER_ID",
|
||||
"ACCOUNT_BALANCE_ID", "COMPANY_ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT_ID", "ACCOUNT_TYPE",
|
||||
"ACCOUNT", "OPEN_BALANCE_AMOUNT", "START_BALANCE_AMOUNT", "CLOSE_BALANCE_AMOUNT",
|
||||
"TRADE_BALANCE_AMOUNT", "FREE_BALANCE_AMOUNT", "CHANGE_BALANCE_AMOUNT",
|
||||
"CREDIT_AMOUNT", "DEBIT_AMOUNT", "BALANCE_AMOUNT", "BALANCE_ACCOUNT_TYPE",
|
||||
"CLEARING_DATE", "CURRENCY_CODE", "TRADING_CODE", "SHORT_NAME", "FULL_NAME"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(AccountBalanceHistory updateLog) {
|
||||
AccountBalance object = updateLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
updateLog.getId(),
|
||||
updateLog.getEventTime(),
|
||||
updateLog.getUserId(),
|
||||
|
||||
object.getId(),
|
||||
object.getCompanyId(),
|
||||
TimeUtil.toDateFromInstant(object.getCreated()),
|
||||
TimeUtil.toDateFromInstant(object.getUpdated()),
|
||||
object.getAccountId(),
|
||||
object.getAccountType(),
|
||||
object.getAccount(),
|
||||
object.getOpenBalanceAmount(),
|
||||
object.getStartBalanceAmount(),
|
||||
object.getCloseBalanceAmount(),
|
||||
object.getTradeBalanceAmount(),
|
||||
object.getFreeBalanceAmount(),
|
||||
object.getChangeBalanceAmount(),
|
||||
object.getCreditAmount(),
|
||||
object.getDebitAmount(),
|
||||
object.getBalanceAmount(),
|
||||
object.getBalanceAccountType(),
|
||||
TimeUtil.toDateFromLocalDate(object.getClearingDate()),
|
||||
object.getCurrencyCode(),
|
||||
object.getTradingCode(),
|
||||
object.getShortName(),
|
||||
object.getFullName()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_Account = "Map_Account";
|
||||
public static final String Map_AccountBalance = "Map_AccountBalance";
|
||||
public static final String Map_AccountHistory = "Map_AccountHistory";
|
||||
public static final String Map_AccountBalanceHistory = "Map_AccountBalanceHistory";
|
||||
public static final String Map_Relation = "Map_Relation";
|
||||
public static final String Map_ClearingAccount = "Map_ClearingAccount";
|
||||
public static final String Map_ClearingAccountHistory = "Map_ClearingAccountHistory";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue