Compare commits
3 Commits
14941565b1
...
9d99754895
Author | SHA1 | Date |
---|---|---|
wangliwen | 9d99754895 | |
wangliwen | 53816fae1f | |
wangliwen | da79eebf6c |
|
@ -2337,7 +2337,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
|
logger.error("区域管理员只出本部门区域:{}", sysDeptDTO.getDistrict());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())) {// 部门精准查
|
if (params.containsKey("deptId") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("deptId").toString())) { // 部门精准查
|
||||||
|
|
||||||
List<Map<String, Object>> zwyCountListByapplyDept = new ArrayList<>();
|
List<Map<String, Object>> zwyCountListByapplyDept = new ArrayList<>();
|
||||||
List<Map<String, Object>> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString());
|
List<Map<String, Object>> lcDept = sysDeptDao.selectLCDeptByUcsDeptName(params.get("deptId").toString());
|
||||||
|
@ -2482,7 +2482,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
count.putAll(countMap);
|
count.putAll(countMap);
|
||||||
resultList.add(count);
|
resultList.add(count);
|
||||||
return resultList;
|
return resultList;
|
||||||
} else {
|
} else { // 全量
|
||||||
List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>();
|
List<Map<String, Object>> zwyCountListByApplyDept = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
if (cloud) {
|
if (cloud) {
|
||||||
|
@ -2522,7 +2522,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
|
|
||||||
resultList = resultList.stream().map(index -> {
|
resultList = resultList.stream().map(index -> {
|
||||||
if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息
|
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());
|
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 -> {
|
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()));
|
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
index.put("level", "municipal"); // 市级别
|
||||||
}
|
}
|
||||||
return index;
|
return index;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -2542,8 +2542,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3"))
|
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3"))
|
||||||
.collect(Collectors.groupingBy(m -> m.get("district").toString()));
|
.collect(Collectors.groupingBy(m -> m.get("district").toString()));
|
||||||
resultList = resultList.stream().map(index -> {
|
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());
|
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 -> {
|
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()));
|
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
index.put("hys", 0); // 填充会议室为0
|
||||||
|
index.put("level", "county"); // 区县级别
|
||||||
}
|
}
|
||||||
return index;
|
return index;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
@ -2563,8 +2564,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4"))
|
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4"))
|
||||||
.collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
.collect(Collectors.groupingBy(m -> m.get("dept_id").toString()));
|
||||||
resultList = resultList.stream().map(index -> {
|
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());
|
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 -> {
|
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()));
|
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()));
|
countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
index.put("level", "other"); // 企业级别
|
||||||
}
|
}
|
||||||
return index;
|
return index;
|
||||||
}).collect(Collectors.toList());
|
}).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()));
|
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
|
||||||
resultList = resultList.stream().map(index -> {
|
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());
|
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 -> {
|
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()));
|
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<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
typeCountListMap3.get(index_).stream().forEach(count -> {
|
typeCountListMap3.get(index_).stream().forEach(count -> {
|
||||||
map.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()));
|
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"))) {
|
if (countMap.containsKey(count.get("type"))) {
|
||||||
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type")));
|
||||||
} else {
|
} else {
|
||||||
|
@ -2632,6 +2634,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
countMap.put("count", total);
|
countMap.put("count", total);
|
||||||
HashMap<String, Object> count = new HashMap<>();
|
HashMap<String, Object> count = new HashMap<>();
|
||||||
count.put("name", "总计");
|
count.put("name", "总计");
|
||||||
|
if (!cloud) { // 不统计云资源时
|
||||||
|
count.put("yzy", "0");
|
||||||
|
count.put("ysp", "0");
|
||||||
|
}
|
||||||
count.putAll(countMap);
|
count.putAll(countMap);
|
||||||
resultList.add(count);
|
resultList.add(count);
|
||||||
return resultList;
|
return resultList;
|
||||||
|
|
Loading…
Reference in New Issue