Refactoring CompanyInfo and dependent classes
This commit is contained in:
parent
93d8f1b856
commit
da0e319e95
6 changed files with 10 additions and 24 deletions
|
|
@ -55,7 +55,6 @@ public class CompanyBackendGetAll extends BasicSpcexResponse {
|
||||||
CompanyInfo profile = company.getProfile();
|
CompanyInfo profile = company.getProfile();
|
||||||
companyInfoFields.setId(profile.getId());
|
companyInfoFields.setId(profile.getId());
|
||||||
companyInfoFields.setCompanyId(profile.getCompanyId());
|
companyInfoFields.setCompanyId(profile.getCompanyId());
|
||||||
companyInfoFields.setClearingMemberCategory(profile.getClearingMemberCategory());
|
|
||||||
companyInfoFields.setCorporationSoleType(profile.getCorporationSoleType());
|
companyInfoFields.setCorporationSoleType(profile.getCorporationSoleType());
|
||||||
companyInfoFields.setCountryCode(profile.getCountryCode());
|
companyInfoFields.setCountryCode(profile.getCountryCode());
|
||||||
companyInfoFields.setDescription(profile.getDescription());
|
companyInfoFields.setDescription(profile.getDescription());
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public class CompanyBackendInfoGetAll extends BasicSpcexResponse {
|
||||||
var singleItem = new CompanyBackendInfoGetFields();
|
var singleItem = new CompanyBackendInfoGetFields();
|
||||||
singleItem.setId(companyInfo.getId());
|
singleItem.setId(companyInfo.getId());
|
||||||
singleItem.setCompanyId(companyInfo.getCompanyId());
|
singleItem.setCompanyId(companyInfo.getCompanyId());
|
||||||
singleItem.setClearingMemberCategory(companyInfo.getClearingMemberCategory());
|
|
||||||
singleItem.setCorporationSoleType(companyInfo.getCorporationSoleType());
|
singleItem.setCorporationSoleType(companyInfo.getCorporationSoleType());
|
||||||
singleItem.setCountryCode(companyInfo.getCountryCode());
|
singleItem.setCountryCode(companyInfo.getCountryCode());
|
||||||
singleItem.setDescription(companyInfo.getDescription());
|
singleItem.setDescription(companyInfo.getDescription());
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import java.time.LocalDate;
|
||||||
/**
|
/**
|
||||||
* Счета
|
* Счета
|
||||||
* <p>
|
* <p>
|
||||||
* DB table: ACCOUNT
|
* DB table: ACCOUNT_BALANCE
|
||||||
**/
|
**/
|
||||||
public class AccountBalance extends BusinessObject {
|
public class AccountBalance extends BusinessObject {
|
||||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ public class CompanyInfo extends SpcexObjectBase {
|
||||||
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
private static final long serialVersionUID = ConstSerializable.serialVersionUID;
|
||||||
|
|
||||||
private Long companyId; // Company.CompanyInfo.companyId = CompanyInfo.id
|
private Long companyId; // Company.CompanyInfo.companyId = CompanyInfo.id
|
||||||
private String clearingMemberCategory; // ref CHAR(4),
|
|
||||||
private String corporationSoleType; // ref CHAR(4),
|
private String corporationSoleType; // ref CHAR(4),
|
||||||
private String countryCode; //ref CHAR(4),
|
private String countryCode; //ref CHAR(4),
|
||||||
private String description;
|
private String description;
|
||||||
|
|
@ -34,14 +33,6 @@ public class CompanyInfo extends SpcexObjectBase {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClearingMemberCategory() {
|
|
||||||
return clearingMemberCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClearingMemberCategory(String clearingMemberCategory) {
|
|
||||||
this.clearingMemberCategory = clearingMemberCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCorporationSoleType() {
|
public String getCorporationSoleType() {
|
||||||
return corporationSoleType;
|
return corporationSoleType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,16 +29,16 @@ public class CompanyHistoryMapStore extends BusinessEventMapStore<CompanyHistory
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"id", "event_time", "event_user_id",
|
"id", "event_time", "event_user_id",
|
||||||
"company_id", "created_at", "updated_at", "trading_code", "clearing_code", "registration_code", "workflow_status", "short_name", "full_name"
|
"company_id", "created_at", "updated_at", "trading_code", "clearing_code", "registration_code", "workflow_status", "short_name", "full_name"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getFieldsForCompanyInfo() {
|
public String[] getFieldsForCompanyInfo() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"id", "event_time", "event_user_id",
|
"id", "event_time", "event_user_id",
|
||||||
"company_info_id", "company_id", "clearing_member_category", "corporation_sole_type", "country_code", "description",
|
"company_info_id", "company_id", "corporation_sole_type", "country_code", "description",
|
||||||
"professional_sign", "legal_kind", "organization_type", "residence", "short_name", "full_name",
|
"professional_sign", "legal_kind", "organization_type", "residence", "short_name", "full_name",
|
||||||
"short_name_eng", "full_name_eng", "trading_code", "clearing_code", "registration_code"
|
"short_name_eng", "full_name_eng", "trading_code", "clearing_code", "registration_code"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class CompanyHistoryMapStore extends BusinessEventMapStore<CompanyHistory
|
||||||
* Перечисление значений полей CompanyInfo.
|
* Перечисление значений полей CompanyInfo.
|
||||||
* См. insertCompanyInfoStatement
|
* См. insertCompanyInfoStatement
|
||||||
*
|
*
|
||||||
* @param companyInfo должен быть заполнен id, company_id = company.id
|
* @param companyInfo должен быть заполнен id, company_id = company.id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected List<Object> companyInfoToSQLArgs(@NonNull CompanyInfo companyInfo, CompanyHistory rootUpdate) {
|
protected List<Object> companyInfoToSQLArgs(@NonNull CompanyInfo companyInfo, CompanyHistory rootUpdate) {
|
||||||
|
|
@ -97,7 +97,6 @@ public class CompanyHistoryMapStore extends BusinessEventMapStore<CompanyHistory
|
||||||
|
|
||||||
companyInfo.getId(), // company_info_id
|
companyInfo.getId(), // company_info_id
|
||||||
companyInfo.getCompanyId(),
|
companyInfo.getCompanyId(),
|
||||||
companyInfo.getClearingMemberCategory(),
|
|
||||||
companyInfo.getCorporationSoleType(),
|
companyInfo.getCorporationSoleType(),
|
||||||
companyInfo.getCountryCode(),
|
companyInfo.getCountryCode(),
|
||||||
companyInfo.getDescription(),
|
companyInfo.getDescription(),
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,15 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
@Override
|
@Override
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"id", "created_at", "updated_at", "trading_code", "clearing_code", "registration_code", "workflow_status", "short_name", "full_name"
|
"id", "created_at", "updated_at", "trading_code", "clearing_code", "registration_code", "workflow_status", "short_name", "full_name"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getFieldsForCompanyInfo() {
|
public String[] getFieldsForCompanyInfo() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"id", "company_id", "clearing_member_category", "corporation_sole_type", "country_code", "description",
|
"id", "company_id", "corporation_sole_type", "country_code", "description",
|
||||||
"professional_sign", "legal_kind", "organization_type", "residence", "short_name", "full_name",
|
"professional_sign", "legal_kind", "organization_type", "residence", "short_name", "full_name",
|
||||||
"short_name_eng", "full_name_eng", "trading_code", "clearing_code", "registration_code"
|
"short_name_eng", "full_name_eng", "trading_code", "clearing_code", "registration_code"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,7 +102,6 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
CompanyInfo companyInfo = new CompanyInfo();
|
CompanyInfo companyInfo = new CompanyInfo();
|
||||||
companyInfo.setId(rs.getObject("Id", Long.class));
|
companyInfo.setId(rs.getObject("Id", Long.class));
|
||||||
companyInfo.setCompanyId(rs.getObject("CompanyId", Long.class));
|
companyInfo.setCompanyId(rs.getObject("CompanyId", Long.class));
|
||||||
companyInfo.setClearingMemberCategory(rs.getString("ClearingMemberCategory"));
|
|
||||||
companyInfo.setCorporationSoleType(rs.getString("CorporationSoleType"));
|
companyInfo.setCorporationSoleType(rs.getString("CorporationSoleType"));
|
||||||
companyInfo.setCountryCode(rs.getString("CountryCode"));
|
companyInfo.setCountryCode(rs.getString("CountryCode"));
|
||||||
companyInfo.setDescription(rs.getString("Description"));
|
companyInfo.setDescription(rs.getString("Description"));
|
||||||
|
|
@ -133,14 +132,13 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
* Перечисление значений полей CompanyInfo.
|
* Перечисление значений полей CompanyInfo.
|
||||||
* См. insertCompanyInfoStatement
|
* См. insertCompanyInfoStatement
|
||||||
*
|
*
|
||||||
* @param companyInfo должен быть заполнен id, company_id = company.id
|
* @param companyInfo должен быть заполнен id, company_id = company.id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected List<Object> companyInfoToSQLArgs(@NonNull CompanyInfo companyInfo) {
|
protected List<Object> companyInfoToSQLArgs(@NonNull CompanyInfo companyInfo) {
|
||||||
List<Object> companyInfoArgs = new ArrayList<>(Arrays.asList(
|
List<Object> companyInfoArgs = new ArrayList<>(Arrays.asList(
|
||||||
companyInfo.getId(),
|
companyInfo.getId(),
|
||||||
companyInfo.getCompanyId(),
|
companyInfo.getCompanyId(),
|
||||||
companyInfo.getClearingMemberCategory(),
|
|
||||||
companyInfo.getCorporationSoleType(),
|
companyInfo.getCorporationSoleType(),
|
||||||
companyInfo.getCountryCode(),
|
companyInfo.getCountryCode(),
|
||||||
companyInfo.getDescription(),
|
companyInfo.getDescription(),
|
||||||
|
|
@ -155,7 +153,7 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
companyInfo.getTradingCode(),
|
companyInfo.getTradingCode(),
|
||||||
companyInfo.getClearingCode(),
|
companyInfo.getClearingCode(),
|
||||||
companyInfo.getRegistrationCode()
|
companyInfo.getRegistrationCode()
|
||||||
));
|
));
|
||||||
return companyInfoArgs;
|
return companyInfoArgs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue