Compare commits

..

No commits in common. "633a1316194c8b6a23bda8864ed7b49fabc5233a" and "593516266a2588cd38ffa6a66da0af8f034600a0" have entirely different histories.

3 changed files with 0 additions and 97 deletions

View File

@ -1,3 +0,0 @@
ALTER TABLE `share_platform`.`tb_data_attr`
ADD INDEX `resource_id`(`data_resource_id`),
ADD FULLTEXT INDEX `attr_value`(`attr_type`, `attr_value`);

View File

@ -198,95 +198,4 @@ public class CensusControllerV2 {
return result; return result;
} }
@GetMapping("/assemblerInfo")
@ApiOperation("组件服务简况")
@LogOperation("组件服务简况")
public Result<List<Map<String, Object>>> assemblerInfo() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
CompletableFuture<Void> allAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='组件服务' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "上架总数");
}
});
});
CompletableFuture<Void> aiAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台智能算法组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(DISTINCT tb_data_resource.id) FROM tb_data_resource WHERE tb_data_resource.del_flag = 0 AND EXISTS(SELECT tb_data_attr.id FROM tb_data_attr WHERE tb_data_attr.data_resource_id = tb_data_resource.id AND tb_data_attr.attr_value = '智能算法' AND attr_type = '组件类型')", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "智能算法");
}
});
});
CompletableFuture<Void> gisAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台图层服务组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(DISTINCT tb_data_resource.id) FROM tb_data_resource WHERE tb_data_resource.del_flag = 0 AND EXISTS(SELECT tb_data_attr.id FROM tb_data_attr WHERE tb_data_attr.data_resource_id = tb_data_resource.id AND tb_data_attr.attr_value = '图层服务' AND attr_type = '组件类型')", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "图层服务");
}
});
});
CompletableFuture<Void> busAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台业务组件组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(DISTINCT tb_data_resource.id) FROM tb_data_resource WHERE tb_data_resource.del_flag = 0 AND EXISTS(SELECT tb_data_attr.id FROM tb_data_attr WHERE tb_data_attr.data_resource_id = tb_data_resource.id AND tb_data_attr.attr_value = '业务组件' AND attr_type = '组件类型')", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "业务组件");
}
});
});
CompletableFuture<Void> devAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台业务组件组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(DISTINCT tb_data_resource.id) FROM tb_data_resource WHERE tb_data_resource.del_flag = 0 AND EXISTS(SELECT tb_data_attr.id FROM tb_data_attr WHERE tb_data_attr.data_resource_id = tb_data_resource.id AND tb_data_attr.attr_value = '开发组件' AND attr_type = '组件类型')", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "开发组件");
}
});
});
CompletableFuture<Void> all = CompletableFuture.allOf(allAssemblyAmount, aiAssemblyAmount, gisAssemblyAmount, busAssemblyAmount, devAssemblyAmount);
all.join();
return new Result().ok(result);
}
@GetMapping("/knowledgeInfo")
@ApiOperation("知识库简况")
@LogOperation("知识库简况")
public Result<List<Map<String, Object>>> knowledgeInfo() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
CompletableFuture<Void> allKnowledgeAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总知识库数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "知识库上架总量");
}
});
});
CompletableFuture<Void> allKnowledgeVisitsAmount = CompletableFuture.supplyAsync(() -> { // 获取平台知识库浏览量
return jdbcTemplate.queryForObject("SELECT SUM(visits)visits FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("type", "知识库总浏览量");
}
});
});
CompletableFuture<Void> all = CompletableFuture.allOf(allKnowledgeAmount, allKnowledgeVisitsAmount);
all.join();
return new Result().ok(result);
}
} }

View File

@ -1,3 +0,0 @@
ALTER TABLE `share_platform`.`tb_data_attr`
ADD INDEX `resource_id`(`data_resource_id`),
ADD FULLTEXT INDEX `attr_value`(`attr_type`, `attr_value`);