fix bugs
This commit is contained in:
parent
718bb594ef
commit
c1de35e101
2 changed files with 3 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ public class EditCompanyInfoController extends AbstractQueueController {
|
||||||
Collection<Map<String, Object>> all = new ArrayList<>();
|
Collection<Map<String, Object>> all = new ArrayList<>();
|
||||||
Collection<Company> companies = companyImdg.getAllValues();
|
Collection<Company> companies = companyImdg.getAllValues();
|
||||||
for (Company company : companies) {
|
for (Company company : companies) {
|
||||||
if (company.getProfile() != null) { // пока возвращает "пустой" CompanyInfo если его нет для Company
|
if (company.getProfile() != null && company.getProfile().getId() != null) { // пока возвращает "пустой" CompanyInfo если его нет для Company
|
||||||
all.add(responseFactory.responseFromObject(company.getProfile()));
|
all.add(responseFactory.responseFromObject(company.getProfile()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
if (id == null)
|
if (id == null)
|
||||||
return null;
|
return null;
|
||||||
List<CompanyInfo> results = jdbcTemplate.query(
|
List<CompanyInfo> results = jdbcTemplate.query(
|
||||||
"SELECT * FROM COMPANY_INFO WHERE id = ?", new Object[]{id}, // todo id=comapny.id? Или сделать отдельный ID?
|
"SELECT * FROM COMPANY_INFO WHERE company_id = ?", new Object[]{id}, // todo id=comapny.id? Или сделать отдельный ID?
|
||||||
(rs, rowNum) -> {
|
(rs, rowNum) -> {
|
||||||
CompanyInfo companyInfo = new CompanyInfo();
|
CompanyInfo companyInfo = new CompanyInfo();
|
||||||
companyInfo.setId(rs.getObject("Id", Long.class));
|
companyInfo.setId(rs.getObject("Id", Long.class));
|
||||||
|
|
@ -126,7 +126,7 @@ public class CompanyMapStore extends BusinessObjectMapStore<Company> {
|
||||||
if (onceObject == null) {
|
if (onceObject == null) {
|
||||||
log.warn("No row in table COMPANY_INFO where id={}. Create empty ", id);
|
log.warn("No row in table COMPANY_INFO where id={}. Create empty ", id);
|
||||||
onceObject = new CompanyInfo();
|
onceObject = new CompanyInfo();
|
||||||
onceObject.setId(id); // чтобы не потерять id
|
onceObject.setCompanyId(id); // чтобы не потерять id
|
||||||
}
|
}
|
||||||
return onceObject;
|
return onceObject;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue