From a34a6be0f60ee843a79ed4a4d6584d44368d69a8 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 26 Oct 2022 17:22:50 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=83=BD=E5=8A=9B=E5=B9=BF=E5=9C=BA=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=202.=E9=97=A8=E6=88=B7=E9=A6=96=E9=A1=B5-=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=B1=87=E8=81=9A-=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BC=9A=E5=AE=A2=E5=8E=85=E5=92=8C=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E4=BC=9A=E8=AE=AE=E6=95=B0=E9=87=8F=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/resource/dao/ResourceDao.java | 2 +- .../service/impl/ResourceServiceImpl.java | 45 ++++++++++++++----- .../resources/mapper/resource/ResourceDao.xml | 12 ++++- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index aac0a00e..47a3b5b6 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -176,7 +176,7 @@ public interface ResourceDao extends BaseDao { List selectAppList(@Param("pageNum") int pageNum, @Param("type") Integer type, @Param("area") String area); - String selectPicByResId(@Param("id") String id); + String selectPicByResId(@Param("id") String id, @Param("resourceType") String resourceType); List selectTypeCountByName(@Param("keyWorld") String keyWorld, @Param("nonChinese") Boolean nonChinese); 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 893c8310..cee417f9 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 @@ -16,7 +16,9 @@ import io.renren.common.domain.Tsingtao_xhaProperties; import io.renren.common.page.PageData; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.utils.DateUtils; +import io.renren.modules.enke.service.EnkeService; import io.renren.modules.meeting.dao.TMeetingroomMapper; +import io.renren.modules.meeting.entity.TMeetingroom; import io.renren.modules.monitor.dto.CameraChannelDto1; import io.renren.modules.monitor.entity.CameraChannel; import io.renren.modules.monitor.mapper.CameraChannelMapper; @@ -191,6 +193,9 @@ public class ResourceServiceImpl extends CrudServiceImpl getWrapper(Map params) { @@ -1500,7 +1505,7 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.selectAppList((pageNum - 1) * 9, type, area); - maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString()))); + maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString(), "应用资源"))); return new HashMap() {{ put("appList", maps); put("total", resourceDao.selectAppListCount(type, area)); @@ -1877,14 +1882,33 @@ public class ResourceServiceImpl extends CrudServiceImpl resultMap = new HashMap<>(); - Map map = (Map) selectTotal(); - List> list = (List>) map.get("total"); - list.forEach(index -> { - if ("基础设施".equals(index.get("type").toString())) { - resultMap.put("视频资源", Integer.parseInt(index.get("count").toString())); - } - }); resultMap.put("云资源", 0); + //视频资源 + CompletableFuture jcss = CompletableFuture.runAsync(() -> { + Map map = (Map) selectTotal(); + List> list = (List>) map.get("total"); + list.forEach(index -> { + if ("基础设施".equals(index.get("type").toString())) { + resultMap.put("视频资源", Integer.parseInt(index.get("count").toString())); + } + }); + }, executor); + + //新增会客厅和视频会议统计 + //会客厅 + CompletableFuture hkt = CompletableFuture.runAsync(() -> { + QueryWrapper wrapper = new QueryWrapper<>(); + resultMap.put("会客厅", tMeetingroomMapper.selectCount(wrapper)); + + }, executor); + + //视频会议 + CompletableFuture sphy = CompletableFuture.runAsync(() -> { + resultMap.put("视频会议", enkeService.page(new HashMap<>()).getTotal()); + }, executor); + CompletableFuture all = CompletableFuture.allOf(jcss, hkt, sphy); + all.join(); + return resultMap; } @@ -2404,7 +2428,6 @@ public class ResourceServiceImpl extends CrudServiceImpl maps = resourceDao.getSquareList(type, deptType, area, i, pageSize); + maps.forEach(x -> x.put("pic", resourceDao.selectPicByResId(x.get("id").toString(), type))); return new HashMap() {{ - put("list", resourceDao.getSquareList(type, deptType, area, i, pageSize)); + put("list", maps); put("total", resourceDao.getSquareListCount(type, deptType, area)); }}; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index dc19d09f..710318ac 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1620,8 +1620,16 @@ FROM tb_data_attr tda LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id - WHERE - tda.attr_type = '应用图片' + WHERE 1 = 1 + + AND tda.attr_type = '应用图片' + + + AND tda.attr_type = '图层缩略图' + + + AND tda.attr_type = '应用场景' + AND tdr.id = #{id} AND tda.del_flag = 0