This commit is contained in:
parent
2059a69538
commit
aa6f1f55d5
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE tb_fuse ADD COLUMN `district` int(2) DEFAULT 0 COMMENT '赋能场景类型:0市级、1基层场景';
|
|
@ -380,7 +380,7 @@ public class CensusController {
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
|
@ApiImplicitParam(name = "deptId", value = "申请部门", paramType = "query", dataType = "long"),
|
||||||
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"),
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package io.renren.modules.activiti.controller;
|
package io.renren.modules.activiti.controller;
|
||||||
|
|
||||||
import com.alibaba.druid.pool.DruidDataSource;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.renren.common.annotation.LogOperation;
|
import io.renren.common.annotation.LogOperation;
|
||||||
|
@ -12,7 +11,6 @@ import io.renren.common.utils.Result;
|
||||||
import io.renren.modules.activiti.dto.BatchCompleteDTO;
|
import io.renren.modules.activiti.dto.BatchCompleteDTO;
|
||||||
import io.renren.modules.activiti.dto.TaskDTO;
|
import io.renren.modules.activiti.dto.TaskDTO;
|
||||||
import io.renren.modules.activiti.service.ActTaskService;
|
import io.renren.modules.activiti.service.ActTaskService;
|
||||||
import io.renren.modules.resource.service.impl.ResourceServiceImpl;
|
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
import io.renren.modules.security.user.UserDetail;
|
import io.renren.modules.security.user.UserDetail;
|
||||||
import io.renren.modules.sys.dto.SysUserDTO;
|
import io.renren.modules.sys.dto.SysUserDTO;
|
||||||
|
@ -29,6 +27,7 @@ import org.activiti.engine.task.TaskQuery;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -66,6 +65,7 @@ public class ActTaskController {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected TaskService taskService;
|
protected TaskService taskService;
|
||||||
|
|
||||||
|
private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户任务列表
|
* 获取用户任务列表
|
||||||
|
@ -449,13 +449,13 @@ public class ActTaskController {
|
||||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
||||||
|
|
||||||
})
|
})
|
||||||
public Result getZwyBusinessList(String name, String status, int pageNum, int pageSize) {
|
public Result getZwyBusinessList(String name, String status, int pageNum, int pageSize) {
|
||||||
UserDetail user = SecurityUser.getUser();
|
UserDetail user = SecurityUser.getUser();
|
||||||
JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, APPLYTYPE, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " +
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", " +
|
||||||
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND APPLYTYPE = '01' AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'");
|
"(CASE WHEN STATUS = '04' THEN '不通过' WHEN STATUS IN ('01', '03') THEN '审核中' ELSE '通过' END) AS \"STATUS\"" +
|
||||||
|
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND APPLYTYPE = '01' AND STATUS NOT IN ('00', '07', '99') AND ACCOUNT = '" + user.getUsername() + "'");
|
||||||
if (!StringUtils.isEmpty(name)) {
|
if (!StringUtils.isEmpty(name)) {
|
||||||
sql.append(" AND BUSINESS_NAME LIKE ('%' || '").append(name).append("' || '%') ");
|
sql.append(" AND BUSINESS_NAME LIKE ('%' || '").append(name).append("' || '%') ");
|
||||||
}
|
}
|
||||||
|
@ -463,7 +463,6 @@ public class ActTaskController {
|
||||||
sql.append(" AND STATUS = '").append(status).append("'");
|
sql.append(" AND STATUS = '").append(status).append("'");
|
||||||
}
|
}
|
||||||
sql.append(" ORDER BY CREATE_TIME DESC");
|
sql.append(" ORDER BY CREATE_TIME DESC");
|
||||||
logger.error("--->查询语句{}", sql);
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
|
@ -472,8 +471,8 @@ public class ActTaskController {
|
||||||
resultMap.put("list", list);
|
resultMap.put("list", list);
|
||||||
return new Result().ok(resultMap);
|
return new Result().ok(resultMap);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||||
logger.error("浪潮数据查询异常", e);
|
logger.error("浪潮数据查询异常", e);
|
||||||
|
|
||||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,9 +489,9 @@ public class ActTaskController {
|
||||||
|
|
||||||
})
|
})
|
||||||
public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) {
|
public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) {
|
||||||
JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
||||||
UserDetail user = SecurityUser.getUser();
|
UserDetail user = SecurityUser.getUser();
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " +
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", " +
|
||||||
|
"(CASE WHEN STATUS = '04' THEN '不通过' WHEN STATUS IN ('05', '06') THEN '通过' ELSE '审核中' END) AS \"STATUS\"" +
|
||||||
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'");
|
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'");
|
||||||
if (!StringUtils.isEmpty(name)) {
|
if (!StringUtils.isEmpty(name)) {
|
||||||
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
|
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
|
||||||
|
@ -501,7 +500,6 @@ public class ActTaskController {
|
||||||
sql.append(" AND STATUS = '").append(status).append("'");
|
sql.append(" AND STATUS = '").append(status).append("'");
|
||||||
}
|
}
|
||||||
sql.append(" ORDER BY CREATE_TIME DESC");
|
sql.append(" ORDER BY CREATE_TIME DESC");
|
||||||
logger.error("--->查询语句{}", sql);
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
|
@ -510,6 +508,7 @@ public class ActTaskController {
|
||||||
resultMap.put("list", list);
|
resultMap.put("list", list);
|
||||||
return new Result().ok(resultMap);
|
return new Result().ok(resultMap);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||||
logger.error("浪潮数据查询异常", e);
|
logger.error("浪潮数据查询异常", e);
|
||||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||||
}
|
}
|
||||||
|
@ -524,65 +523,73 @@ public class ActTaskController {
|
||||||
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
||||||
})
|
})
|
||||||
public Result getZwyBusinessInfoById(String id) {
|
public Result getZwyBusinessInfoById(String id) {
|
||||||
JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
||||||
try {
|
|
||||||
ArrayList<Map> arrayList = new ArrayList<>();
|
|
||||||
|
|
||||||
//云主机
|
|
||||||
CompletableFuture<Void> yzj = CompletableFuture.runAsync(() -> {
|
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云主机' AS \"SOURCE_TYPE\", NAME, DISPOSE AS \"INFO\" " +
|
ArrayList<Map> arrayList = new ArrayList<>();
|
||||||
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = '");
|
|
||||||
sql.append(id).append("'");
|
|
||||||
logger.error("--->查询语句{}", sql);
|
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
|
||||||
arrayList.addAll(list);
|
|
||||||
|
|
||||||
}, executor);
|
//云主机
|
||||||
|
CompletableFuture<Void> yzj = CompletableFuture.runAsync(() -> {
|
||||||
|
|
||||||
//云数据库
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云主机' AS \"SOURCE_TYPE\", NAME, DISPOSE AS \"INFO\" " +
|
||||||
CompletableFuture<Void> ysjk = CompletableFuture.runAsync(() -> {
|
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||||
|
sql.append(id).append("'");
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云数据库' AS \"SOURCE_TYPE\", NAME, (TYPE || '/' || STORAGE_SPACE || 'GB') AS \"INFO\" " +
|
List<Map<String, Object>> list = null;
|
||||||
" FROM VIEW_CLOUD_DATABASE_INFO WHERE 1 = 1 AND BSNUM = '");
|
try {
|
||||||
sql.append(id).append("'");
|
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
logger.error("--->查询语句{}", sql);
|
} catch (DataAccessException e) {
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
logger.error("查询浪潮数据库云主机数据异常,SQL语句--->{}", sql);
|
||||||
arrayList.addAll(list);
|
}
|
||||||
|
arrayList.addAll(list);
|
||||||
|
}, executor);
|
||||||
|
|
||||||
}, executor);
|
//云数据库
|
||||||
|
CompletableFuture<Void> ysjk = CompletableFuture.runAsync(() -> {
|
||||||
|
|
||||||
//对象存储
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云数据库' AS \"SOURCE_TYPE\", NAME, (TYPE || '/' || STORAGE_SPACE || 'GB') AS \"INFO\" " +
|
||||||
CompletableFuture<Void> dxcc = CompletableFuture.runAsync(() -> {
|
" FROM VIEW_CLOUD_DATABASE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||||
|
sql.append(id).append("'");
|
||||||
|
List<Map<String, Object>> list = null;
|
||||||
|
try {
|
||||||
|
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
logger.error("查询浪潮数据库云数据库数据异常,SQL语句--->{}", sql);
|
||||||
|
}
|
||||||
|
arrayList.addAll(list);
|
||||||
|
}, executor);
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '对象存储' AS \"SOURCE_TYPE\", NAME, (DATA_DISK || 'GB') AS \"INFO\" " +
|
//对象存储
|
||||||
" FROM VIEW_CLOUD_OBJECTSTORAGE_INFO WHERE 1 = 1 AND BSNUM = '");
|
CompletableFuture<Void> dxcc = CompletableFuture.runAsync(() -> {
|
||||||
sql.append(id).append("'");
|
|
||||||
logger.error("--->查询语句{}", sql);
|
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
|
||||||
arrayList.addAll(list);
|
|
||||||
|
|
||||||
}, executor);
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, '对象存储' AS \"SOURCE_TYPE\", NAME, (DATA_DISK || 'GB') AS \"INFO\" " +
|
||||||
|
" FROM VIEW_CLOUD_OBJECTSTORAGE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||||
|
sql.append(id).append("'");
|
||||||
|
List<Map<String, Object>> list = null;
|
||||||
|
try {
|
||||||
|
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
logger.error("查询浪潮数据库对象存储数据异常,SQL语句--->{}", sql);
|
||||||
|
}
|
||||||
|
arrayList.addAll(list);
|
||||||
|
}, executor);
|
||||||
|
|
||||||
//托管服务
|
//托管服务
|
||||||
CompletableFuture<Void> tgfw = CompletableFuture.runAsync(() -> {
|
CompletableFuture<Void> tgfw = CompletableFuture.runAsync(() -> {
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '托管服务' AS \"SOURCE_TYPE\", NAME, (U_NUM || 'U') AS \"INFO\" " +
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, '托管服务' AS \"SOURCE_TYPE\", NAME, (U_NUM || 'U') AS \"INFO\" " +
|
||||||
" FROM VIEW_TRUSTEESHIPSERVICE_INFO WHERE 1 = 1 AND BSNUM = '");
|
" FROM VIEW_TRUSTEESHIPSERVICE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||||
sql.append(id).append("'");
|
sql.append(id).append("'");
|
||||||
logger.error("--->查询语句{}", sql);
|
List<Map<String, Object>> list = null;
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
try {
|
||||||
arrayList.addAll(list);
|
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
logger.error("查询浪潮数据库托管服务数据异常,SQL语句--->{}", sql);
|
||||||
|
}
|
||||||
|
arrayList.addAll(list);
|
||||||
|
}, executor);
|
||||||
|
|
||||||
}, executor);
|
CompletableFuture all = CompletableFuture.allOf(yzj, ysjk, dxcc, tgfw);
|
||||||
|
all.join();
|
||||||
CompletableFuture all = CompletableFuture.allOf(yzj, ysjk, dxcc, tgfw);
|
return new Result().ok(arrayList);
|
||||||
all.join();
|
|
||||||
return new Result().ok(arrayList);
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("浪潮数据查询异常", e);
|
|
||||||
|
|
||||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,17 +600,15 @@ public class ActTaskController {
|
||||||
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
||||||
})
|
})
|
||||||
public Result getZwyVideoInfoById(String id) {
|
public Result getZwyVideoInfoById(String id) {
|
||||||
JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
||||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, CAMERATYPE, NAME, ORG_NAME " +
|
StringBuilder sql = new StringBuilder("SELECT BSNUM, CAMERATYPE, NAME, ORG_NAME " +
|
||||||
"FROM VIEW_VIDEO_BUSINESS_RELATION WHERE 1 = 1 AND BSNUM = '");
|
"FROM VIEW_VIDEO_BUSINESS_RELATION WHERE 1 = 1 AND BSNUM = '");
|
||||||
sql.append(id).append("'");
|
sql.append(id).append("'");
|
||||||
logger.error("--->查询语句{}", sql);
|
|
||||||
try {
|
try {
|
||||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||||
return new Result().ok(list);
|
return new Result().ok(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("浪潮数据查询异常", e);
|
logger.error("浪潮数据查询异常", e);
|
||||||
|
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,8 @@ public class FuseController {
|
||||||
@ApiImplicitParam(name = "description", value = "融合服务描述", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "description", value = "融合服务描述", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "type", value = "融合服务类型", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "type", value = "融合服务类型", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "applicationArea", value = "应用领域", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "applicationArea", value = "应用领域", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "int")
|
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "int"),
|
||||||
|
@ApiImplicitParam(name = "district", value = "赋能场景类型", paramType = "query", dataType = "int")
|
||||||
})
|
})
|
||||||
public Result<PageData<TbFuseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<TbFuseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
PageData<TbFuseDTO> page = tbFuseService.page(params);
|
PageData<TbFuseDTO> page = tbFuseService.page(params);
|
||||||
|
|
|
@ -58,6 +58,8 @@ public class TbFuseDTO {
|
||||||
private Integer dataSourceCount;
|
private Integer dataSourceCount;
|
||||||
@ApiModelProperty(value = "组件服务数量")
|
@ApiModelProperty(value = "组件服务数量")
|
||||||
private Integer componentCount;
|
private Integer componentCount;
|
||||||
|
@ApiModelProperty(value = "组件服务数量")
|
||||||
|
private Integer district;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,4 +79,6 @@ public class TbFuseEntity extends BaseEntity {
|
||||||
private Integer infrastructureCount;
|
private Integer infrastructureCount;
|
||||||
private Integer dataSourceCount;
|
private Integer dataSourceCount;
|
||||||
private Integer componentCount;
|
private Integer componentCount;
|
||||||
|
private Integer district;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,11 +77,13 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.client.RestClientException;
|
import org.springframework.web.client.RestClientException;
|
||||||
|
@ -251,29 +253,31 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
@Autowired
|
@Autowired
|
||||||
private TDemandDataDao tDemandDataDao;
|
private TDemandDataDao tDemandDataDao;
|
||||||
|
|
||||||
private static final String getAllsql = "SELECT\n" +
|
private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
||||||
"\tCOUNT( BSNUM ) AS \"count\",\n" +
|
|
||||||
"\t'yzy' AS \"type\",\n" +
|
private static final String getAllsql = "SELECT " +
|
||||||
"\tORG_NAME AS \"deptName\" \n" +
|
" COUNT( BSNUM ) AS \"count\", " +
|
||||||
"FROM\n" +
|
" 'yzy' AS \"type\", " +
|
||||||
"\tVIEW_CLOUD_BUSINESS_INDEX \n" +
|
" ORG_NAME AS \"deptName\" " +
|
||||||
"WHERE\n" +
|
"FROM " +
|
||||||
"\t1 = 1 \n" +
|
" VIEW_CLOUD_BUSINESS_INDEX " +
|
||||||
"\tAND APPLYTYPE = '01'\n" +
|
"WHERE " +
|
||||||
"\tAND STATUS NOT IN ('00', '07', '99')\n" +
|
" 1 = 1 " +
|
||||||
"GROUP BY\n" +
|
" AND APPLYTYPE = '01' " +
|
||||||
"\tORG_NAME UNION ALL\n" +
|
" AND STATUS NOT IN ('00', '07', '99') " +
|
||||||
"SELECT\n" +
|
"GROUP BY " +
|
||||||
"\tCOUNT( BSNUM ) AS \"count\",\n" +
|
" ORG_NAME UNION ALL " +
|
||||||
"\t'ysp' AS \"type\",\n" +
|
"SELECT " +
|
||||||
"\tORG_NAME AS \"deptName\" \n" +
|
" COUNT( BSNUM ) AS \"count\", " +
|
||||||
"FROM\n" +
|
" 'ysp' AS \"type\", " +
|
||||||
"\tVIEW_VIDEO_BUSINESS_INDEX \n" +
|
" ORG_NAME AS \"deptName\" " +
|
||||||
"WHERE\n" +
|
"FROM " +
|
||||||
"\t1 = 1 \n" +
|
" VIEW_VIDEO_BUSINESS_INDEX " +
|
||||||
"\tAND STATUS != '00'\n" +
|
"WHERE " +
|
||||||
"GROUP BY\n" +
|
" 1 = 1 " +
|
||||||
"\tORG_NAME";
|
" AND STATUS != '00' " +
|
||||||
|
"GROUP BY " +
|
||||||
|
" ORG_NAME";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
|
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
|
||||||
|
@ -2163,20 +2167,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
});
|
});
|
||||||
}, executor);
|
}, executor);
|
||||||
|
|
||||||
//2022-11-1 去除摄像头查询
|
|
||||||
//CompletableFuture<Void> infrastructureCount = CompletableFuture.runAsync(() -> { //基础设施
|
|
||||||
// HashMap<Object, Object> queryMap = new HashMap<>();
|
|
||||||
// queryMap.put("cameraName", keyWorld);
|
|
||||||
// Integer countNew = cameraChannelMapper.selectByParentIdCountNew(queryMap, null, "");
|
|
||||||
// resultList.add(new HashMap<String, Object>() {
|
|
||||||
// {
|
|
||||||
// put("count", countNew + "");
|
|
||||||
// put("type", "基础设施");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
//}, executor);
|
|
||||||
|
|
||||||
//统计增加会客厅搜索结果
|
//统计增加会客厅搜索结果
|
||||||
CompletableFuture<Void> meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor);
|
CompletableFuture<Void> meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor);
|
||||||
|
|
||||||
|
@ -2217,7 +2207,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object selectApplyDeptDetailTypeCountList(Map params) {
|
public Object selectApplyDeptDetailTypeCountList(Map params) {
|
||||||
JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
||||||
UserDetail user = SecurityUser.getUser();
|
UserDetail user = SecurityUser.getUser();
|
||||||
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
|
SysDeptDTO sysDeptDTO = deptService.get(user.getDeptId());
|
||||||
if (user.getSuperAdmin() == SuperAdminEnum.YES.value() || bigDataDeptName.equals(sysDeptDTO.getName())) {
|
if (user.getSuperAdmin() == SuperAdminEnum.YES.value() || bigDataDeptName.equals(sysDeptDTO.getName())) {
|
||||||
|
@ -2230,21 +2219,22 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())) {// 部门精准查
|
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())) {// 部门精准查
|
||||||
|
|
||||||
List<Map<String, Object>> zwyCountListByapplyDept = new ArrayList<>();
|
List<Map<String, Object>> zwyCountListByapplyDept = new ArrayList<>();
|
||||||
Map<String, Object> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString());
|
List<Map<String, Object>> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString());
|
||||||
if (lcDept.isEmpty() || org.apache.commons.lang3.StringUtils.isBlank(lcDept.get("lc_name").toString())) {
|
if (lcDept.isEmpty()) {
|
||||||
logger.error("未查询到{}对应的浪潮系统部门", params.get("provideDept").toString());
|
logger.error("未查询到{}对应的浪潮系统部门", params.get("deptId").toString());
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
} else {
|
} else {
|
||||||
StringBuilder sb = new StringBuilder("SELECT " +
|
StringBuilder sb = new StringBuilder("SELECT " +
|
||||||
" COUNT( BSNUM ) AS \"count\", " +
|
" COUNT( BSNUM ) AS \"count\", " +
|
||||||
" 'yzy' AS \"type\" " +
|
" 'yzy' AS \"type\" " +
|
||||||
"FROM " +
|
"FROM " +
|
||||||
" VIEW_CLOUD_BUSINESS_INDEX " +
|
" VIEW_CLOUD_BUSINESS_INDEX " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" 1 = 1 " +
|
" 1 = 1 " +
|
||||||
" AND ORG_NAME = '");
|
" AND ORG_NAME IN (");
|
||||||
sb.append(lcDept.get("lc_name").toString())
|
lcDept.forEach(x -> sb.append("'").append(x.get("lc_name").toString()).append("', "));
|
||||||
.append("' UNION ALL " +
|
sb.deleteCharAt(sb.length() - 2);
|
||||||
|
sb.append(") UNION ALL " +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
" COUNT( BSNUM ) AS \"count\", " +
|
" COUNT( BSNUM ) AS \"count\", " +
|
||||||
" 'ysp' AS \"type\" " +
|
" 'ysp' AS \"type\" " +
|
||||||
|
@ -2252,20 +2242,30 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
" VIEW_VIDEO_BUSINESS_INDEX " +
|
" VIEW_VIDEO_BUSINESS_INDEX " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" 1 = 1 " +
|
" 1 = 1 " +
|
||||||
" AND ORG_NAME = '")
|
" AND ORG_NAME IN (");
|
||||||
.append(lcDept.get("lc_name").toString())
|
lcDept.forEach(x -> sb.append("'").append(x.get("lc_name").toString()).append("', "));
|
||||||
.append("'");
|
sb.deleteCharAt(sb.length() - 2);
|
||||||
|
sb.append(")");
|
||||||
try {
|
try {
|
||||||
zwyCountListByapplyDept.addAll(lcJdbcTemplate.queryForList(sb.toString()));
|
zwyCountListByapplyDept.addAll(lcJdbcTemplate.queryForList(sb.toString()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(sb.toString(), e);
|
logger.error("查询浪潮数据库申SQL语句--->{}", sb);
|
||||||
|
logger.error("查询浪潮数据库异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Map<String, List<Map<String, Object>>> zwyCountListMap = zwyCountListByapplyDept.stream().collect(Collectors.groupingBy(m -> m.get("type").toString()));
|
||||||
|
|
||||||
List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params);
|
List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params);
|
||||||
if (!typeCountListByApplyDept.isEmpty() && !zwyCountListByapplyDept.isEmpty()) {
|
zwyCountListMap.forEach((k, v) -> {
|
||||||
typeCountListByApplyDept.get(0).putAll(zwyCountListByapplyDept.get(0));
|
Map<String, Object> zwyCountMap = new HashMap<>();
|
||||||
}
|
zwyCountMap.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
||||||
|
zwyCountMap.put("type", k);
|
||||||
|
zwyCountMap.put("deptName", params.get("deptId").toString());
|
||||||
|
zwyCountMap.put("district", 250000);
|
||||||
|
zwyCountMap.put("deptType", 2);
|
||||||
|
typeCountListByApplyDept.add(zwyCountMap);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
||||||
ArrayList<Map> resultList = new ArrayList<>();
|
ArrayList<Map> resultList = new ArrayList<>();
|
||||||
|
@ -2307,17 +2307,23 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
zwyCountListByApplyDept.forEach(x -> {
|
zwyCountListByApplyDept.forEach(x -> {
|
||||||
Map<String, Object> ucsDept = sysDeptDao.selectUCSDeptByLCDeptName(x.get("deptName").toString());
|
Map<String, Object> ucsDept = sysDeptDao.selectUCSDeptByLCDeptName(x.get("deptName").toString());
|
||||||
if (!ucsDept.isEmpty()) {
|
if (ucsDept != null && !ucsDept.isEmpty()) {
|
||||||
x.put("dept_id", ucsDept.get("ucs_id").toString());
|
logger.error("浪潮{}单位对应ucs单位为{}", x.get("deptName").toString(), ucsDept.get("ucs_name"));
|
||||||
x.put("deptType", ucsDept.get("type").toString());
|
x.put("dept_id", ucsDept.get("ucs_id"));
|
||||||
x.put("district", ucsDept.get("district").toString());
|
x.put("deptType", ucsDept.get("type"));
|
||||||
x.replace("deptName", ucsDept.get("ucs_name").toString());
|
x.put("district", ucsDept.get("district"));
|
||||||
|
x.replace("deptName", ucsDept.get("ucs_name"));
|
||||||
|
} {
|
||||||
|
logger.error("未在ucs系统中找到浪潮{}单位对应部门", x.get("deptName").toString());
|
||||||
|
x.put("dept_id", "");
|
||||||
|
x.put("deptType", 2);
|
||||||
|
x.put("district", 250000);
|
||||||
|
x.replace("deptName", "其他单位");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
typeCountListByApplyDept.addAll(zwyCountListByApplyDept);
|
typeCountListByApplyDept.addAll(zwyCountListByApplyDept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
||||||
ArrayList<Map> resultList = new ArrayList<>();
|
ArrayList<Map> resultList = new ArrayList<>();
|
||||||
Map<String, Integer> countMap = new HashMap<>();
|
Map<String, Integer> countMap = new HashMap<>();
|
||||||
|
@ -2326,7 +2332,12 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
||||||
map.put("name", k);
|
map.put("name", k);
|
||||||
v.forEach(item -> {
|
v.forEach(item -> {
|
||||||
map.put(item.get("type").toString(), item.get("count"));
|
if (map.containsKey(item.get("type").toString())) {
|
||||||
|
map.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + (Integer) map.get(item.get("type")));
|
||||||
|
} else {
|
||||||
|
map.put(item.get("type").toString(), item.get("count"));
|
||||||
|
}
|
||||||
|
|
||||||
if (countMap.containsKey(item.get("type"))) {
|
if (countMap.containsKey(item.get("type"))) {
|
||||||
countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
|
countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2355,10 +2366,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
zwyCountListByApplyDept.forEach(x -> {
|
zwyCountListByApplyDept.forEach(x -> {
|
||||||
Map<String, Object> ucsDept = sysDeptDao.selectUCSDeptByLCDeptName(x.get("deptName").toString());
|
Map<String, Object> ucsDept = sysDeptDao.selectUCSDeptByLCDeptName(x.get("deptName").toString());
|
||||||
if (!ucsDept.isEmpty()) {
|
|
||||||
x.put("dept_id", ucsDept.get("ucs_id").toString());
|
if (null != ucsDept && !ucsDept.isEmpty()) {
|
||||||
x.put("deptType", ucsDept.get("type").toString());
|
x.put("dept_id", ucsDept.get("ucs_id"));
|
||||||
x.put("district", ucsDept.get("district").toString());
|
x.put("deptName", ucsDept.get("ucs_name"));
|
||||||
|
x.put("deptType", ucsDept.get("type"));
|
||||||
|
x.put("district", ucsDept.get("district"));
|
||||||
|
} else {
|
||||||
|
x.put("dept_id", "");
|
||||||
|
x.put("deptType", 2);
|
||||||
|
x.put("district", 250000);
|
||||||
|
logger.error("未在ucs系统中找到浪潮{}单位对应部门", x.get("deptName").toString());
|
||||||
|
x.put("deptName", "其他单位");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params);
|
List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params);
|
||||||
|
@ -2372,11 +2391,15 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = // 市级部门
|
Map<String, List<Map<String, Object>>> typeCountListMap = // 市级部门
|
||||||
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("2")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("2")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
||||||
|
|
||||||
resultList = resultList.stream().map(index -> {
|
resultList = resultList.stream().map(index -> {
|
||||||
if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
|
if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
|
||||||
|
|
||||||
index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
||||||
typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> {
|
typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> {
|
||||||
index.put(count.get("type").toString(), count.get("count"));
|
|
||||||
|
index.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.get(count.get("type").toString()).toString()));
|
||||||
|
|
||||||
if (countMap.containsKey(count.get("type"))) {
|
if (countMap.containsKey(count.get("type"))) {
|
||||||
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2394,7 +2417,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
|
if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
|
||||||
index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
||||||
typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> {
|
typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> {
|
||||||
|
|
||||||
index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString()));
|
index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString()));
|
||||||
|
|
||||||
if (countMap.containsKey(count.get("type"))) {
|
if (countMap.containsKey(count.get("type"))) {
|
||||||
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2441,6 +2466,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
return index;
|
return index;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
if (!typeCountListMap3.isEmpty()) { // 仍然有会客厅信息
|
if (!typeCountListMap3.isEmpty()) { // 仍然有会客厅信息
|
||||||
List<HashMap<String, Object>> temp = typeCountListMap3.keySet().stream().map(index_ -> {
|
List<HashMap<String, Object>> temp = typeCountListMap3.keySet().stream().map(index_ -> {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
@ -2492,7 +2518,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
||||||
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
|
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
|
||||||
}
|
}
|
||||||
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())) {
|
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())
|
||||||
|
|| params.containsKey("region") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("region").toString())
|
||||||
|
) {
|
||||||
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
||||||
ArrayList<Map> resultList = new ArrayList<>();
|
ArrayList<Map> resultList = new ArrayList<>();
|
||||||
|
@ -2521,36 +2549,40 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
count.putAll(countMap);
|
count.putAll(countMap);
|
||||||
resultList.add(count);
|
resultList.add(count);
|
||||||
return resultList;
|
return resultList;
|
||||||
} else if (params.containsKey("region") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("region").toString())) { // 按区域出数据
|
}
|
||||||
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
//else if (params.containsKey("region") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("region").toString())) { // 按区域出数据
|
||||||
ArrayList<Map> resultList = new ArrayList<>();
|
// List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
||||||
Map<String, Integer> countMap = new HashMap<>();
|
// Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
||||||
typeCountListMap.forEach((k, v) -> {
|
// ArrayList<Map> resultList = new ArrayList<>();
|
||||||
HashMap<Object, Object> map = new HashMap<>();
|
// Map<String, Integer> countMap = new HashMap<>();
|
||||||
map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
// typeCountListMap.forEach((k, v) -> {
|
||||||
map.put("name", k);
|
// HashMap<Object, Object> map = new HashMap<>();
|
||||||
v.forEach(item -> {
|
// map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
|
||||||
map.put(item.get("type").toString(), item.get("count"));
|
// map.put("name", k);
|
||||||
if (countMap.containsKey(item.get("type"))) {
|
// v.forEach(item -> {
|
||||||
countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
|
// map.put(item.get("type").toString(), item.get("count"));
|
||||||
} else {
|
// if (countMap.containsKey(item.get("type"))) {
|
||||||
countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString()));
|
// countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
|
||||||
}
|
// } else {
|
||||||
});
|
// countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString()));
|
||||||
resultList.add(map);
|
// }
|
||||||
});
|
// });
|
||||||
Integer total = 0;
|
// resultList.add(map);
|
||||||
for (Integer count : countMap.values()) {
|
// });
|
||||||
total += count;
|
// Integer total = 0;
|
||||||
}
|
// for (Integer count : countMap.values()) {
|
||||||
countMap.put("count", total);
|
// total += count;
|
||||||
HashMap<String, Object> count = new HashMap<>();
|
// }
|
||||||
count.put("name", "总计");
|
// countMap.put("count", total);
|
||||||
count.putAll(countMap);
|
// HashMap<String, Object> count = new HashMap<>();
|
||||||
resultList.add(count);
|
// count.put("name", "总计");
|
||||||
return resultList;
|
// count.putAll(countMap);
|
||||||
} else { // 全部部门
|
// resultList.add(count);
|
||||||
|
// return resultList;
|
||||||
|
//}
|
||||||
|
|
||||||
|
else { // 全部部门
|
||||||
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
|
||||||
Map<String, List<Map<String, Object>>> typeCountListMap = // 市级部门
|
Map<String, List<Map<String, Object>>> typeCountListMap = // 市级部门
|
||||||
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("2")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("2")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
||||||
|
@ -2729,31 +2761,26 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
List result = new ArrayList();
|
List result = new ArrayList();
|
||||||
|
|
||||||
if (null == params.get("resourceType")) {
|
if (params.containsKey("type") && (null == params.get("type") || org.apache.commons.lang3.StringUtils.isBlank(params.get("type").toString()))) { //查所有
|
||||||
AtomicInteger total = new AtomicInteger();
|
|
||||||
//本地ucs系统申请记录
|
int total = 0;
|
||||||
CompletableFuture<Void> ucs = CompletableFuture.runAsync(() -> {
|
List<Map> ucsApplyDtoList = resourceDao.selectCensusApplyTable(params);
|
||||||
List<Map> ucsApplyDtoList = resourceDao.selectCensusApplyTable(params);
|
result.addAll(ucsApplyDtoList);
|
||||||
result.addAll(ucsApplyDtoList);
|
total += ucsApplyDtoList.size();
|
||||||
total.addAndGet(ucsApplyDtoList.size());
|
|
||||||
}, executor);
|
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
|
||||||
|
result.addAll(lcApplyDtoList);
|
||||||
|
total += lcApplyDtoList.size();
|
||||||
|
|
||||||
//浪潮政务云和云视频申请记录
|
|
||||||
CompletableFuture<Void> lc = CompletableFuture.runAsync(() -> {
|
|
||||||
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
|
|
||||||
result.add(lcApplyDtoList);
|
|
||||||
total.addAndGet(lcApplyDtoList.size());
|
|
||||||
}, executor);
|
|
||||||
CompletableFuture.allOf(ucs, lc).join();
|
|
||||||
//根据时间重新排序再分页
|
//根据时间重新排序再分页
|
||||||
result.stream()
|
List newResult = (List) result.stream()
|
||||||
.sorted(Comparator.comparing(x -> {
|
.sorted(Comparator.comparing(x -> {
|
||||||
Map map = (Map) x;
|
Map map = (Map) x;
|
||||||
return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN);
|
return DateUtils.parse(map.get("createDate").toString(), DateUtils.DATE_TIME_PATTERN);
|
||||||
}).reversed())
|
}).reversed())
|
||||||
.skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
|
.skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList());
|
||||||
return new PageData(result, total.intValue());
|
return new PageData(newResult, total);
|
||||||
} else if ("云资源".equals(params.get("resourceType").toString()) || "云视频".equals(params.get("resourceType").toString())) {
|
} else if ("云资源".equals(params.get("type").toString()) || "云视频".equals(params.get("type").toString())) {
|
||||||
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
|
List<Map> lcApplyDtoList = lcSelectCensusApplyTable(params);
|
||||||
result.addAll(lcApplyDtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()));
|
result.addAll(lcApplyDtoList.stream().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList()));
|
||||||
return new PageData(result, lcApplyDtoList.size());
|
return new PageData(result, lcApplyDtoList.size());
|
||||||
|
@ -2767,6 +2794,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
|
|
||||||
private List<Map> lcSelectCensusApplyTable(Map params) {
|
private List<Map> lcSelectCensusApplyTable(Map params) {
|
||||||
|
|
||||||
|
if (params.get("region") != null && !"250000".equals(params.get("region").toString())) {
|
||||||
|
logger.error("非市级单位无法查浪潮数据");
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
StringBuilder sb = new StringBuilder("SELECT * FROM ( " +
|
StringBuilder sb = new StringBuilder("SELECT * FROM ( " +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
" vcbi.ORG_NAME AS \"deptName\", bsrel.name AS \"resourceName\", '青岛市大数据发展管理局' AS \"resourceDeptName\", " +
|
" vcbi.ORG_NAME AS \"deptName\", bsrel.name AS \"resourceName\", '青岛市大数据发展管理局' AS \"resourceDeptName\", " +
|
||||||
|
@ -2785,7 +2817,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
" LEFT JOIN VIEW_CLOUD_BUSINESS_INDEX vcbi ON bsrel.BSNUM = vcbi.BSNUM " +
|
" LEFT JOIN VIEW_CLOUD_BUSINESS_INDEX vcbi ON bsrel.BSNUM = vcbi.BSNUM " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" vcbi.APPLYTYPE = '01' " +
|
" vcbi.APPLYTYPE = '01' " +
|
||||||
" AND vcbi.status IN ( '01', '03', '04', '05', '06', '99' ) " +
|
" AND vcbi.status IN ( '01', '03', '04', '05', '06' ) " +
|
||||||
" UNION ALL " +
|
" UNION ALL " +
|
||||||
" SELECT vvbi.ORG_NAME AS \"deptName\", vvbr.name AS \"resourceName\", vvbr.ORG_NAME AS \"resourceDeptName\", " +
|
" SELECT vvbi.ORG_NAME AS \"deptName\", vvbr.name AS \"resourceName\", vvbr.ORG_NAME AS \"resourceDeptName\", " +
|
||||||
" '云视频' AS \"type\", to_char( vvbi.CREATE_TIME, 'yyyy-mm-dd HH24:MI:SS' ) AS \"createDate\", vvbi.status AS \"approveStatus\", " +
|
" '云视频' AS \"type\", to_char( vvbi.CREATE_TIME, 'yyyy-mm-dd HH24:MI:SS' ) AS \"createDate\", vvbi.status AS \"approveStatus\", " +
|
||||||
|
@ -2796,58 +2828,54 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" vvbi.STATUS != '00' " +
|
" vvbi.STATUS != '00' " +
|
||||||
" AND vvbr.ORG_NAME IS NOT NULL " +
|
" AND vvbr.ORG_NAME IS NOT NULL " +
|
||||||
" ) apply " +
|
" ) apply " +
|
||||||
" WHERE 1 = 1 " +
|
" WHERE 1 = 1 " +
|
||||||
" ");
|
" ");
|
||||||
|
|
||||||
if (params.get("provideDept") != null) {
|
if (params.get("provideDept") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("provideDept").toString())) {
|
||||||
Map<String, Object> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("provideDept").toString());
|
List<Map<String, Object>> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("provideDept").toString());
|
||||||
|
|
||||||
try {
|
if (CollectionUtils.isEmpty(lcDept)) {
|
||||||
if (lcDept.isEmpty()
|
logger.error("未查询到{}对应的浪潮系统部门", params.get("provideDept").toString());
|
||||||
|| lcDept.get("lc_name") == null
|
|
||||||
|| (lcDept.get("lc_name") != null && org.apache.commons.lang3.StringUtils.isBlank(lcDept.get("lc_name").toString()))
|
|
||||||
) {
|
|
||||||
logger.error("未查询到{}对应的浪潮系统部门", params.get("provideDept").toString());
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
sb.append(" AND apply.\"resourceDeptName\" = ").append(lcDept.get("lc_name").toString());
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("", e);
|
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
sb.append(" AND apply.\"resourceDeptName\" IN (");
|
||||||
|
lcDept.forEach(x -> sb.append("'").append(x.get("lc_name").toString()).append("', "));
|
||||||
|
sb.deleteCharAt(sb.length() - 2);
|
||||||
|
sb.append(")");
|
||||||
}
|
}
|
||||||
if (params.get("region") != null) {
|
|
||||||
List<String> deptNames = sysDeptDao.selectLCDeptByRegion((Long) params.get("region"));
|
if (params.get("type") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("type").toString())) {
|
||||||
logger.error("只查询本区域部门申请,部门列表{}", deptNames);
|
|
||||||
sb.append(" AND apply.\"deptName\" IN ( ");
|
|
||||||
deptNames.forEach(name -> sb.append("'").append(name).append("', "));
|
|
||||||
sb.deleteCharAt(sb.length() - 1);
|
|
||||||
sb.append(" ) ");
|
|
||||||
}
|
|
||||||
if (params.get("type") != null) {
|
|
||||||
if ("云视频".equals(params.get("type").toString())) {
|
if ("云视频".equals(params.get("type").toString())) {
|
||||||
sb.append(" AND apply.type = '云视频' ");
|
sb.append(" AND apply.\"type\" = '云视频' ");
|
||||||
} else {
|
} else {
|
||||||
sb.append(" AND apply.type != '云视频' ");
|
sb.append(" AND apply.\"type\" != '云视频' ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (params.get("startDate") != null && params.get("endDate") != null) {
|
if (params.get("startDate") != null && params.get("endDate") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("startDate").toString())) {
|
||||||
sb.append(" AND apply.\"createDate\" BETWEEN '").append(params.get("startDate").toString())
|
sb.append(" AND apply.\"createDate\" BETWEEN '").append(params.get("startDate").toString())
|
||||||
.append("' AND '").append(params.get("endDate").toString()).append("'");
|
.append("' AND '").append(params.get("endDate").toString()).append("'");
|
||||||
}
|
}
|
||||||
if (params.get("approveStatus") != null) {
|
if (params.get("approveStatus") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("approveStatus").toString())) {
|
||||||
sb.append(" AND apply.\"approveStatus\" = '").append(params.get("approveStatus").toString()).append("'");
|
sb.append(" AND apply.\"approveStatus\" = '").append(params.get("approveStatus").toString()).append("'");
|
||||||
}
|
}
|
||||||
if (params.get("deptId") != null) {
|
if (params.get("deptId") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("deptId").toString())) {
|
||||||
sb.append(" AND apply.\"deptName\" = '").append(params.get("deptId").toString()).append("'");
|
List<Map<String, Object>> deptIds = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString());
|
||||||
|
sb.append(" AND apply.\"deptName\" IN (");
|
||||||
|
deptIds.forEach(x -> sb.append("'").append(x.get("lc_name").toString()).append("', "));
|
||||||
|
sb.deleteCharAt(sb.length() - 2);
|
||||||
|
sb.append(")");
|
||||||
}
|
}
|
||||||
if (params.get("resourceName") != null) {
|
if (params.get("resourceName") != null && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("resourceName").toString())) {
|
||||||
sb.append(" AND apply.\"resourceName\" LIKE '%" + params.get("resourceName").toString() + "%'");
|
sb.append(" AND apply.\"resourceName\" LIKE '%" + params.get("resourceName").toString() + "%'");
|
||||||
}
|
}
|
||||||
sb.append(" ORDER BY apply.\"createDate\" DESC");
|
sb.append(" ORDER BY apply.\"createDate\" DESC");
|
||||||
logger.error("查询浪潮数据库--按资源查询申请记录SQL:{}", sb);
|
List<Map<String, Object>> list = null;
|
||||||
List<Map<String, Object>> list = jdbcTemplate.queryForList(sb.toString());
|
try {
|
||||||
|
list = lcJdbcTemplate.queryForList(sb.toString());
|
||||||
|
} catch (DataAccessException e) {
|
||||||
|
logger.error("查询浪潮数据库--按资源查询申请记录SQL:{}", sb);
|
||||||
|
}
|
||||||
return new ArrayList<>(list);
|
return new ArrayList<>(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class ResourceBrowseController {
|
||||||
@ApiImplicitParam(name = "name", value = "关键字", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "name", value = "关键字", paramType = "query", dataType = "String"),
|
||||||
@ApiImplicitParam(name = "type", value = "查询类型(组件服务 应用资源 知识库)", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "type", value = "查询类型(组件服务 应用资源 知识库)", paramType = "query", dataType = "String"),
|
||||||
})
|
})
|
||||||
//@RequiresPermissions("resourceBrowse:resourcebrowse:page")
|
|
||||||
public Result<PageData<ResourceBrowseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
public Result<PageData<ResourceBrowseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
UserDetail user = SecurityUser.getUser();
|
UserDetail user = SecurityUser.getUser();
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
|
@ -70,9 +69,9 @@ public class ResourceBrowseController {
|
||||||
Long id = user.getId();
|
Long id = user.getId();
|
||||||
params.put("userId", id);
|
params.put("userId", id);
|
||||||
}
|
}
|
||||||
Integer page = Integer.parseInt(params.get("page").toString()) - 1;
|
Integer page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) - 1 : 0;
|
||||||
Integer pageSize = Integer.parseInt(params.get("limit").toString());
|
Integer pageSize = params.get("limit")!= null ? Integer.parseInt(params.get("limit").toString()) : 5;
|
||||||
params.put("pageNum", page);
|
params.put("pageNum", page * pageSize);
|
||||||
params.put("pageSize", pageSize);
|
params.put("pageSize", pageSize);
|
||||||
|
|
||||||
//PageData<ResourceBrowseDTO> page = resourceBrowseService.page(params);
|
//PageData<ResourceBrowseDTO> page = resourceBrowseService.page(params);
|
||||||
|
|
|
@ -25,6 +25,4 @@ public interface ResourceBrowseDao extends BaseDao<ResourceBrowseEntity> {
|
||||||
List<Map> selectDayList(@Param("startDate") String startDate, @Param("endDate") String endDate);
|
List<Map> selectDayList(@Param("startDate") String startDate, @Param("endDate") String endDate);
|
||||||
|
|
||||||
List<ResourceBrowseDTO> selectResourceBrowseByTypeAndUser(@Param("params") Map<String, Object> params);
|
List<ResourceBrowseDTO> selectResourceBrowseByTypeAndUser(@Param("params") Map<String, Object> params);
|
||||||
|
|
||||||
Integer resourceBrowseDTOCount(@Param("params") Map<String, Object> params);
|
|
||||||
}
|
}
|
|
@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浏览记录
|
* 浏览记录
|
||||||
|
@ -79,9 +80,12 @@ public class ResourceBrowseServiceImpl extends CrudServiceImpl<ResourceBrowseDao
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageData<ResourceBrowseDTO> selectResourceBrowseByTypeAndUser(Map<String, Object> map) {
|
public PageData<ResourceBrowseDTO> selectResourceBrowseByTypeAndUser(Map<String, Object> map) {
|
||||||
Integer total = resourceBrowseDao.resourceBrowseDTOCount(map);
|
|
||||||
List<ResourceBrowseDTO> list = resourceBrowseDao.selectResourceBrowseByTypeAndUser(map);
|
List<ResourceBrowseDTO> list = resourceBrowseDao.selectResourceBrowseByTypeAndUser(map);
|
||||||
PageData<ResourceBrowseDTO> pageData = new PageData<ResourceBrowseDTO>(list, total);
|
list = list.stream()
|
||||||
|
.skip(Long.valueOf(map.get("pageNum").toString()))
|
||||||
|
.limit(Long.valueOf(map.get("pageSize").toString()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
PageData<ResourceBrowseDTO> pageData = new PageData<ResourceBrowseDTO>(list, list.size());
|
||||||
return pageData;
|
return pageData;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,7 +38,7 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
|
||||||
*/
|
*/
|
||||||
SysDeptEntity getByName(String name);
|
SysDeptEntity getByName(String name);
|
||||||
|
|
||||||
Map<String, Object> selectLCDeptByUcsDeptName(@Param("provideDept") String provideDept);
|
List<Map<String, Object>> selectLCDeptByUcsDeptName(@Param("provideDept") String provideDept);
|
||||||
|
|
||||||
List<String> selectLCDeptByRegion(@Param("region") Long region);
|
List<String> selectLCDeptByRegion(@Param("region") Long region);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE tb_fuse ADD COLUMN `district` int(2) DEFAULT 0 COMMENT '赋能场景类型:0市级、1基层场景';
|
|
@ -19,6 +19,7 @@
|
||||||
<result property="infrastructureCount" column="infrastructure_count"/>
|
<result property="infrastructureCount" column="infrastructure_count"/>
|
||||||
<result property="dataSourceCount" column="data_source_count"/>
|
<result property="dataSourceCount" column="data_source_count"/>
|
||||||
<result property="componentCount" column="component_count"/>
|
<result property="componentCount" column="component_count"/>
|
||||||
|
<result property="district" column="district"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="getFuseDTOList" resultMap="fuseDTO">
|
<select id="getFuseDTOList" resultMap="fuseDTO">
|
||||||
|
@ -44,6 +45,9 @@
|
||||||
<if test="deptUser != null and deptUser != ''">
|
<if test="deptUser != null and deptUser != ''">
|
||||||
and dept_user like concat('%', #{deptUser}, '%')
|
and dept_user like concat('%', #{deptUser}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="district != null and district != ''">
|
||||||
|
and district = #{district}
|
||||||
|
</if>
|
||||||
<if test="mobile != null and mobile != ''">
|
<if test="mobile != null and mobile != ''">
|
||||||
and mobile like concat('%', #{mobile}, '%')
|
and mobile like concat('%', #{mobile}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -1515,8 +1515,10 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUsersApplyAndCount" resultMap="resourceDTO">
|
<select id="selectUsersApplyAndCount" resultMap="resourceDTO">
|
||||||
SELECT tdr.*, count(taa.id) as applyCount
|
SELECT tdr.*, sd.name AS "deptName", count(taa.id) as applyCount
|
||||||
FROM tb_data_resource tdr left join t_ability_application taa on tdr.id=taa.resource_id
|
FROM tb_data_resource tdr
|
||||||
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
|
LEFT JOIN t_ability_application taa on tdr.id=taa.resource_id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
AND tdr.del_flag = 0
|
AND tdr.del_flag = 0
|
||||||
|
@ -1813,7 +1815,7 @@
|
||||||
AND taa.approve_status = #{approveStatus}
|
AND taa.approve_status = #{approveStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != ''">
|
<if test="deptId != null and deptId != ''">
|
||||||
AND sd.id = #{deptId}
|
AND sd.name = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
AND tdr.type = #{type}
|
AND tdr.type = #{type}
|
||||||
|
@ -1902,7 +1904,7 @@
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="deptId != null and deptId != ''">
|
<if test="deptId != null and deptId != ''">
|
||||||
AND sd.id = #{deptId}
|
AND sd.name = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="region != null and region != ''">
|
<if test="region != null and region != ''">
|
||||||
AND sd.district = #{region}
|
AND sd.district = #{region}
|
||||||
|
@ -1957,7 +1959,7 @@
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="deptId != null and deptId != ''">
|
<if test="deptId != null and deptId != ''">
|
||||||
AND sd.id = #{deptId}
|
AND sd.name = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
AND tdr.type = #{type}
|
AND tdr.type = #{type}
|
||||||
|
@ -2029,7 +2031,7 @@
|
||||||
AND tdr.name LIKE CONCAT( '%', #{resourceName}, '%' )
|
AND tdr.name LIKE CONCAT( '%', #{resourceName}, '%' )
|
||||||
</if>
|
</if>
|
||||||
<if test="provideDept != null and provideDept != ''">
|
<if test="provideDept != null and provideDept != ''">
|
||||||
AND dept.id = #{provideDept}
|
AND dept.name = #{provideDept}
|
||||||
</if>
|
</if>
|
||||||
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
|
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
|
||||||
AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
|
AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
|
||||||
|
@ -2068,10 +2070,10 @@
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="deptId != null and deptId != ''">
|
<if test="deptId != null and deptId != ''">
|
||||||
AND tmb.dept LIKE CONCAT( '%', #{deptId}, '%' )
|
AND tmb.dept = #{deptId}
|
||||||
</if>
|
</if>
|
||||||
<if test="provideDept != null and provideDept != ''">
|
<if test="provideDept != null and provideDept != ''">
|
||||||
AND #{provideDept} = 1067246875800000066
|
AND #{provideDept} = '青岛市大数据发展管理局'
|
||||||
</if>
|
</if>
|
||||||
<if test="region != null and region != ''">
|
<if test="region != null and region != ''">
|
||||||
AND sr.id = #{region}
|
AND sr.id = #{region}
|
||||||
|
|
|
@ -75,28 +75,6 @@
|
||||||
LIKE(CONCAT('%',CONCAT(trim(#{params.name}),'%'))))
|
LIKE(CONCAT('%',CONCAT(trim(#{params.name}),'%'))))
|
||||||
</if>
|
</if>
|
||||||
AND b.del_flag = 0
|
AND b.del_flag = 0
|
||||||
<choose>
|
ORDER BY create_date desc
|
||||||
<when test="params.orderField != null and params.orderField != null and params.order != null and params.order != ''">
|
|
||||||
ORDER BY ${params.orderField} ${params.order}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
ORDER BY create_date desc
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
LIMIT ${params.pageNum}, ${params.pageSize}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="resourceBrowseDTOCount" parameterType="java.util.Map" resultType="java.lang.Integer">
|
|
||||||
SELECT COUNT(a.id) AS total FROM tb_resource_browse a INNER JOIN tb_data_resource b ON a.resource_id = b.id
|
|
||||||
WHERE a.state = 0
|
|
||||||
<if test="params.type != null and params.type != ''">
|
|
||||||
AND b.type = #{params.type}
|
|
||||||
</if>
|
|
||||||
<if test="params.name != null and params.name != ''">
|
|
||||||
AND (b.name LIKE(CONCAT('%',CONCAT(trim(#{params.name}),'%'))) OR b.type
|
|
||||||
LIKE(CONCAT('%',CONCAT(trim(#{params.name}),'%'))) OR b.description
|
|
||||||
LIKE(CONCAT('%',CONCAT(trim(#{params.name}),'%'))))
|
|
||||||
</if>
|
|
||||||
AND b.del_flag = 0
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue