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;
|
import ru.clearing.classes.objects.BusinessObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DB: COMPANY
|
* DB: COMPANY_UPDATE
|
||||||
*/
|
*/
|
||||||
public class CompanyUpdate extends BusinessEvent<Company> {
|
public class CompanyUpdate extends BusinessEvent<Company> {
|
||||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,14 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import ru.clearing.classes.StaticData.Company.Company;
|
import ru.clearing.classes.StaticData.Company.Company;
|
||||||
import ru.clearing.classes.StaticData.Profile.CompanyInfo;
|
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.DbUtilsHelper;
|
||||||
|
import ru.spcex.clearing.storage.utils.TimeUtil;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
|
|
||||||
public CompanyMapStore(JdbcTemplate jdbcTemplate) {
|
public CompanyMapStore(JdbcTemplate jdbcTemplate) {
|
||||||
super(jdbcTemplate);
|
super(jdbcTemplate);
|
||||||
|
|
@ -24,7 +25,7 @@ public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
||||||
@Override
|
@Override
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
return new String[]{
|
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,
|
return namedParameterJdbcTemplate.query("select * from " + getTableName() + " where id in (:ids)", paramMap,
|
||||||
(resultSet, i) -> {
|
(resultSet, i) -> {
|
||||||
Company company = new Company();
|
Company company = new Company();
|
||||||
|
fillBusinessObjectFields(company, resultSet);
|
||||||
company.setId(resultSet.getObject("id", Long.class));
|
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());
|
company.setProfile(new CompanyInfo());
|
||||||
//todo Company loader
|
//todo Company loader CompanyInfo!
|
||||||
return company;
|
return company;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -53,12 +57,15 @@ public class CompanyMapStore extends ObjectBaseMapStore<Company> {
|
||||||
|
|
||||||
Object[] args = new Object[]{
|
Object[] args = new Object[]{
|
||||||
company.getId(),
|
company.getId(),
|
||||||
// company.getCompanyId(),
|
company.getId(),
|
||||||
// contact.getContactType(),
|
TimeUtil.fromInstant(company.getCreated()),
|
||||||
// contact.getContactValue()
|
TimeUtil.fromInstant(company.getUpdated()),
|
||||||
//todo Company loader
|
company.getStatusId(),
|
||||||
|
company.getClearingCode(),
|
||||||
|
company.getExchangeCode()
|
||||||
};
|
};
|
||||||
batchArgs.add(args);
|
batchArgs.add(args);
|
||||||
|
company.getProfile();//todo Company loader Profile!
|
||||||
}
|
}
|
||||||
batchInsertUpdate(insertStatement, batchArgs);
|
batchInsertUpdate(insertStatement, batchArgs);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class ContactMapStore extends ObjectBaseMapStore<Contact> {
|
||||||
@Override
|
@Override
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
return new String[]{
|
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