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 2c8a4303..37ebbca1 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 @@ -17,6 +17,8 @@ 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.category.dao.CategoryDao; +import io.renren.modules.category.entity.Category; import io.renren.modules.demanData.dao.TDemandDataDao; import io.renren.modules.demandComment.dao.TDemandCommentDao; import io.renren.modules.enke.service.EnkeService; @@ -279,6 +281,9 @@ public class ResourceServiceImpl extends CrudServiceImpl resultMap = new HashMap<>(); + HashMap resultMap = new LinkedHashMap<>(); //云资源 - CompletableFuture yzy = CompletableFuture.runAsync(() -> resultMap.put("云资源", resourceDao.selectYzyCount()), executor); + CompletableFuture yzy = CompletableFuture.runAsync(() -> resultMap.put("政务云资源", resourceDao.selectYzyCount()), executor); //视频资源 switch (Constant.ProjectPlace.getByFlag(projectPlace)) { @@ -2165,7 +2170,7 @@ public class ResourceServiceImpl extends CrudServiceImpl hkt = CompletableFuture.runAsync(() -> { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("del_flag", 0); - resultMap.put("会客厅", tMeetingroomMapper.selectCount(wrapper)); + resultMap.put("城市云脑会客厅", tMeetingroomMapper.selectCount(wrapper)); }, executor); @@ -2174,8 +2179,13 @@ public class ResourceServiceImpl extends CrudServiceImpl all = CompletableFuture.allOf(yzy, hkt, sphy); all.join(); - - return resultMap; + HashMap resultMap_ = new LinkedHashMap() {{ + put("城市云脑会客厅", resultMap.get("城市云脑会客厅")); + put("视频资源", resultMap.get("视频资源")); + put("政务云资源", resultMap.get("政务云资源")); + put("视频会议", resultMap.get("视频会议")); + }}; + return resultMap_; } @Override @@ -2188,9 +2198,37 @@ public class ResourceServiceImpl extends CrudServiceImpl resource_yyly = new ArrayList<>(); // 应用领域名称列表 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("root_category", "应用资源") + .eq("del_flag", 0) + .eq("is_link_to_dic", "true") + .eq("is_filter_criteria", "true") + .orderByAsc("xh"); + List categories = categoryDao.selectList(wrapper); + Optional yyly = categories.stream().filter(index -> "应用领域".equals(index.getName())).findFirst(); // 获取应用领域编目内容 + if (yyly.isPresent()) { + List yyly_cat = categoryDao.selectDictData(yyly.get().getLinkValue()); + resource_yyly = yyly_cat.stream().map(index -> index.get("dict_label").toString()).collect(Collectors.toList()); + } List resourceCountList = baseDao.selectCollectResourceList(); - Map result = new HashMap(); - resourceCountList.stream().filter(it -> it.get("type") != null && !it.get("type").equals("")).forEach(it -> result.put(it.get("type"), it.get("count"))); + Map result = new LinkedHashMap(); + if (resource_yyly.isEmpty()) { + resourceCountList.stream().filter(it -> it.get("type") != null && !it.get("type").equals("")).forEach(it -> result.put(it.get("type"), it.get("count"))); + } else { + resource_yyly.stream().map(index -> { + Map temp = new LinkedHashMap<>(); + temp.put("type", index); + Optional temp_suit = resourceCountList.stream().filter(i -> index.equals(i.get("type").toString())).findFirst(); + if (temp_suit.isPresent()) { + temp.put("count", temp_suit.get().get("count")); + } else { + temp.put("count", "0"); + } + return temp; + }).forEach(it -> result.put(it.get("type"), it.get("count"))); + } return result; } diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 8d4c3773..4e81bf02 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -2101,19 +2101,46 @@