导出 与界面内容一致

This commit is contained in:
wangliwen 2022-11-01 15:06:15 +08:00
parent 84051f7a93
commit 9f3e1a1f5b
3 changed files with 16 additions and 9 deletions

View File

@ -2071,10 +2071,19 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
} }
}); });
Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> { Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> {
int index_ = 0;
for (int i = 0; i < censusTypes.length; i++) {
if (censusTypes[i].equals(index)) {
index_ = i + 1;
break;
}
}
int finalIndex_ = index_;
Map<String, Object> nullMap = new HashMap<String, Object>() { Map<String, Object> nullMap = new HashMap<String, Object>() {
{ {
put("count", "0"); put("count", "0");
put("type", index); put("type", index);
put("type_index", finalIndex_);
} }
}; };
resultList.add(nullMap); resultList.add(nullMap);
@ -2178,8 +2187,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap1 = // 区级部门 Map<String, List<Map<String, Object>>> typeCountListMap1 = // 区级部门
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 -> {
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());
@ -2196,8 +2204,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap2 = // 企业部门 Map<String, List<Map<String, Object>>> typeCountListMap2 = // 企业部门
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 -> {
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());
@ -2361,8 +2368,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap1 = // 区级部门 Map<String, List<Map<String, Object>>> typeCountListMap1 = // 区级部门
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")) typeCountListByDept.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 -> {
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());
@ -2378,8 +2384,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap2 = // 企业部门 Map<String, List<Map<String, Object>>> typeCountListMap2 = // 企业部门
typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4")) typeCountListByDept.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 -> {
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());

View File

@ -97,6 +97,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
@Override @Override
public List<SysUserDTO> list(Map<String, Object> params) { public List<SysUserDTO> list(Map<String, Object> params) {
//转换成like
paramsToLike(params, "username", "real_name");
// 普通管理员只能查询所属部门及子部门的数据 // 普通管理员只能查询所属部门及子部门的数据
UserDetail user = SecurityUser.getUser(); UserDetail user = SecurityUser.getUser();
if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) {

View File

@ -18,7 +18,7 @@ big_date:
assignee_meet_role_id: 1576849766277849089 assignee_meet_role_id: 1576849766277849089
# 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType # 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType
census: census:
type: 组件服务,应用资源,基础设施,数据资源,知识库 type: 应用资源,组件服务,基础设施,数据资源,知识库
applyType: 应用资源,业务组件,图层服务,开发组件,智能算法 applyType: 应用资源,业务组件,图层服务,开发组件,智能算法
# 海信网关 # 海信网关
hisense: hisense: