统计报表修改

This commit is contained in:
lizhicheng 2022-09-23 17:42:43 +08:00
parent 4aab62391a
commit c64c3b4278
3 changed files with 41 additions and 3 deletions

View File

@ -121,7 +121,7 @@ public class HibrianApiGateway implements ApiGateway {
//建路由接口url //建路由接口url
HashMap routeEntity = new HashMap(); HashMap routeEntity = new HashMap();
routeEntity.put("name", "api:1:" + resourceDTO.getName()); routeEntity.put("name", "api:1:" + resourceDTO.getName());
routeEntity.put("service_id", id); routeEntity.put("serviceId", id);
routeEntity.put("methods", methods); routeEntity.put("methods", methods);
routeEntity.put("uris", apiPrefix + uris); routeEntity.put("uris", apiPrefix + uris);
routeEntity.put("enableMetric", true); routeEntity.put("enableMetric", true);

View File

@ -2018,12 +2018,30 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); List<Map<String, Object>> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params);
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByApplyDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
ArrayList<Map> resultList = new ArrayList<>(); ArrayList<Map> resultList = new ArrayList<>();
Map<String, Integer> countMap = new HashMap<>();
typeCountListMap.forEach((k, v) -> { typeCountListMap.forEach((k, v) -> {
HashMap<Object, Object> map = new HashMap<>(); HashMap<Object, Object> map = new HashMap<>();
map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
map.put("name", k); map.put("name", k);
v.forEach(item -> map.put(item.get("type").toString(), item.get("count"))); v.forEach(item -> {
map.put(item.get("type").toString(), item.get("count"));
if (countMap.containsKey(item.get("type"))) {
countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
} else {
countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString()));
}
});
resultList.add(map); resultList.add(map);
}); });
Integer total=0;
for(Integer count : countMap.values()){
total+=count;
}
countMap.put("count", total);
HashMap<String, Object> count = new HashMap<>();
count.put("name", "总计");
count.putAll(countMap);
resultList.add(count);
return resultList; return resultList;
} }
@ -2032,12 +2050,30 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
ArrayList<Map> resultList = new ArrayList<>(); ArrayList<Map> resultList = new ArrayList<>();
Map<String, Integer> countMap = new HashMap<>();
typeCountListMap.forEach((k, v) -> { typeCountListMap.forEach((k, v) -> {
HashMap<Object, Object> map = new HashMap<>(); HashMap<Object, Object> map = new HashMap<>();
map.put("count", v.stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum());
map.put("name", k); map.put("name", k);
v.forEach(item -> map.put(item.get("type").toString(), item.get("count"))); v.forEach(item -> {
map.put(item.get("type").toString(), item.get("count"));
if (countMap.containsKey(item.get("type"))) {
countMap.replace(item.get("type").toString(), Integer.parseInt(item.get("count").toString()) + countMap.get(item.get("type")));
} else {
countMap.put(item.get("type").toString(), Integer.parseInt(item.get("count").toString()));
}
});
resultList.add(map); resultList.add(map);
}); });
Integer total=0;
for(Integer count : countMap.values()){
total+=count;
}
countMap.put("count", total);
HashMap<String, Object> count = new HashMap<>();
count.put("name", "总计");
count.putAll(countMap);
resultList.add(count);
return resultList; return resultList;
} }

View File

@ -1715,6 +1715,7 @@
AND taa.user_id = su.id AND taa.user_id = su.id
AND su.dept_id = sd.id AND su.dept_id = sd.id
AND taa.resource_id = tdr.id AND taa.resource_id = tdr.id
AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR tdr.type = '业务组件')
<choose> <choose>
<when test="approveStatus != null and approveStatus != ''"> <when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus} AND taa.approve_status = #{approveStatus}
@ -1754,6 +1755,7 @@
WHERE WHERE
1 = 1 1 = 1
AND tdr.dept_id = sd.id AND tdr.dept_id = sd.id
AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR tdr.type = '业务组件')
<choose> <choose>
<when test="approveStatus != null and approveStatus == '通过'"> <when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0 AND tdr.del_flag = 0