|
|
@@ -2,14 +2,19 @@ package com.jzg.console.service.impl;
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.annotation.ExcelProperty;
|
|
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import com.jzg.commons.entity.report.dto.*;
|
|
|
+import com.jzg.commons.entity.report.vo.PayableStatisticsDetailParam;
|
|
|
import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
|
|
|
+import com.jzg.commons.util.EasyExcelUtils;
|
|
|
+import com.jzg.commons.util.ServletUtils;
|
|
|
import com.jzg.console.mapper.ReportMeetDataMapper;
|
|
|
import com.jzg.console.service.ReportMeetDataService;
|
|
|
import com.jzg.console.service.ReportReceivableDataService;
|
|
|
@@ -51,19 +56,94 @@ public class ReportMeetDataServiceImpl extends ReportBaseServiceImpl implements
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 按月份汇总应付统计数据
|
|
|
+ * 按月份汇总应付统计数据 - 分页查询
|
|
|
* 查询选中年份的应付数据,按年-月汇总
|
|
|
* 返回:时间(年月)、保费、应付佣金、未提现、提现中、已付款
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<?> getPayableStatisticsByMonth(ReportSearchCommonVo reportSearchCommonVo, String systemCode) {
|
|
|
+ public IPage<?> getPayableStatisticsByMonth(ReportSearchCommonVo reportSearchCommonVo, String systemCode) {
|
|
|
log.info("财务数据-应付统计(按月份汇总). reportSearchCommonVo=[{}], systemCode=[{}]", JSONUtil.toJsonStr(reportSearchCommonVo), systemCode);
|
|
|
List<String> years = reportSearchCommonVo.getYear();
|
|
|
if (CollUtil.isEmpty(years)) {
|
|
|
log.warn("查询年份为空,返回空列表");
|
|
|
- return new ArrayList<>();
|
|
|
+ return new Page<>(reportSearchCommonVo.getPageNo() != null ? reportSearchCommonVo.getPageNo() : 1,
|
|
|
+ reportSearchCommonVo.getPageSize() != null ? reportSearchCommonVo.getPageSize() : 10);
|
|
|
}
|
|
|
- return reportMeetDataMapper.getPayableStatisticsByMonth(reportSearchCommonVo, systemCode);
|
|
|
+ List<ReportMeetDataDto> dataList = reportMeetDataMapper.getPayableStatisticsByMonth(reportSearchCommonVo, systemCode);
|
|
|
+
|
|
|
+ // 内存分页
|
|
|
+ int pageNo = reportSearchCommonVo.getPageNo() != null ? reportSearchCommonVo.getPageNo() : 1;
|
|
|
+ int pageSize = reportSearchCommonVo.getPageSize() != null ? reportSearchCommonVo.getPageSize() : 10;
|
|
|
+ int total = dataList.size();
|
|
|
+ int fromIndex = (pageNo - 1) * pageSize;
|
|
|
+ int toIndex = Math.min(fromIndex + pageSize, total);
|
|
|
+
|
|
|
+ Page<ReportMeetDataDto> page = new Page<>(pageNo, pageSize, total);
|
|
|
+ if (fromIndex < total) {
|
|
|
+ page.setRecords(dataList.subList(fromIndex, toIndex));
|
|
|
+ } else {
|
|
|
+ page.setRecords(new ArrayList<>());
|
|
|
+ }
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询指定年月的应付统计明细列表 - 分页查询
|
|
|
+ * 查询 sys_amount_auditing 中 create_time 落在该年月的所有提现记录
|
|
|
+ * 返回:业务员名称/手机号/银行卡号/银行/状态/提现金额/付款人/付款账户/付款时间/驳回人/驳回时间
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public IPage<?> getPayableStatisticsDetail(PayableStatisticsDetailParam param, String systemCode) {
|
|
|
+ log.info("财务数据-应付统计明细. param=[{}], systemCode=[{}]", JSONUtil.toJsonStr(param), systemCode);
|
|
|
+ if (param == null || StrUtil.isBlank(param.getYearAndMonthTime())) {
|
|
|
+ log.warn("查询年月为空,返回空列表");
|
|
|
+ return new Page<>(param.getPages(), param.getSize());
|
|
|
+ }
|
|
|
+ List<ReportMeetDataDetailDto> dataList = reportMeetDataMapper.getPayableStatisticsDetail(param, systemCode);
|
|
|
+
|
|
|
+ // 内存分页
|
|
|
+ int pageNo = param.getPages();
|
|
|
+ int pageSize = param.getSize();
|
|
|
+ int total = dataList.size();
|
|
|
+ int fromIndex = (pageNo - 1) * pageSize;
|
|
|
+ int toIndex = Math.min(fromIndex + pageSize, total);
|
|
|
+
|
|
|
+ Page<ReportMeetDataDetailDto> page = new Page<>(pageNo, pageSize, total);
|
|
|
+ if (fromIndex < total) {
|
|
|
+ page.setRecords(dataList.subList(fromIndex, toIndex));
|
|
|
+ } else {
|
|
|
+ page.setRecords(new ArrayList<>());
|
|
|
+ }
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 财务数据-应付统计导出Excel
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void exportPayableStatistics(ReportSearchCommonVo reportSearchCommonVo, String systemCode) {
|
|
|
+ log.info("财务数据-应付统计导出Excel. reportSearchCommonVo=[{}], systemCode=[{}]", JSONUtil.toJsonStr(reportSearchCommonVo), systemCode);
|
|
|
+ List<String> years = reportSearchCommonVo.getYear();
|
|
|
+ if (CollUtil.isEmpty(years)) {
|
|
|
+ log.warn("查询年份为空,不导出");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<ReportMeetDataDto> dataList = reportMeetDataMapper.getPayableStatisticsByMonth(reportSearchCommonVo, systemCode);
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ReportMeetDataDto.class, dataList, "财务数据-应付统计");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 财务数据-应付统计明细导出Excel
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void exportPayableStatisticsDetail(PayableStatisticsDetailParam param, String systemCode) {
|
|
|
+ log.info("财务数据-应付统计明细导出Excel. param=[{}], systemCode=[{}]", JSONUtil.toJsonStr(param), systemCode);
|
|
|
+ if (param == null || StrUtil.isBlank(param.getYearAndMonthTime())) {
|
|
|
+ log.warn("查询年月为空,不导出");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<ReportMeetDataDetailDto> dataList = reportMeetDataMapper.getPayableStatisticsDetail(param, systemCode);
|
|
|
+ EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ReportMeetDataDetailDto.class, dataList, "财务数据-应付统计明细");
|
|
|
}
|
|
|
|
|
|
@Override
|