|
@@ -43,23 +43,22 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
PageRequest pageRequest = new PageRequest();
|
|
PageRequest pageRequest = new PageRequest();
|
|
|
pageRequest.setPageNum(invAccountQueryVo.getPageNo());
|
|
pageRequest.setPageNum(invAccountQueryVo.getPageNo());
|
|
|
pageRequest.setPageSize(invAccountQueryVo.getPageSize());
|
|
pageRequest.setPageSize(invAccountQueryVo.getPageSize());
|
|
|
- Page page = PageRequest.buildPageRequest(pageRequest);
|
|
|
|
|
|
|
|
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.get12MonthsBefore()); // 获取12月前月的第一天
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.get12MonthsBefore()); // 获取12月前月的第一天
|
|
|
invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.getTodayLastDay()); //获取当前月最后一天
|
|
invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.getTodayLastDay()); //获取当前月最后一天
|
|
|
|
|
|
|
|
|
|
|
|
|
- IPage<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(page, invAccountQueryVo);
|
|
|
|
|
- List<InvAccount> records = invAccountIPage.getRecords();
|
|
|
|
|
|
|
+ List<InvAccount> invAccountIPage = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//计算当前季度剩余300000减去
|
|
//计算当前季度剩余300000减去
|
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.quarterStartTime());
|
|
invAccountQueryVo.setInvoiceTimeStart(LocalDateTimeUtils.quarterStartTime());
|
|
|
invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.quarterEndTime());
|
|
invAccountQueryVo.setInvoiceTimeEnd(LocalDateTimeUtils.quarterEndTime());
|
|
|
- IPage<InvAccount> invAccountIPage1 = insAccountMapper.selectAccountsListPage(page, invAccountQueryVo);
|
|
|
|
|
|
|
+ List<InvAccount> invAccountIPage1 = insAccountMapper.selectAccountsListPage(invAccountQueryVo);
|
|
|
|
|
|
|
|
//将当前季度额度赋值
|
|
//将当前季度额度赋值
|
|
|
- List<InvAccount> collect = records.stream()
|
|
|
|
|
- .map(rel -> invAccountIPage1.getRecords().stream()
|
|
|
|
|
|
|
+ List<InvAccount> collect = invAccountIPage.stream()
|
|
|
|
|
+ .map(rel -> invAccountIPage1.stream()
|
|
|
.filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
|
|
.filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
|
|
|
.findFirst()
|
|
.findFirst()
|
|
|
.map(ord -> {
|
|
.map(ord -> {
|
|
@@ -73,9 +72,9 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
).collect(Collectors.toList());
|
|
).collect(Collectors.toList());
|
|
|
|
|
|
|
|
//将总开票额度赋值
|
|
//将总开票额度赋值
|
|
|
- IPage<InvAccount> sumInvoicingAmount = insAccountMapper.getSumInvoicingAmount(page,invAccountQueryVo);
|
|
|
|
|
|
|
+ List<InvAccount> sumInvoicingAmount = insAccountMapper.getSumInvoicingAmount(invAccountQueryVo);
|
|
|
List<InvAccount> collect1 = collect.stream()
|
|
List<InvAccount> collect1 = collect.stream()
|
|
|
- .map(rel -> sumInvoicingAmount.getRecords().stream()
|
|
|
|
|
|
|
+ .map(rel -> sumInvoicingAmount.stream()
|
|
|
.filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
|
|
.filter(ord -> Objects.equals(rel.getAccountId(), ord.getAccountId()))
|
|
|
.findFirst()
|
|
.findFirst()
|
|
|
.map(ord -> {
|
|
.map(ord -> {
|
|
@@ -96,8 +95,13 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- invAccountIPage.setRecords(collect1);
|
|
|
|
|
- return invAccountIPage;
|
|
|
|
|
|
|
+ IPage ipage = PageRequest.buildPageRequest(pageRequest);
|
|
|
|
|
+ ipage.setRecords(collect1.stream().skip((invAccountQueryVo.getPageNo()-1)*invAccountQueryVo.getPageSize()).limit(invAccountQueryVo.getPageSize()).
|
|
|
|
|
+ collect(Collectors.toList()));
|
|
|
|
|
+ ipage.setTotal(collect1.size());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return ipage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|