1、继续新增新能力统计页面部分后台代码
This commit is contained in:
parent
9e807ed118
commit
1396b9ea71
|
@ -113,15 +113,18 @@ public class CensusControllerV3 {
|
|||
|
||||
/**
|
||||
* 组件评分情况 1 2 3 4 5评分分布
|
||||
* @param id 部门id
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/assemblerScoreInfo")
|
||||
@ApiOperation("组件评分情况")
|
||||
@LogOperation("组件评分情况")
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
||||
public Result<List<Map<String, Object>>> assemblerScoreInfo(Long id){
|
||||
Object[] args = {id};
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String, Object>>> assemblerScoreInfo(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Object[] args = {params.get("resourceType"),params.get("id")};
|
||||
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT COUNT(a.score) as scoreNum,a.score FROM \n" +
|
||||
"tb_resource_score a\n" +
|
||||
"INNER JOIN \n" +
|
||||
|
@ -129,7 +132,7 @@ public class CensusControllerV3 {
|
|||
"ON \n" +
|
||||
"a.resource_id = b.id\n" +
|
||||
"WHERE \n" +
|
||||
"b.type = '组件服务'\n" +
|
||||
"b.type = ?\n" +
|
||||
"AND\n" +
|
||||
"b.dept_id = ?\n" +
|
||||
"AND\n" +
|
||||
|
@ -148,21 +151,24 @@ public class CensusControllerV3 {
|
|||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("/assemblerCollectionTopInfo")
|
||||
@ApiOperation("TOP5被收藏的组件和数量")
|
||||
@LogOperation("TOP5被收藏的组件和数量")
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
||||
public Result<List<Map<String, Object>>> assemblerCollectionTopInfo(Long id){
|
||||
Object[] args = {id};
|
||||
@GetMapping("/assemblerCaredTopInfo")
|
||||
@ApiOperation("TOP5被申请的组件和数量")
|
||||
@LogOperation("TOP5被申请的组件和数量")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String, Object>>> assemblerCaredTopInfo(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Object[] args = {params.get("id"),params.get("resourceType")};
|
||||
|
||||
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT a.resource_id,b.name,COUNT(a.id) AS collectionNum\n" +
|
||||
"FROM tb_resource_collection a \n" +
|
||||
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT a.resource_id,b.name,COUNT(a.id) AS resourceCarNum\n" +
|
||||
"FROM tb_resource_car a \n" +
|
||||
"INNER JOIN tb_data_resource b \n" +
|
||||
"ON a.resource_id = b.id\n" +
|
||||
"WHERE\n" +
|
||||
"b.dept_id = ?\n" +
|
||||
"AND\n" +
|
||||
"b.type = '组件服务'\n" +
|
||||
"b.type = ?\n" +
|
||||
"AND \n" +
|
||||
"a.del_flag = 0\n" +
|
||||
"\n" +
|
||||
|
@ -194,8 +200,12 @@ public class CensusControllerV3 {
|
|||
@GetMapping("/assemblerUseTopInfo")
|
||||
@ApiOperation("TOP5使用组件")
|
||||
@LogOperation("TOP5使用组件")
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
||||
public Result<List<Map<String, Object>>> assemblerUseTopInfo(Long id){
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String, Object>>> assemblerUseTopInfo(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -222,8 +232,69 @@ public class CensusControllerV3 {
|
|||
return null;
|
||||
}
|
||||
|
||||
//以下是应用资源点击详情显示
|
||||
@GetMapping("resourceAttrReleaseDetail")
|
||||
@ApiOperation("算法、图层、开发、业务发布量情况分布")
|
||||
@LogOperation("算法、图层、开发、业务发布量情况分布")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String, Object>>> resourceAttrReleaseDetail(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Object[] ps = {params.get("resourceType"),params.get("id")};
|
||||
List<Map<String, Object>> result = jdbcTemplate.queryForList("SELECT b.attr_value,COUNT(b.id) AS num from tb_data_resource a inner join tb_data_attr b on a.id = b.data_resource_id\n" +
|
||||
"where a.type = ? and a.dept_id = ? and (INSTR( b.attr_value , '算法' ) > 0 OR INSTR( b.attr_value , '图层' ) > 0\n" +
|
||||
" OR INSTR( b.attr_value , '开发' ) > 0 OR INSTR( b.attr_value , '业务' ) > 0 )\n" +
|
||||
"group by b.attr_value", ps);
|
||||
return new Result<List<Map<String,Object>>>().ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("applicationAreaCapabilitySet")
|
||||
@ApiOperation("应用领域分布情况")
|
||||
@LogOperation("应用领域分布情况")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String,Object>>> applicationAreaCapabilitySet(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return new Result<List<Map<String,Object>>>().ok(resourceService.applicationAreaCapabilitySet(params));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//以下是应用资源点击详情显示
|
||||
@GetMapping("/applicationStateCapabilitySet")
|
||||
@ApiOperation("应用状态分布情况")
|
||||
@LogOperation("应用状态分布情况")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String,Object>>> applicationStateCapabilitySet(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Object[] ps = {params.get("id"),params.get("resourceType")};
|
||||
List<Map<String, Object>> result = jdbcTemplate.queryForList("SELECT COUNT(b.id) as num,b.attr_value as state from tb_data_resource a inner join tb_data_attr b\n" +
|
||||
"on a.id = b.data_resource_id \n" +
|
||||
"where a.del_flag = 0 and a.dept_id = ? and a.type = ? and b.attr_type = '应用状态'\n" +
|
||||
"group by b.attr_value", ps);
|
||||
|
||||
return new Result<List<Map<String,Object>>>().ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("/applicationReleaseCapabilitySet")
|
||||
@ApiOperation("发布端应用分布情况")
|
||||
@LogOperation("发布端应用分布情况")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<List<Map<String,Object>>> applicationReleaseCapabilitySet(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Object[] ps = {params.get("id"),params.get("resourceType")};
|
||||
List<Map<String, Object>> result = jdbcTemplate.queryForList("SELECT COUNT(b.id) as num,b.attr_value as publisher from tb_data_resource a inner join tb_data_attr b\n" +
|
||||
"on a.id = b.data_resource_id \n" +
|
||||
"where a.del_flag = 0 and a.dept_id = ? and a.type = ? and b.attr_type = '发布端'\n" +
|
||||
"group by b.attr_value", ps);
|
||||
|
||||
return new Result<List<Map<String,Object>>>().ok(result);
|
||||
}
|
||||
//以下是基础设施和数据资源使用情况点击详情(申请明细)
|
||||
@GetMapping("/assemblerCarDetail")
|
||||
@ApiOperation("基础设施或数据资源使用情况之申请明细")
|
||||
|
@ -239,4 +310,26 @@ public class CensusControllerV3 {
|
|||
|
||||
return new Result<List<Map<String,Object>>>().ok(result);
|
||||
}
|
||||
|
||||
//以下是知识库点击详情展示
|
||||
@GetMapping("/knowledgeBaseDistriDetail")
|
||||
@ApiOperation("知识库分布情况")
|
||||
@LogOperation("知识库分布情况")
|
||||
@ApiImplicitParam(name = "id",value = "行政部门编号", paramType = "query", dataType = "Long")
|
||||
public Result<List<Map<String, Object>>> knowledgeBaseDistriDetail(Long id){
|
||||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("knowledgeBaseReleaseDetail")
|
||||
@ApiOperation("知识库发布时间统计(按月)")
|
||||
@LogOperation("知识库发布时间统计(按月)")
|
||||
public Result<List<Map<String, Object>>> knowledgeBaseReleaseDetail(Long id){
|
||||
Object[] ps = {id};
|
||||
List<Map<String, Object>> result = jdbcTemplate.queryForList("SELECT COUNT(id) as num, MONTH(create_date) AS time FROM tb_data_resource \n" +
|
||||
"WHERE type = '知识库' AND YEAR(create_date) = YEAR(CURDATE()) AND del_flag = 0 AND dept_id = ?\n" +
|
||||
"GROUP BY YEAR(create_date),MONTH(create_date) ORDER BY MONTH(create_date)\n", ps);
|
||||
|
||||
return new Result<List<Map<String,Object>>>().ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -119,4 +119,5 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
|||
Integer selectResourceShare(Map params);
|
||||
// List<Map<String,Object>> selectDeptList(Map params);
|
||||
List<Map<String,Object>> selectResurceCarDetails(Map params);
|
||||
List<Map<String,Object>> applicationAreaCapabilitySet(Map params);
|
||||
}
|
|
@ -93,4 +93,5 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
|
|||
List<Map<String,Object>> resourceDatasDetails(Map<String,Object> params);
|
||||
List<Map<String,Object>> resourceKnowledgeDetails(Map<String,Object> params);
|
||||
List<Map<String,Object>> assemblerCarDetail(Map<String,Object> params);
|
||||
List<Map<String,Object>> applicationAreaCapabilitySet(Map params);
|
||||
}
|
|
@ -694,6 +694,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> applicationAreaCapabilitySet(Map params){
|
||||
return resourceDao.applicationAreaCapabilitySet(params);
|
||||
}
|
||||
@Override
|
||||
public Object selectResourceListByType(String type) {
|
||||
return resourceDao.selectByType(type);
|
||||
|
@ -1140,7 +1144,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
result = jdbcTemplate.queryForList("\n" +
|
||||
"SELECT a.*,b.username,c.name as resourcename from tb_resource_car a inner join sys_user b on a.user_id = b.id \n" +
|
||||
"inner join tb_data_resource c on a.resource_id = c.id \n" +
|
||||
"where b.dept_id = ? and c.type = ?\n" +
|
||||
"where a.del_flg = 0 AND b.dept_id = ? and c.type = ?\n" +
|
||||
"order by a.create_date desc \n" +
|
||||
"limit ?,?\n",ps);
|
||||
|
||||
|
|
|
@ -898,6 +898,22 @@
|
|||
GROUP BY
|
||||
type
|
||||
</select>
|
||||
<select id="applicationAreaCapabilitySet" parameterType="java.util.Map" resultType="java.util.Map">
|
||||
SELECT
|
||||
SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) AS type ,
|
||||
COUNT( tdav.data_resource_id ) AS total
|
||||
FROM
|
||||
(select a.* from tb_data_attr a inner join tb_data_resource c on a.data_resource_id = c.id where c.type = #{resourceType} AND c.dept_id = #{id} ) tdav
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
|
||||
';', '' ) ) + 1 )
|
||||
WHERE
|
||||
1 = 1
|
||||
AND tdav.attr_type = '应用领域'
|
||||
AND tdav.del_flag = 0
|
||||
AND SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) != ''
|
||||
GROUP BY
|
||||
type
|
||||
</select>
|
||||
|
||||
<select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map">
|
||||
SELECT
|
||||
|
|
Loading…
Reference in New Issue