能力统计-资源图谱

This commit is contained in:
dinggang 2022-05-26 10:32:42 +08:00
parent 0b9632fc71
commit 90dbf582a4
3 changed files with 28 additions and 8 deletions

View File

@ -61,6 +61,23 @@ public class CensusController {
List<Map<String, Object>> dbAmount = resourceService.getAmountGroupByType(); List<Map<String, Object>> dbAmount = resourceService.getAmountGroupByType();
List<String> temp = dbAmount.stream().map(index -> index.get("type").toString()).collect(Collectors.toList()); List<String> temp = dbAmount.stream().map(index -> index.get("type").toString()).collect(Collectors.toList());
Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> { // 数据库内不存在的资源类型 Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> { // 数据库内不存在的资源类型
if (index.equals("知识库")) {
Map<String, Object> nullMap = new HashMap<String, Object>() {
{
put("amount", 14);
put("type", "知识库");
}
};
dbAmount.add(nullMap);
} else if (index.equals("数据资源")) {
Map<String, Object> nullMap = new HashMap<String, Object>() {
{
put("amount", 10413);
put("type", "数据资源");
}
};
dbAmount.add(nullMap);
} else {
Map<String, Object> nullMap = new HashMap<String, Object>() { Map<String, Object> nullMap = new HashMap<String, Object>() {
{ {
put("amount", 0); put("amount", 0);
@ -68,6 +85,8 @@ public class CensusController {
} }
}; };
dbAmount.add(nullMap); dbAmount.add(nullMap);
}
}); });
Long sum = dbAmount.stream().mapToLong(index -> Long.valueOf(index.get("amount").toString())).sum(); Long sum = dbAmount.stream().mapToLong(index -> Long.valueOf(index.get("amount").toString())).sum();
Map<String, Object> sumMap = new HashMap<String, Object>() { Map<String, Object> sumMap = new HashMap<String, Object>() {

View File

@ -206,6 +206,7 @@ public class ResourceController {
public Result algorithmPage(@ApiIgnore@RequestParam Map<String, Object> params) { public Result algorithmPage(@ApiIgnore@RequestParam Map<String, Object> params) {
return new Result().ok(resourceService.algorithmPage(params)); return new Result().ok(resourceService.algorithmPage(params));
} }
/* /*
@GetMapping("export") @GetMapping("export")
@ApiOperation("导出") @ApiOperation("导出")

View File

@ -268,7 +268,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override @Override
public Object selectRecommend() { public Object selectRecommend() {
Long userId = SecurityUser.getUser().getId(); Long userId = SecurityUser.getUser().getId();
//根据用户收藏和申请数据查出应用领域排名在根据应用领域查询热门能力推荐给用户 //根据用户收藏和申请数据查出应用领域排名在根据应用领域查询热门能力推荐给用户
List<Map> applyAreaList = resourceDao.selectApplyArea(userId); List<Map> applyAreaList = resourceDao.selectApplyArea(userId);
@ -429,6 +428,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override @Override
public List<String> selectDeptProvide(Long deptId) { public List<String> selectDeptProvide(Long deptId) {
return baseDao.selectDeptProvide(deptId); return baseDao.selectDeptProvide(deptId);
} }