优化代码
This commit is contained in:
parent
7192fff9f1
commit
978bee9ffb
@ -808,7 +808,6 @@ public class ExcelUtil<T>
|
|||||||
if (!headerStyles.containsKey(key))
|
if (!headerStyles.containsKey(key))
|
||||||
{
|
{
|
||||||
CellStyle style = wb.createCellStyle();
|
CellStyle style = wb.createCellStyle();
|
||||||
style = wb.createCellStyle();
|
|
||||||
style.cloneStyleFrom(styles.get("data"));
|
style.cloneStyleFrom(styles.get("data"));
|
||||||
style.setAlignment(HorizontalAlignment.CENTER);
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
@ -842,7 +841,6 @@ public class ExcelUtil<T>
|
|||||||
if (!styles.containsKey(key))
|
if (!styles.containsKey(key))
|
||||||
{
|
{
|
||||||
CellStyle style = wb.createCellStyle();
|
CellStyle style = wb.createCellStyle();
|
||||||
style = wb.createCellStyle();
|
|
||||||
style.setAlignment(excel.align());
|
style.setAlignment(excel.align());
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
style.setBorderRight(BorderStyle.THIN);
|
style.setBorderRight(BorderStyle.THIN);
|
||||||
|
@ -71,11 +71,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||||||
public List<SysDept> buildDeptTree(List<SysDept> depts)
|
public List<SysDept> buildDeptTree(List<SysDept> depts)
|
||||||
{
|
{
|
||||||
List<SysDept> returnList = new ArrayList<SysDept>();
|
List<SysDept> returnList = new ArrayList<SysDept>();
|
||||||
List<Long> tempList = new ArrayList<Long>();
|
List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
|
||||||
for (SysDept dept : depts)
|
|
||||||
{
|
|
||||||
tempList.add(dept.getDeptId());
|
|
||||||
}
|
|
||||||
for (SysDept dept : depts)
|
for (SysDept dept : depts)
|
||||||
{
|
{
|
||||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
|
Loading…
Reference in New Issue
Block a user