|
|
@@ -96,7 +96,7 @@ public class HlgPaymentDetailController {
|
|
|
QueryWrapper<HlgPaymentDetailStatistics> queryWrapper = QueryGenerator.initQueryWrapperForRule(hlgPaymentDetailStatistics, req.getParameterMap());
|
|
|
Page<HlgPaymentDetailStatistics> pageList = new Page<HlgPaymentDetailStatistics>(pageNo, pageSize);
|
|
|
List<HlgPaymentDetailStatistics> list = new ArrayList<>();
|
|
|
- list = hlgPaymentDetailService.pageOutList( hlgPaymentDetailStatistics, queryWrapper);
|
|
|
+ list = hlgPaymentDetailService.pageOutList(hlgPaymentDetailStatistics, queryWrapper);
|
|
|
List<HlgPaymentDetailStatistics> list1 = hlgPaymentDetailService.getPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
|
|
|
if (list.size() > 0) {
|
|
|
list.addAll(list1);
|
|
|
@@ -104,23 +104,22 @@ public class HlgPaymentDetailController {
|
|
|
list = list1;
|
|
|
}
|
|
|
list = list.stream().sorted(Comparator.comparing(HlgPaymentDetailStatistics::getPaymentTime).reversed().thenComparing(HlgPaymentDetailStatistics::getId)).collect(Collectors.toList());
|
|
|
- BigDecimal sumPayment=new BigDecimal("0");
|
|
|
- BigDecimal sumTaxFee=new BigDecimal("0");
|
|
|
- if(list.size()>0){
|
|
|
- for (int i = 0; i <list.size() ; i++) {
|
|
|
- sumPayment=sumPayment.add(list.get(i).getPayment());
|
|
|
- sumTaxFee=sumTaxFee.add(list.get(i).getTaxFee());
|
|
|
+ BigDecimal sumPayment = new BigDecimal("0");
|
|
|
+ BigDecimal sumTaxFee = new BigDecimal("0");
|
|
|
+ if (list.size() > 0) {
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ sumPayment = sumPayment.add(list.get(i).getPayment());
|
|
|
+ sumTaxFee = sumTaxFee.add(list.get(i).getTaxFee());
|
|
|
}
|
|
|
}
|
|
|
- int size=(pageNo-1)*10+pageSize;
|
|
|
- if(size>list.size()){
|
|
|
- pageList.setRecords(list.subList((pageNo-1)*10,list.size()));
|
|
|
- }else{
|
|
|
- pageList.setRecords(list.subList((pageNo-1)*10,size));
|
|
|
- }
|
|
|
- if(pageList.getRecords().size()>0){
|
|
|
- pageList.getRecords().get(0).setSumTaxFee(sumTaxFee);
|
|
|
- pageList.getRecords().get(0).setSumPayment(sumPayment);
|
|
|
+ //计算开始索引
|
|
|
+ int fromIndex = (pageNo - 1) * pageSize;
|
|
|
+ //计算结束索引
|
|
|
+ int toIndex = (list.size() - fromIndex) > pageSize ? fromIndex + pageSize : list.size();
|
|
|
+ pageList.setRecords(list.subList(fromIndex, toIndex));
|
|
|
+ if (pageList.getRecords().size() > 0) {
|
|
|
+ pageList.getRecords().get(0).setSumTaxFee(sumTaxFee);
|
|
|
+ pageList.getRecords().get(0).setSumPayment(sumPayment);
|
|
|
}
|
|
|
pageList.setTotal(list.size());
|
|
|
result.setSuccess(true);
|
|
|
@@ -232,11 +231,11 @@ public class HlgPaymentDetailController {
|
|
|
* @param
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
- public ModelAndView exportXls(HttpServletRequest request, HlgPaymentDetailStatistics hlgPaymentDetailStatistics) {
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, HlgPaymentDetailStatistics hlgPaymentDetailStatistics) {
|
|
|
// Step.1 组装查询条件查询数据
|
|
|
QueryWrapper<HlgPaymentDetailStatistics> queryWrapper = QueryGenerator.initQueryWrapperForRule(hlgPaymentDetailStatistics, request.getParameterMap());
|
|
|
List<HlgPaymentDetailStatistics> list = new ArrayList<>();
|
|
|
- list = hlgPaymentDetailService.pageOutList( hlgPaymentDetailStatistics, queryWrapper);
|
|
|
+ list = hlgPaymentDetailService.pageOutList(hlgPaymentDetailStatistics, queryWrapper);
|
|
|
List<HlgPaymentDetailStatistics> list1 = hlgPaymentDetailService.getPaymentDetailStatisticsList(hlgPaymentDetailStatistics, queryWrapper);
|
|
|
if (list.size() > 0) {
|
|
|
list.addAll(list1);
|
|
|
@@ -244,11 +243,11 @@ public class HlgPaymentDetailController {
|
|
|
list = list1;
|
|
|
}
|
|
|
list = list.stream().sorted(Comparator.comparing(HlgPaymentDetailStatistics::getPaymentTime).reversed()).collect(Collectors.toList());
|
|
|
- if(list.size()>0){
|
|
|
- for (int i = 0; i <list.size() ; i++) {
|
|
|
- list.get(i).setTaxFeeMOney(list.get(i).getTaxFee().add(list.get(i).getPayment()));
|
|
|
- }
|
|
|
- }
|
|
|
+ if (list.size() > 0) {
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ list.get(i).setTaxFeeMOney(list.get(i).getTaxFee().add(list.get(i).getPayment()));
|
|
|
+ }
|
|
|
+ }
|
|
|
// Step.2 AutoPoi 导出Excel
|
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
// 过滤选中数据
|