|
@@ -79,12 +79,46 @@ public class DataScreeningController extends BaseController
|
|
|
result.put("countCatalogue", countCatalogue);
|
|
|
|
|
|
// 行业分类饼图
|
|
|
- Map<String, List<ViewExt>> mapIndustry = viewList.stream().collect(Collectors.groupingBy(ViewExt::getIndustry));
|
|
|
- result.put("industryData", mapIndustry);
|
|
|
+ // 1. 先按照行业获取数据资源目录
|
|
|
+ // 2. 根据目录获取资源数量
|
|
|
+ List<Catalogue> catalogues = catalogueService.getCatalogueList();
|
|
|
+ Map<String, List<Catalogue>> mapIndustry = catalogues.stream().filter(map->map.getIndustry() != null).collect(Collectors.groupingBy(Catalogue::getIndustry,Collectors.toList()));
|
|
|
+ //
|
|
|
+ List<Map<String,Object>> industryData = new ArrayList<>();
|
|
|
+ mapIndustry.forEach((k, v) -> {
|
|
|
+ Map<String,Object> data = new HashMap<>();
|
|
|
+ String deptName = k;
|
|
|
+ List<Catalogue> listCatalogue = v;
|
|
|
+ int count = 0;
|
|
|
+ for(Catalogue c: listCatalogue){
|
|
|
+ List<ViewBaseInfo> views = viewService.getViewBaseInfoByOnlyParentId(c.getId());
|
|
|
+ count += views.size();
|
|
|
+ }
|
|
|
+ data.put("name",k);
|
|
|
+ data.put("value",count);
|
|
|
+ industryData.add(data);
|
|
|
+ });
|
|
|
+ result.put("industryData", industryData);
|
|
|
|
|
|
// 数据资源来源部门柱状图
|
|
|
- Map<String, List<ViewExt>> mapOriginDept = viewList.stream().collect(Collectors.groupingBy(ViewExt::getOriginDept));
|
|
|
- result.put("originDeptData", mapOriginDept);
|
|
|
+ // 1. 按照部门获取数据资源目录
|
|
|
+ // 2. 根据数据资源目录获取数据资源
|
|
|
+ Map<String, List<Catalogue>> mapOriginDept = catalogues.stream().filter(map->map.getOriginDept() != null).collect(Collectors.groupingBy(Catalogue::getOriginDept,Collectors.toList()));
|
|
|
+ List<Map<String,Object>> originDeptData = new ArrayList<>();
|
|
|
+ mapOriginDept.forEach((k, v) -> {
|
|
|
+ Map<String,Object> data = new HashMap<>();
|
|
|
+ String deptName = k;
|
|
|
+ List<Catalogue> listCatalogue = v;
|
|
|
+ int count = 0;
|
|
|
+ for(Catalogue c: listCatalogue){
|
|
|
+ List<ViewBaseInfo> views = viewService.getViewBaseInfoByOnlyParentId(c.getId());
|
|
|
+ count += views.size();
|
|
|
+ }
|
|
|
+ data.put("name",k);
|
|
|
+ data.put("value",count);
|
|
|
+ originDeptData.add(data);
|
|
|
+ });
|
|
|
+ result.put("originDeptData", originDeptData);
|
|
|
|
|
|
return ResponseEntity.status(HttpStatus.OK).body(result);
|
|
|
}
|