From aa31a7bd4364a76c571f7fd679f4b1cdb378a024 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Thu, 8 Dec 2022 09:12:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B5=AA=E6=BD=AE=E6=94=BF=E5=8A=A1=E4=BA=91?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=92=8C=E4=BA=91=E8=B5=84=E6=BA=90=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=202.=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E6=90=9C=E7=B4=A2=E7=BB=9F=E8=AE=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E8=B5=84=E6=BA=90=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=203.=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=BB=9F=E8=AE=A1-=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E7=BB=9F=E8=AE=A1-=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2SQL=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActTaskController.java | 16 ++++---- .../service/impl/ResourceServiceImpl.java | 9 +++-- .../resources/mapper/resource/ResourceDao.xml | 37 ++++++++++++------- 3 files changed, 38 insertions(+), 24 deletions(-) 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/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 @@