Compare commits

..

2 Commits

Author SHA1 Message Date
wangliwen 53816fae1f Merge branch 'dev' 2023-01-04 10:19:05 +08:00
wangliwen da79eebf6c 补全空缺数据 2023-01-04 10:18:57 +08:00
1 changed files with 15 additions and 9 deletions

View File

@ -2482,7 +2482,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
count.putAll(countMap);
resultList.add(count);
return resultList;
} else {
} else { // 全量
List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>();
try {
if (cloud) {
@ -2522,7 +2522,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
resultList = resultList.stream().map(index -> {
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<ResourceDao, ResourceEn
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
}
});
index.put("level", "municipal"); // 市级别
}
return index;
}).collect(Collectors.toList());
@ -2542,8 +2542,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByApplyDept.stream().filter(index -> 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<ResourceDao, ResourceEn
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
}
});
index.put("hys", 0); // 填充会议室为0
index.put("level", "county"); // 区县级别
}
return index;
}).collect(Collectors.toList());
@ -2563,8 +2564,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
typeCountListByApplyDept.stream().filter(index -> 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<ResourceDao, ResourceEn
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
}
});
index.put("level", "other"); // 企业级别
}
return index;
}).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap3 = // 会客厅
Map<String, List<Map<String, Object>>> 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<ResourceDao, ResourceEn
HashMap<String, Object> 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<ResourceDao, ResourceEn
countMap.put("count", total);
HashMap<String, Object> count = new HashMap<>();
count.put("name", "总计");
if (!cloud) { // 不统计云资源时
count.put("yzy", "0");
count.put("ysp", "0");
}
count.putAll(countMap);
resultList.add(count);
return resultList;