|
@@ -2,6 +2,7 @@ package com.ydtech.modules.report.service.impl;
|
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.ydtech.aop.exception.DescribeException;
|
|
import com.ydtech.aop.exception.DescribeException;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
@@ -9,22 +10,25 @@ import com.ydtech.core.page.PageResult;
|
|
|
import com.ydtech.modules.ins.utils.ExcelStyleLeftUtil;
|
|
import com.ydtech.modules.ins.utils.ExcelStyleLeftUtil;
|
|
|
import com.ydtech.modules.ins.utils.ExcelStyleUtil;
|
|
import com.ydtech.modules.ins.utils.ExcelStyleUtil;
|
|
|
import com.ydtech.modules.ins.utils.ExcelUtils2;
|
|
import com.ydtech.modules.ins.utils.ExcelUtils2;
|
|
|
|
|
+import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
|
|
+import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
|
|
+import com.ydtech.modules.order.entity.InsOrders;
|
|
|
|
|
+import com.ydtech.modules.order.entity.vo.PolicyInsuranceReportResVo;
|
|
|
import com.ydtech.modules.report.dao.ReportAgentBalanceSheetMapper;
|
|
import com.ydtech.modules.report.dao.ReportAgentBalanceSheetMapper;
|
|
|
import com.ydtech.modules.report.dao.ReportAgentProfitMapper;
|
|
import com.ydtech.modules.report.dao.ReportAgentProfitMapper;
|
|
|
import com.ydtech.modules.report.dao.ReportAgentStateMapper;
|
|
import com.ydtech.modules.report.dao.ReportAgentStateMapper;
|
|
|
|
|
+import com.ydtech.modules.report.dao.ReportInsurancePolicyMapper;
|
|
|
import com.ydtech.modules.report.model.ReportAgentBalanceSheet;
|
|
import com.ydtech.modules.report.model.ReportAgentBalanceSheet;
|
|
|
import com.ydtech.modules.report.model.ReportAgentProfit;
|
|
import com.ydtech.modules.report.model.ReportAgentProfit;
|
|
|
import com.ydtech.modules.report.model.ReportAgentState;
|
|
import com.ydtech.modules.report.model.ReportAgentState;
|
|
|
|
|
+import com.ydtech.modules.report.model.vo.*;
|
|
|
import com.ydtech.modules.report.service.ReportService;
|
|
import com.ydtech.modules.report.service.ReportService;
|
|
|
-import com.ydtech.modules.report.model.vo.ReportAgentBalanceSheetVo;
|
|
|
|
|
-import com.ydtech.modules.report.model.vo.ReportAgentProfitVo;
|
|
|
|
|
-import com.ydtech.modules.report.model.vo.ReportAgentStateVo;
|
|
|
|
|
-import com.ydtech.modules.report.model.vo.ReportReq;
|
|
|
|
|
import com.ydtech.security.utils.PubUserInfo;
|
|
import com.ydtech.security.utils.PubUserInfo;
|
|
|
import com.ydtech.utils.DateUtil;
|
|
import com.ydtech.utils.DateUtil;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -50,6 +54,9 @@ public class ReportServiceImpl implements ReportService {
|
|
|
private static final String TYPE_1 = "1";
|
|
private static final String TYPE_1 = "1";
|
|
|
private static final String TYPE_2 = "2";
|
|
private static final String TYPE_2 = "2";
|
|
|
|
|
|
|
|
|
|
+ @Value("${upload.file.path}")
|
|
|
|
|
+ private String uploadFilePath;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ReportAgentStateMapper reportAgentStateMapper;
|
|
private ReportAgentStateMapper reportAgentStateMapper;
|
|
|
|
|
|
|
@@ -58,6 +65,8 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ReportAgentBalanceSheetMapper reportAgentBalanceSheetMapper;
|
|
private ReportAgentBalanceSheetMapper reportAgentBalanceSheetMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ReportInsurancePolicyMapper reportInsurancePolicyMapper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 保险专业中介机构基本情况表导入
|
|
* 保险专业中介机构基本情况表导入
|
|
@@ -910,4 +919,30 @@ public class ReportServiceImpl implements ReportService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 报表-出单量及费用统计-查询
|
|
|
|
|
+ * @param reqVo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public BasePageResult<OrderVolumeAndCostStatisticsResVo> queryOrderAndCostData(StatisticsReportReqVo reqVo){
|
|
|
|
|
+ com.baomidou.mybatisplus.extension.plugins.pagination.Page<InsOrders> page = new Page<>(reqVo.getPageNum(), reqVo.getPageSize());
|
|
|
|
|
+ page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
|
|
|
|
|
+ Page<OrderVolumeAndCostStatisticsResVo> orderVolumeAndCostStatisticsResVoPage = reportInsurancePolicyMapper.queryOrderAndCostData(page,
|
|
|
|
|
+ reqVo);
|
|
|
|
|
+ Long total = reportInsurancePolicyMapper.queryOrderAndCostDataCount(reqVo);
|
|
|
|
|
+ orderVolumeAndCostStatisticsResVoPage.setTotal(total);
|
|
|
|
|
+ return new BasePageResult<>(reqVo.getPageNum(), reqVo.getPageSize(),
|
|
|
|
|
+ orderVolumeAndCostStatisticsResVoPage.getTotal(), orderVolumeAndCostStatisticsResVoPage.getPages()
|
|
|
|
|
+ , orderVolumeAndCostStatisticsResVoPage.getRecords());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<String> exportOrderAndCostData(StatisticsReportReqVo reqDto) {
|
|
|
|
|
+ List<OrderVolumeAndCostStatisticsResVo> orderVolumeAndCostStatisticsResVoPage = reportInsurancePolicyMapper.queryOrderAndCostData(reqDto);
|
|
|
|
|
+ String s = EasyExcelUtils.downExcel(uploadFilePath, OrderVolumeAndCostStatisticsResVo.class, orderVolumeAndCostStatisticsResVoPage);
|
|
|
|
|
+ return HttpResult.ok("", s);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|