Compare commits
4 Commits
274e1bbfa8
...
9a6358bd5d
Author | SHA1 | Date |
---|---|---|
yitonglei | 9a6358bd5d | |
yitonglei | a18d98e0b3 | |
yitonglei | 510c2806cb | |
yitonglei | 1396b9ea71 |
|
@ -4,22 +4,24 @@ import io.renren.common.annotation.LogOperation;
|
||||||
import io.renren.common.constant.Constant;
|
import io.renren.common.constant.Constant;
|
||||||
import io.renren.common.utils.Result;
|
import io.renren.common.utils.Result;
|
||||||
import io.renren.modules.resource.service.ResourceService;
|
import io.renren.modules.resource.service.ResourceService;
|
||||||
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
|
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||||
|
import io.renren.modules.sys.service.SysDeptService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
@ -36,6 +38,8 @@ public class CensusControllerV3 {
|
||||||
private ResourceService resourceService;
|
private ResourceService resourceService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
@Autowired
|
||||||
|
private SysDeptService sysDeptService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -113,15 +117,18 @@ public class CensusControllerV3 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件评分情况 1 2 3 4 5评分分布
|
* 组件评分情况 1 2 3 4 5评分分布
|
||||||
* @param id 部门id
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/assemblerScoreInfo")
|
@GetMapping("/assemblerScoreInfo")
|
||||||
@ApiOperation("组件评分情况")
|
@ApiOperation("组件评分情况")
|
||||||
@LogOperation("组件评分情况")
|
@LogOperation("组件评分情况")
|
||||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
@ApiImplicitParams({
|
||||||
public Result<List<Map<String, Object>>> assemblerScoreInfo(Long id){
|
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||||
Object[] args = {id};
|
@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" +
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT COUNT(a.score) as scoreNum,a.score FROM \n" +
|
||||||
"tb_resource_score a\n" +
|
"tb_resource_score a\n" +
|
||||||
"INNER JOIN \n" +
|
"INNER JOIN \n" +
|
||||||
|
@ -129,7 +136,7 @@ public class CensusControllerV3 {
|
||||||
"ON \n" +
|
"ON \n" +
|
||||||
"a.resource_id = b.id\n" +
|
"a.resource_id = b.id\n" +
|
||||||
"WHERE \n" +
|
"WHERE \n" +
|
||||||
"b.type = '组件服务'\n" +
|
"b.type = ?\n" +
|
||||||
"AND\n" +
|
"AND\n" +
|
||||||
"b.dept_id = ?\n" +
|
"b.dept_id = ?\n" +
|
||||||
"AND\n" +
|
"AND\n" +
|
||||||
|
@ -148,21 +155,24 @@ public class CensusControllerV3 {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/assemblerCollectionTopInfo")
|
@GetMapping("/assemblerCaredTopInfo")
|
||||||
@ApiOperation("TOP5被收藏的组件和数量")
|
@ApiOperation("TOP5被申请的组件和数量")
|
||||||
@LogOperation("TOP5被收藏的组件和数量")
|
@LogOperation("TOP5被申请的组件和数量")
|
||||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
@ApiImplicitParams({
|
||||||
public Result<List<Map<String, Object>>> assemblerCollectionTopInfo(Long id){
|
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long"),
|
||||||
Object[] args = {id};
|
@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" +
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT a.resource_id,b.name,COUNT(a.id) AS resourceCarNum\n" +
|
||||||
"FROM tb_resource_collection a \n" +
|
"FROM tb_resource_car a \n" +
|
||||||
"INNER JOIN tb_data_resource b \n" +
|
"INNER JOIN tb_data_resource b \n" +
|
||||||
"ON a.resource_id = b.id\n" +
|
"ON a.resource_id = b.id\n" +
|
||||||
"WHERE\n" +
|
"WHERE\n" +
|
||||||
"b.dept_id = ?\n" +
|
"b.dept_id = ?\n" +
|
||||||
"AND\n" +
|
"AND\n" +
|
||||||
"b.type = '组件服务'\n" +
|
"b.type = ?\n" +
|
||||||
"AND \n" +
|
"AND \n" +
|
||||||
"a.del_flag = 0\n" +
|
"a.del_flag = 0\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
@ -182,20 +192,18 @@ public class CensusControllerV3 {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/assemblerUsedDistriInfo")
|
|
||||||
@ApiOperation("应用领域分布情况")
|
|
||||||
@LogOperation("应用领域分布情况")
|
|
||||||
public Result<List<Map<String, Object>>> assemblerUsedDistriInfo(Long id){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//以下是组件使用情况点击详情
|
//以下是组件使用情况点击详情
|
||||||
|
|
||||||
@GetMapping("/assemblerUseTopInfo")
|
@GetMapping("/assemblerUseTopInfo")
|
||||||
@ApiOperation("TOP5使用组件")
|
@ApiOperation("TOP5使用组件")
|
||||||
@LogOperation("TOP5使用组件")
|
@LogOperation("TOP5使用组件")
|
||||||
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
|
@ApiImplicitParams({
|
||||||
public Result<List<Map<String, Object>>> assemblerUseTopInfo(Long id){
|
@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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,12 +216,6 @@ public class CensusControllerV3 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/assemblerUseDistriInfo")
|
|
||||||
@ApiOperation("用组件应用领域分布情况")
|
|
||||||
@LogOperation("用组件应用领域分布情况")
|
|
||||||
public Result<List<Map<String, Object>>> assemblerUseDistriInfo(Long id){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/assemblerUseScoreTopInfo")
|
@GetMapping("/assemblerUseScoreTopInfo")
|
||||||
@ApiOperation("使用组件评分top5")
|
@ApiOperation("使用组件评分top5")
|
||||||
|
@ -222,7 +224,102 @@ public class CensusControllerV3 {
|
||||||
return null;
|
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("applicationAreaCapabilityList")
|
||||||
|
@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>>> applicationAreaCapabilityList(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return new Result<List<Map<String,Object>>>().ok(resourceService.applicationAreaCapabilityList(params));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("applicationUsedAreaCapabilityList")
|
||||||
|
@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>>> applicationUsedAreaCapabilityList(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//以下是应用资源点击详情显示
|
//以下是应用资源点击详情显示
|
||||||
|
@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("/applicationUsedCapabilityNum")
|
||||||
|
@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>>> applicationUsedCapabilityNum(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
|
List<Map<String,Object>> result = new ArrayList<>();
|
||||||
|
Object[] ps = {params.get("resourceType"),params.get("id")};
|
||||||
|
result = jdbcTemplate.queryForList("SELECT a.name,b.attr_value FROM tb_data_resource a INNER JOIN tb_data_attr b \n" +
|
||||||
|
"ON a.id = b.data_resource_id\n" +
|
||||||
|
"WHERE a.type = ? and a.dept_id = ?\n" +
|
||||||
|
"and b.attr_type = '应用领域'",ps);
|
||||||
|
result.forEach(r->{
|
||||||
|
String[] strArr = r.get("attr_value").toString().split(",");
|
||||||
|
r.put("usedNum",strArr.length);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new Result<List<Map<String,Object>>>().ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
//以下是基础设施和数据资源使用情况点击详情(申请明细)
|
//以下是基础设施和数据资源使用情况点击详情(申请明细)
|
||||||
@GetMapping("/assemblerCarDetail")
|
@GetMapping("/assemblerCarDetail")
|
||||||
|
@ -239,4 +336,82 @@ public class CensusControllerV3 {
|
||||||
|
|
||||||
return new Result<List<Map<String,Object>>>().ok(result);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试获取部门树
|
||||||
|
* @param keywords
|
||||||
|
* @param deptId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("treeList")
|
||||||
|
@ApiOperation("根据当前用户所在部门查询下属部门tree,可以根据部门名称模糊查询")
|
||||||
|
public Result<List<SysDeptDTO>> treeList(@RequestParam(required = false,value = "模糊查询,部门名称") String keywords,Long deptId){
|
||||||
|
List<SysDeptDTO> result = new ArrayList<>();
|
||||||
|
SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
|
||||||
|
|
||||||
|
//市大数据局展示全部部门,区大数据局展示本区所有部门,委办局展示自己部门及下级部门
|
||||||
|
if(StringUtils.contains(sysDeptDTO.getName(),"青岛市大数据发展管理局")){//市大数据局
|
||||||
|
List<Map<String,Object>> deptMaps = jdbcTemplate.queryForList("SELECT id FROM sys_dept where pid = 0");
|
||||||
|
deptMaps.forEach(dept->{
|
||||||
|
List<SysDeptDTO> depts = sysDeptService.getDeptListByPid(Long.valueOf(dept.get("id").toString()));
|
||||||
|
result.addAll(depts);
|
||||||
|
});
|
||||||
|
}else if(StringUtils.contains(sysDeptDTO.getName(),"大数据") && sysDeptDTO.getType() == 3){//各区大数据局
|
||||||
|
|
||||||
|
List<SysDeptDTO> depts = sysDeptService.getDeptListByPid(sysDeptDTO.getPid());
|
||||||
|
result.addAll(depts);
|
||||||
|
}else{
|
||||||
|
List<SysDeptDTO> deptListByPid = sysDeptService.getDeptListByPid(deptId);
|
||||||
|
result.addAll(deptListByPid);
|
||||||
|
}
|
||||||
|
if(keywords != null){
|
||||||
|
treeMatch(result,keywords);
|
||||||
|
}
|
||||||
|
System.out.println("部门树--》"+result.size());
|
||||||
|
return new Result<List<SysDeptDTO>>().ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void treeMatch(List<SysDeptDTO> anyLevelCategoryList, String keyword) {
|
||||||
|
Iterator<SysDeptDTO> iter = anyLevelCategoryList.iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
// 获取当前遍历到的目录
|
||||||
|
SysDeptDTO category = iter.next();
|
||||||
|
// 如果当前目录名称包含关键字,则什么也不做(不移除),否则就看下一级
|
||||||
|
if (!category.getName().contains(keyword)) {
|
||||||
|
// 取出下一级目录集合
|
||||||
|
List<SysDeptDTO> childrenCategoryList = category.getChildren();
|
||||||
|
// 递归
|
||||||
|
if (!CollectionUtils.isEmpty(childrenCategoryList)) {
|
||||||
|
treeMatch(childrenCategoryList, keyword);
|
||||||
|
}
|
||||||
|
// 下一级目录看完了,如果下一级目录全部被移除,则移除当前目录
|
||||||
|
if (CollectionUtils.isEmpty(category.getChildren())) {
|
||||||
|
iter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,4 +119,6 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
|
||||||
Integer selectResourceShare(Map params);
|
Integer selectResourceShare(Map params);
|
||||||
// List<Map<String,Object>> selectDeptList(Map params);
|
// List<Map<String,Object>> selectDeptList(Map params);
|
||||||
List<Map<String,Object>> selectResurceCarDetails(Map params);
|
List<Map<String,Object>> selectResurceCarDetails(Map params);
|
||||||
|
List<Map<String,Object>> applicationAreaCapabilityList(Map params);
|
||||||
|
List<Map<String,Object>> applicationUsedAreaCapabilityList(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>> resourceDatasDetails(Map<String,Object> params);
|
||||||
List<Map<String,Object>> resourceKnowledgeDetails(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>> assemblerCarDetail(Map<String,Object> params);
|
||||||
|
List<Map<String,Object>> applicationAreaCapabilityList(Map params);
|
||||||
}
|
}
|
|
@ -733,6 +733,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> applicationAreaCapabilityList(Map params){
|
||||||
|
return resourceDao.applicationAreaCapabilityList(params);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object selectResourceListByType(String type) {
|
public Object selectResourceListByType(String type) {
|
||||||
return resourceDao.selectByType(type);
|
return resourceDao.selectByType(type);
|
||||||
|
@ -1181,7 +1186,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
"INNER JOIN tb_data_resource c ON a.resource_id = c.id \n" +
|
"INNER JOIN tb_data_resource c ON a.resource_id = c.id \n" +
|
||||||
"WHERE b.dept_id = ? AND c.type = ?\n" +
|
"WHERE b.dept_id = ? AND c.type = ?\n" +
|
||||||
"ORDER BY a.create_date DESC \n" +
|
"ORDER BY a.create_date DESC \n" +
|
||||||
"LIMIT ?,?\n", ps);
|
"LIMIT ?,?\n",ps);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package io.renren.modules.sys.controller;
|
package io.renren.modules.sys.controller;
|
||||||
|
|
||||||
import io.renren.common.annotation.LogOperation;
|
import io.renren.common.annotation.LogOperation;
|
||||||
|
import io.renren.common.dao.BaseDao;
|
||||||
import io.renren.common.utils.Result;
|
import io.renren.common.utils.Result;
|
||||||
import io.renren.common.validator.AssertUtils;
|
import io.renren.common.validator.AssertUtils;
|
||||||
import io.renren.common.validator.ValidatorUtils;
|
import io.renren.common.validator.ValidatorUtils;
|
||||||
|
@ -12,14 +13,18 @@ import io.renren.modules.sys.dto.SysDeptDTO;
|
||||||
import io.renren.modules.sys.service.SysDeptService;
|
import io.renren.modules.sys.service.SysDeptService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理
|
* 部门管理
|
||||||
|
@ -31,6 +36,8 @@ import java.util.List;
|
||||||
public class SysDeptController {
|
public class SysDeptController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDeptService sysDeptService;
|
private SysDeptService sysDeptService;
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
/** ytl 2022-06-23 新增 start **/
|
/** ytl 2022-06-23 新增 start **/
|
||||||
@GetMapping("treeList")
|
@GetMapping("treeList")
|
||||||
|
|
|
@ -898,6 +898,41 @@
|
||||||
GROUP BY
|
GROUP BY
|
||||||
type
|
type
|
||||||
</select>
|
</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
|
||||||
|
tb_data_attr 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="applicationAreaCapabilityList" 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="applicationUsedAreaCapabilityList" parameterType="java.util.Map" resultType="java.util.Map">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map">
|
<select id="selectTopFiveComponentServiceApplications" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -1079,4 +1114,6 @@
|
||||||
c.name
|
c.name
|
||||||
LIMIT ${pageNum}, ${pageSize}
|
LIMIT ${pageNum}, ${pageSize}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue