http://jira.mfd.msk:8088/browse/CLS-1 DDL памсторы готовы на 91%
This commit is contained in:
parent
0521ad3916
commit
24f777986d
3 changed files with 18 additions and 11 deletions
|
|
@ -6,7 +6,7 @@ import ru.clearing.classes.objects.BusinessEvent;
|
|||
import ru.clearing.classes.objects.BusinessObject;
|
||||
|
||||
/**
|
||||
* DB: COMPANY
|
||||
* DB: COMPANY_UPDATE
|
||||
*/
|
||||
public class CompanyUpdate extends BusinessEvent<Company> {
|
||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|||
import org.springframework.stereotype.Component;
|
||||
import ru.clearing.classes.StaticData.Company.Company;
|
||||
import ru.clearing.classes.StaticData.Profile.CompanyInfo;
|
||||
import ru.spcex.clearing.storage.base.ObjectBaseMapStore;
|
||||
import ru.spcex.clearing.storage.base.BusinessObjectMapStore;
|
||||
import ru.spcex.clearing.storage.utils.DbUtilsHelper;
|
||||
import ru.spcex.clearing.storage.utils.TimeUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
||||
public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||
|
||||
public CompanyMapStore(JdbcTemplate jdbcTemplate) {
|
||||
super(jdbcTemplate);
|
||||
|
|
@ -24,7 +25,7 @@ public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"id"
|
||||
"id", "created_at", "updated_at", "status", "clearing_code", "exchange_code"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -36,10 +37,13 @@ public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
|||
return namedParameterJdbcTemplate.query("select * from " + getTableName() + " where id in (:ids)", paramMap,
|
||||
(resultSet, i) -> {
|
||||
Company company = new Company();
|
||||
fillBusinessObjectFields(company, resultSet);
|
||||
company.setId(resultSet.getObject("id", Long.class));
|
||||
// contact.set(resultSet.getObject("", Long.class));
|
||||
company.setStatusId(resultSet.getObject("status", Long.class));
|
||||
company.setClearingCode(resultSet.getObject("clearing_code", String.class));
|
||||
company.setExchangeCode(resultSet.getObject("exchange_code", String.class));
|
||||
company.setProfile(new CompanyInfo());
|
||||
//todo Company loader
|
||||
//todo Company loader CompanyInfo!
|
||||
return company;
|
||||
});
|
||||
}
|
||||
|
|
@ -53,12 +57,15 @@ public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
|||
|
||||
Object[] args = new Object[]{
|
||||
company.getId(),
|
||||
// company.getCompanyId(),
|
||||
// contact.getContactType(),
|
||||
// contact.getContactValue()
|
||||
//todo Company loader
|
||||
company.getId(),
|
||||
TimeUtil.fromInstant(company.getCreated()),
|
||||
TimeUtil.fromInstant(company.getUpdated()),
|
||||
company.getStatusId(),
|
||||
company.getClearingCode(),
|
||||
company.getExchangeCode()
|
||||
};
|
||||
batchArgs.add(args);
|
||||
company.getProfile();//todo Company loader Profile!
|
||||
}
|
||||
batchInsertUpdate(insertStatement, batchArgs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class ContactMapStore extends ObjectBaseMapStore<Contact> {
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{
|
||||
"id", "company_id", "company_symbol", "company_symbol_value"
|
||||
"id", "company_id", "contact_type", "contact_value"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue