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