Merge branch 'dev'

This commit is contained in:
wangliwen 2022-12-08 09:20:18 +08:00
commit 6e2ba70c84
4 changed files with 46 additions and 27 deletions

View File

@ -442,8 +442,8 @@ public class ActTaskController {
public Result getZwyBusinessList(String name, String applyType, String status, int pageNum, int pageSize) {
UserDetail user = SecurityUser.getUser();
JdbcTemplate jdbcTemplate = getJDBCTemplate();
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, APPLYTYPE, CREATE_TIME, STATUS " +
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND ACCOUNT = " + user.getUsername());
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, APPLYTYPE, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " +
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = " + user.getUsername());
if (!StringUtils.isEmpty(name)) {
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
}
@ -480,8 +480,8 @@ public class ActTaskController {
public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) {
UserDetail user = SecurityUser.getUser();
JdbcTemplate jdbcTemplate = getJDBCTemplate();
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, CREATE_TIME, STATUS " +
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND ACCOUNT = " + user.getUsername());
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", STATUS " +
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = " + user.getUsername());
if (!StringUtils.isEmpty(name)) {
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
}
@ -518,7 +518,7 @@ public class ActTaskController {
//云主机
CompletableFuture<Void> yzj = CompletableFuture.runAsync(() -> {
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云主机' AS \"SOURCE_TYPE\", NAME, DISPOSE AS \"INFO\" " +
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
sql.append(id);
@ -530,7 +530,7 @@ public class ActTaskController {
//云数据库
CompletableFuture<Void> ysjk = CompletableFuture.runAsync(() -> {
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云数据库' AS \"SOURCE_TYPE\", NAME, (TYPE || '/' || STORAGE_SPACE || 'GB') AS \"INFO\" " +
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
sql.append(id);
@ -542,7 +542,7 @@ public class ActTaskController {
//对象存储
CompletableFuture<Void> dxcc = CompletableFuture.runAsync(() -> {
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
StringBuilder sql = new StringBuilder("SELECT BSNUM, '对象存储' AS \"SOURCE_TYPE\", NAME, (DATA_DISK || 'GB') AS \"INFO\" " +
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
sql.append(id);
@ -555,7 +555,7 @@ public class ActTaskController {
//托管服务
CompletableFuture<Void> tgfw = CompletableFuture.runAsync(() -> {
StringBuilder sql = new StringBuilder("SELECT BSNUM, SOURCE_TYPE, NAME, DISPOSE " +
StringBuilder sql = new StringBuilder("SELECT BSNUM, '托管服务' AS \"SOURCE_TYPE\", NAME, U_NUM AS \"INFO\" " +
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = ");
sql.append(id);

View File

@ -524,7 +524,7 @@ public class ResourceController {
SysUserEntity sysUser = sysUserDao.getById(userId);
if (sysUser == null || sysUser.getGuid() == null) {
return new Result<>().error("该账号没有权限");
return new Result<>().error("该账号没有权限获取资源列表");
}
String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZySPPort";
@ -553,8 +553,13 @@ public class ResourceController {
return new Result().ok(result);
} catch (Exception e) {
e.printStackTrace();
return new Result().ok(new ArrayList(0));
logger.error("资源列表转发异常", e);
Map<String, Object> result = new LinkedHashMap<String, Object>() {{
put("PageCount", "0");
put("data", new ArrayList<>());
put("rows", "0");
}};
return new Result().ok(result);
}
}

View File

@ -2122,7 +2122,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
List<Map> resultList = new CopyOnWriteArrayList<>();
Boolean nonChinese_ = BooleanUtils.toBoolean(nonChinese.toLowerCase());// 不传默认为中文走全文索引
CompletableFuture<Void> DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld, nonChinese_)));
final Integer[] meetCountNew = new Integer[1];
final Integer[] meetCountNew = new Integer[2];
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: {
@ -2156,7 +2156,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
//统计增加会客厅搜索结果
CompletableFuture<Void> meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor);
CompletableFuture<Void> all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount);
//增加政务云资源搜索结果
CompletableFuture<Void> zwyRes = CompletableFuture.runAsync(() -> meetCountNew[1] = resourceDao.selectPolicyCloudServiceCountByName(keyWorld), executor);
CompletableFuture<Void> all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount, zwyRes);
all.join();
}
@ -2181,7 +2184,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
});
resultList.forEach(map -> {
if ("基础设施".equals(map.get("type").toString())) {
int num = meetCountNew[0] + Integer.parseInt(map.get("count").toString());
int num = meetCountNew[0] + meetCountNew[1] + Integer.parseInt(map.get("count").toString());
map.replace("count", num);
}
});

View File

@ -1921,18 +1921,29 @@
</select>
<select id="selectCensusResourceTable" resultType="java.util.Map">
SELECT sd.name AS deptName, tdr.name AS resourceName, tdr.type, DATE_FORMAT(tdr.create_date,'%Y-%m-%d %T') AS
createDate,
CASE WHEN (tdr.del_flag=0 OR tdr.del_flag=5) THEN '通过' WHEN tdr.del_flag=6 THEN '不通过' ELSE '审核中' END AS
approveStatus, trma.instance_id AS applyNumber
FROM (SELECT IF(d.type='组件服务', a.attr_value, d.type) AS type, d.id, d.del_flag, d.dept_id, d.create_date,
SELECT
sd.name AS deptName,
tdr.name AS resourceName,
tdr.type,
DATE_FORMAT(tdr.create_date,'%Y-%m-%d %T') AS createDate,
CASE WHEN (tdr.del_flag = 0 OR tdr.del_flag = 5) THEN '通过' WHEN tdr.del_flag = 6 THEN '不通过' ELSE '审核中' END AS approveStatus,
trma.instance_id AS applyNumber
FROM
(SELECT
IF(d.type = '组件服务', a.attr_value, d.type) AS type,
d.id,
d.del_flag,
d.dept_id,
d.create_date,
d.name
FROM tb_data_resource d LEFT JOIN tb_data_attr a ON d.id=a.data_resource_id AND a.attr_type='组件类型' AND
a.del_flag=0
WHERE d.type NOT IN ('知识库','基础设施','数据资源')) tdr
FROM tb_data_resource d
LEFT JOIN tb_data_attr a ON d.id = a.data_resource_id AND a.attr_type = '组件类型' AND a.del_flag = 0
WHERE d.type IN ('应用资源','组件服务')
) tdr
LEFT JOIN t_resource_mount_apply trma on tdr.id = trma.resource_id,
sys_dept sd
WHERE 1=1 AND tdr.dept_id=sd.id
WHERE 1 = 1
AND tdr.dept_id = sd.id
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0