From 5dab80061448e46fd3d6f450b384a18549535943 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 6 Jan 2023 11:06:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20HIQDUCS-220=20=E5=85=B1=E4=BA=AB=E9=97=A8?= =?UTF-8?q?=E6=88=B7-=E8=83=BD=E5=8A=9B=E5=88=86=E7=B1=BB=EF=BC=9A?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD=E5=92=8C=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=AD=E7=B1=BB=E5=88=AB=E8=B7=9F=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E9=9B=86=E5=B8=82=E7=9A=84=E9=A1=BA=E5=BA=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 52 +++++++++++++++--- .../resources/mapper/resource/ResourceDao.xml | 53 ++++++++++++++----- 2 files changed, 85 insertions(+), 20 deletions(-) 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 @@