RuoYi
2022-09-09 e3b12f5621abf80b7c52355c0f6c27dcec7a083d
优化代码
已修改2个文件
8 ■■■■ 文件已修改
src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -808,7 +808,6 @@
            if (!headerStyles.containsKey(key))
            {
                CellStyle style = wb.createCellStyle();
                style = wb.createCellStyle();
                style.cloneStyleFrom(styles.get("data"));
                style.setAlignment(HorizontalAlignment.CENTER);
                style.setVerticalAlignment(VerticalAlignment.CENTER);
@@ -842,7 +841,6 @@
            if (!styles.containsKey(key))
            {
                CellStyle style = wb.createCellStyle();
                style = wb.createCellStyle();
                style.setAlignment(excel.align());
                style.setVerticalAlignment(VerticalAlignment.CENTER);
                style.setBorderRight(BorderStyle.THIN);
src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java
@@ -71,11 +71,7 @@
    public List<SysDept> buildDeptTree(List<SysDept> depts)
    {
        List<SysDept> returnList = new ArrayList<SysDept>();
        List<Long> tempList = new ArrayList<Long>();
        for (SysDept dept : depts)
        {
            tempList.add(dept.getDeptId());
        }
        List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
        for (SysDept dept : depts)
        {
            // 如果是顶级节点, 遍历该父节点的所有子节点