|
|
@@ -854,12 +854,14 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
}
|
|
|
Pagination<?> page = findPage("ExpenseMainList", "ExpenseMainCount", params, in.getPageNo(), in.getPageSize());
|
|
|
List<MainExpenseAccount> list = (List<MainExpenseAccount>) page.getList();
|
|
|
- List<Integer> collect = list.stream().map(MainExpenseAccount::getId).collect(Collectors.toList());
|
|
|
- List<MainExpenseAccount> mainExpenseAccounts = expenseAccountMapper.selectSonByMainIds(collect);
|
|
|
- for (MainExpenseAccount e : list) {
|
|
|
- for (MainExpenseAccount me : mainExpenseAccounts) {
|
|
|
- if (e.getId().equals(me.getId())){
|
|
|
- e.setSonList(me.getSonList());
|
|
|
+ if (!list.isEmpty()){
|
|
|
+ List<Integer> collect = list.stream().map(MainExpenseAccount::getId).collect(Collectors.toList());
|
|
|
+ List<MainExpenseAccount> mainExpenseAccounts = expenseAccountMapper.selectSonByMainIds(collect);
|
|
|
+ for (MainExpenseAccount e : list) {
|
|
|
+ for (MainExpenseAccount me : mainExpenseAccounts) {
|
|
|
+ if (e.getId().equals(me.getId())){
|
|
|
+ e.setSonList(me.getSonList());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|