Commit e798ceaa authored by xixinzhao's avatar xixinzhao

消防系统根节点总数

parent 324e4a79
...@@ -992,13 +992,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -992,13 +992,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
vo.setId(String.valueOf(item.getId())); vo.setId(String.valueOf(item.getId()));
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 计算总数
long total = typeList.stream().mapToLong(o -> {
if (!ObjectUtils.isEmpty(o.get("total"))) {
return (long) o.get("total");
}
return 0;
}).sum();
// 自定义根节点返回树 // 自定义根节点返回树
FireFightingSystemTypeTreeVo parentNode = new FireFightingSystemTypeTreeVo(); FireFightingSystemTypeTreeVo parentNode = new FireFightingSystemTypeTreeVo();
parentNode.setType("all"); parentNode.setType("all");
parentNode.setName("全部分类"); parentNode.setName("全部分类");
parentNode.setId("-1"); parentNode.setId("-1");
parentNode.setParentId("-1"); parentNode.setParentId("-1");
parentNode.setTotal(String.valueOf(total));
parentNode.setChildren(childrenList); parentNode.setChildren(childrenList);
return Collections.singletonList(parentNode); return Collections.singletonList(parentNode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment