From da79eebf6ccdcbaa41dcb9784436c9e2c9a28abe Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 4 Jan 2023 10:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E7=A9=BA=E7=BC=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResourceServiceImpl.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 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 48673351..be3461f5 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 @@ -2337,7 +2337,7 @@ public class ResourceServiceImpl extends CrudServiceImpl> zwyCountListByapplyDept = new ArrayList<>(); List> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString()); @@ -2482,7 +2482,7 @@ public class ResourceServiceImpl extends CrudServiceImpl> zwyCountListByApplyDept = new ArrayList<>(); try { if (cloud) { @@ -2522,7 +2522,6 @@ public class ResourceServiceImpl extends CrudServiceImpl { if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 - index.put("level", "municipal"); // 市级别 index.put("count", typeCountListMap.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); typeCountListMap.get(index.get("dept_id").toString()).stream().forEach(count -> { @@ -2534,6 +2533,7 @@ public class ResourceServiceImpl extends CrudServiceImpl index.get("deptType").toString().equals("3")) .collect(Collectors.groupingBy(m -> m.get("district").toString())); resultList = resultList.stream().map(index -> { - index.put("level", "county"); // 区县级别 - if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 + if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在使用信息 index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); typeCountListMap1.get(index.get("dept_id").toString()).stream().forEach(count -> { @@ -2555,6 +2554,8 @@ public class ResourceServiceImpl extends CrudServiceImpl index.get("deptType").toString().equals("4")) .collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); resultList = resultList.stream().map(index -> { - index.put("level", "other"); // 企业级别 - if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 + if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在使用信息 index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> { index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString())); @@ -2574,14 +2574,15 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap3 = // 会客厅 + Map>> typeCountListMap3 = // 会客厅 99 为sql查询出结果标识 typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString())); resultList = resultList.stream().map(index -> { - if (typeCountListMap3.keySet().contains(index.get("name").toString())) { // 该部门存在上架信息 + if (typeCountListMap3.keySet().contains(index.get("name").toString())) { // 该部门存在使用信息 index.put("count", Integer.parseInt(index.get("count").toString()) + typeCountListMap3.get(index.get("name").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); typeCountListMap3.get(index.get("name").toString()).stream().forEach(count -> { index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString())); @@ -2602,6 +2603,7 @@ public class ResourceServiceImpl extends CrudServiceImpl map = new HashMap<>(); typeCountListMap3.get(index_).stream().forEach(count -> { map.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString())); + map.put("count", Integer.parseInt(count.get("count").toString())); // 只存在会客厅的总计栏 if (countMap.containsKey(count.get("type"))) { countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type"))); } else { @@ -2632,6 +2634,10 @@ public class ResourceServiceImpl extends CrudServiceImpl count = new HashMap<>(); count.put("name", "总计"); + if (!cloud) { // 不统计云资源时 + count.put("yzy", "0"); + count.put("ysp", "0"); + } count.putAll(countMap); resultList.add(count); return resultList;