diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 5f16e763..ab02b0f7 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -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 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 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 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 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); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 1697749f..c704907f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -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 result = new LinkedHashMap() {{ + put("PageCount", "0"); + put("data", new ArrayList<>()); + put("rows", "0"); + }}; + return new Result().ok(result); } } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 3daf1549..9beb9934 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2122,7 +2122,7 @@ public class ResourceServiceImpl extends CrudServiceImpl resultList = new CopyOnWriteArrayList<>(); Boolean nonChinese_ = BooleanUtils.toBoolean(nonChinese.toLowerCase());// 不传默认为中文走全文索引 CompletableFuture 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 meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor); - CompletableFuture all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount); + //增加政务云资源搜索结果 + CompletableFuture zwyRes = CompletableFuture.runAsync(() -> meetCountNew[1] = resourceDao.selectPolicyCloudServiceCountByName(keyWorld), executor); + + CompletableFuture all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount, zwyRes); all.join(); } @@ -2181,7 +2184,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { 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); } }); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index bd90d6b5..0746ade5 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1921,27 +1921,38 @@