Commit efb54c39 authored by helinlin's avatar helinlin

开发特种设备通讯录接口

parent 5becc960
...@@ -51,7 +51,7 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -51,7 +51,7 @@ public class InspectionServiceImpl implements InspectionService {
List<String> companyIds = idxFeignService.getTreeChildIds(dimensionTableId, selectValue).getResult(); List<String> companyIds = idxFeignService.getTreeChildIds(dimensionTableId, selectValue).getResult();
Collection<CompanyModel> companyModels = Privilege.companyClient.companyTreeWithoutAuth().getResult(); Collection<CompanyModel> companyModels = Privilege.companyClient.companyTreeWithoutAuth().getResult();
Map<String, String> companyMap = new HashMap<>(); Map<String, String> companyMap = new HashMap<>();
convertCompanyTreeToMap(companyModels, companyMap); convertCompanyTreeToMap(companyModels, null,companyMap);
IPage<IdxUjerDto> idxUjerPage = new Page<>(current, size); IPage<IdxUjerDto> idxUjerPage = new Page<>(current, size);
IPage<IdxUjerDto> page = idxUjerMapper.getPage(idxUjerPage, companyIds, bizType); IPage<IdxUjerDto> page = idxUjerMapper.getPage(idxUjerPage, companyIds, bizType);
List<IdxUjerDto> records = page.getRecords(); List<IdxUjerDto> records = page.getRecords();
...@@ -64,13 +64,20 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -64,13 +64,20 @@ public class InspectionServiceImpl implements InspectionService {
return page; return page;
} }
private void convertCompanyTreeToMap(Collection<CompanyModel> companyModels, Map<String, String> companyMap) { private void convertCompanyTreeToMap(Collection<CompanyModel> companyModels, Collection<Map<String, Object>> children, Map<String, String> companyMap) {
if (!CollectionUtils.isEmpty(companyModels)) { if (!CollectionUtils.isEmpty(companyModels)) {
for (CompanyModel companyModel : companyModels) { for (CompanyModel companyModel : companyModels) {
if (!ObjectUtils.isEmpty(companyModel)) { if (!ObjectUtils.isEmpty(companyModel)) {
companyMap.put(String.valueOf(companyModel.getSequenceNbr()), companyModel.getCompanyName()); companyMap.put(String.valueOf(companyModel.getSequenceNbr()), companyModel.getCompanyName());
Collection<CompanyModel> children = companyModel.getChildren(); convertCompanyTreeToMap(null, (Collection<Map<String, Object>>) companyModel.getChildren(), companyMap);
convertCompanyTreeToMap(children, companyMap); }
}
}
if (!CollectionUtils.isEmpty(children)) {
for (Map<String, Object> child : children) {
if (!ObjectUtils.isEmpty(child)) {
companyMap.put(String.valueOf(child.get("sequenceNbr")), String.valueOf(child.get("companyName")));
convertCompanyTreeToMap(null, (Collection<Map<String, Object>>) child.get("children"), companyMap);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment