优化代码

This commit is contained in:
RuoYi 2022-09-09 09:25:55 +08:00
parent 7192fff9f1
commit 978bee9ffb
2 changed files with 1 additions and 7 deletions

View File

@ -808,7 +808,6 @@ public class ExcelUtil<T>
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 @@ public class ExcelUtil<T>
if (!styles.containsKey(key))
{
CellStyle style = wb.createCellStyle();
style = wb.createCellStyle();
style.setAlignment(excel.align());
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderRight(BorderStyle.THIN);

View File

@ -71,11 +71,7 @@ public class SysDeptServiceImpl implements ISysDeptService
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)
{
// 如果是顶级节点, 遍历该父节点的所有子节点