|
@@ -64,6 +64,7 @@ public class AccountingServiceImpl extends ServiceImpl<AccountingMapper, Account
|
|
*/
|
|
*/
|
|
private List<AccountVO> getAccountTree(AccountVO accountVO, List<AccountVO> list) {
|
|
private List<AccountVO> getAccountTree(AccountVO accountVO, List<AccountVO> list) {
|
|
List<AccountVO> accountVOS = new ArrayList<>();
|
|
List<AccountVO> accountVOS = new ArrayList<>();
|
|
|
|
+ accountVOS.add(accountVO);
|
|
for (AccountVO account : list) {
|
|
for (AccountVO account : list) {
|
|
// 如果是父子关系
|
|
// 如果是父子关系
|
|
if (accountVO.getId().equals(account.getParentId())) {
|
|
if (accountVO.getId().equals(account.getParentId())) {
|
|
@@ -75,8 +76,6 @@ public class AccountingServiceImpl extends ServiceImpl<AccountingMapper, Account
|
|
accountVO.setChild(child);
|
|
accountVO.setChild(child);
|
|
// 处理子节点
|
|
// 处理子节点
|
|
this.getAccountTree(account, list);
|
|
this.getAccountTree(account, list);
|
|
-
|
|
|
|
- accountVOS.add(accountVO);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return accountVOS;
|
|
return accountVOS;
|
|
@@ -169,6 +168,7 @@ public class AccountingServiceImpl extends ServiceImpl<AccountingMapper, Account
|
|
|
|
|
|
private List<SelectAccountingVO> getSelectAccountTree(SelectAccountingVO parent, List<SelectAccountingVO> all) {
|
|
private List<SelectAccountingVO> getSelectAccountTree(SelectAccountingVO parent, List<SelectAccountingVO> all) {
|
|
List<SelectAccountingVO> accountVOS = new ArrayList<>();
|
|
List<SelectAccountingVO> accountVOS = new ArrayList<>();
|
|
|
|
+ accountVOS.add(parent);
|
|
for (SelectAccountingVO account : all) {
|
|
for (SelectAccountingVO account : all) {
|
|
// 如果是父子关系
|
|
// 如果是父子关系
|
|
if (parent.getValue().equals(account.getParentId())) {
|
|
if (parent.getValue().equals(account.getParentId())) {
|
|
@@ -180,8 +180,6 @@ public class AccountingServiceImpl extends ServiceImpl<AccountingMapper, Account
|
|
parent.setChildren(child);
|
|
parent.setChildren(child);
|
|
// 处理子节点
|
|
// 处理子节点
|
|
this.getSelectAccountTree(account, all);
|
|
this.getSelectAccountTree(account, all);
|
|
-
|
|
|
|
- accountVOS.add(parent);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return accountVOS;
|
|
return accountVOS;
|