fix imdg mapStores
This commit is contained in:
parent
9690bd0a57
commit
0f891bb8f2
7 changed files with 74 additions and 138 deletions
|
|
@ -1,49 +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.ClearingAccount;
|
||||
import ru.clearing.classes.statics.data.account.ClearingAccountHistory;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateEventMapStore;
|
||||
|
||||
@Component
|
||||
public class ClearingAccountHistoryMapStore extends TemplateEventMapStore<ClearingAccountHistory> {
|
||||
|
||||
public ClearingAccountHistoryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_ClearingAccountHistory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "CLEARING_ACCOUNT_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID","EVENT_TIME", "EVENT_USER_ID",
|
||||
"CLEARING_ACCOUNT_ID", "ACCOUNT_ID", "ACCOUNT"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(ClearingAccountHistory updateLog) {
|
||||
ClearingAccount object=updateLog.getObject();
|
||||
Object[] args = new Object[]{
|
||||
updateLog.getId(),
|
||||
updateLog.getEventTime(),
|
||||
updateLog.getUserId(),
|
||||
|
||||
object.getId(),
|
||||
object.getAccountId(),
|
||||
object.getAccount()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ public class UserHistoryMapStore extends TemplateEventMapStore<UserHistory> {
|
|||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "USER_CLR_HISTORY";
|
||||
return "USER_CLS_HISTORY";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class UserMapStore extends TemplateMapStore<User> {
|
|||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "USER_CLR";
|
||||
return "USER_CLS";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -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.ClearingCategoryDictionary;
|
||||
import ru.spcex.clearing.imdg.base.DictionaryTMapStore;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
|
||||
@Component
|
||||
public class ClearingCategoryDictionaryMapStore extends DictionaryTMapStore<ClearingCategoryDictionary> {
|
||||
|
||||
public ClearingCategoryDictionaryMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_ClearingCategoryDictionary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "CLEARING_CATEGORY_DICTIONARY";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClearingCategoryDictionary getDictionaryObject() {
|
||||
return new ClearingCategoryDictionary();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,54 +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.ClearingAccount;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
public class ClearingAccountMapStore extends TemplateMapStore<ClearingAccount> {
|
||||
|
||||
public ClearingAccountMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_ClearingAccount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "CLEARING_ACCOUNT";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "ACCOUNT_ID", "ACCOUNT"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClearingAccount objectReader(ResultSet resultSet) throws SQLException {
|
||||
ClearingAccount object = new ClearingAccount();
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setAccountId(resultSet.getObject("ACCOUNT_ID", Long.class));
|
||||
object.setAccount(resultSet.getObject("ACCOUNT", String.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(ClearingAccount object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getId(),
|
||||
object.getAccountId(),
|
||||
object.getAccount()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package ru.spcex.clearing.imdg.object;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.statics.data.sdf.SDf09;
|
||||
import ru.spcex.clearing.imdg.IMDGDistributedNames;
|
||||
import ru.spcex.clearing.imdg.base.TemplateMapStore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
public class SDf09MapStore extends TemplateMapStore<SDf09> {
|
||||
|
||||
public SDf09MapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMapName() {
|
||||
return IMDGDistributedNames.Map_SDf09;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTableName() {
|
||||
return "S_DF09";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"ID", "ACCOUNT", "SUM", "MARKET", "TYPE", "NUMBER", "_I_N_N", "FILE_NAME", "GENERATION_TIME",
|
||||
"GENERATION_ID"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public SDf09 objectReader(ResultSet resultSet) throws SQLException {
|
||||
SDf09 object = new SDf09();
|
||||
object.setId(resultSet.getObject("ID", Long.class));
|
||||
object.setAccount(resultSet.getString("ACCOUNT"));
|
||||
object.setSum(resultSet.getObject("SUM", BigDecimal.class));
|
||||
object.setType(resultSet.getString("TYPE"));
|
||||
object.setNumber(resultSet.getObject("NUMBER", BigDecimal.class));
|
||||
object.setInn(resultSet.getObject("_I_N_N", BigDecimal.class));
|
||||
object.setFileName(resultSet.getString("FILE_NAME"));
|
||||
object.setGenerationTime(getInstantFromTimestamp(resultSet, "GENERATION_TIME"));
|
||||
object.setGenerationId(resultSet.getObject("GENERATION_ID", Long.class));
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] objectToField(SDf09 object) {
|
||||
Object[] args = new Object[]{
|
||||
object.getId(),
|
||||
object.getAccount(),
|
||||
object.getSum(),
|
||||
object.getType(),
|
||||
object.getNumber(),
|
||||
object.getInn(),
|
||||
object.getFileName(),
|
||||
object.getGenerationTime(),
|
||||
object.getGenerationId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -44,6 +44,8 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_InDocumentJournal = "Map_InDocumentJournal";
|
||||
public static final String Map_OutDocumentJournal = "Map_OutDocumentJournal";
|
||||
|
||||
public static final String Map_SDf01 = "Map_SDf01";
|
||||
public static final String Map_SDf02 = "Map_SDf02";
|
||||
public static final String Map_SDf03 = "Map_SDf03";
|
||||
public static final String Map_SDf05 = "Map_SDf05";
|
||||
public static final String Map_SDf10 = "Map_SDf10";
|
||||
|
|
@ -52,8 +54,7 @@ public final class IMDGDistributedNames {
|
|||
public static final String Map_SDf17 = "Map_SDf17";
|
||||
public static final String Map_SDf16 = "Map_SDf16";
|
||||
public static final String Map_SDf08 = "Map_SDf08";
|
||||
public static final String Map_SDf02 = "Map_SDf02";
|
||||
public static final String Map_SDf01 = "Map_SDf01";
|
||||
public static final String Map_SDf09 = "Map_SDf09";
|
||||
public static final String Map_SDf12 = "Map_SDf12";
|
||||
public static final String Map_SDf18 = "Map_SDf18";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue