Commit d5176183 authored by huyuchen's avatar huyuchen

huych-导出优化

parent 744c7ef1
......@@ -295,7 +295,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
if (count > CommonConstants.ZERO_INT) {
int batchSize = CommonConstants.EXCEL_EXPORT_LIMIT_1;
int totalPages = (int) Math.ceil((double) count / batchSize);
List<SalaryAccountExportVo> batchList;
for (int page = 1; page <= totalPages; page++) {
// 每10万条数据切换一个新sheet,防止单个sheet过大
if ((page - 1) * batchSize % 100000 == 0 && (page - 1) * batchSize > 0) {
......@@ -307,7 +307,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
searchVo.setLimitStart((page - 1) * batchSize);
searchVo.setLimitEnd(batchSize);
List<SalaryAccountExportVo> batchList = baseMapper.noPageDiyLastNew(searchVo,searchVo.getIdList(),deptNos);
batchList = baseMapper.noPageDiyLastNew(searchVo,searchVo.getIdList(),deptNos);
if (Common.isNotNull(batchList)) {
excelWriter.write(batchList, writeSheet);
// 及时清空批次数据
......
......@@ -68,6 +68,10 @@ public class TForecastLibraryController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TForecastLibrary>> getTForecastLibraryPage(Page<TForecastLibrary> page, TForecastLibrary tForecastLibrary) {
//Ekp1.9.11查询条件 社保生成月和公积金生成月必填其一
if (Common.isEmpty(tForecastLibrary.getSocialCreateMonth()) && Common.isEmpty(tForecastLibrary.getProvidentCreateMonth())) {
return null;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tForecastLibrary);
if (Common.isNotNull(tForecastLibrary.getAuthSql()) && tForecastLibrary.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......@@ -140,6 +144,10 @@ public class TForecastLibraryController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tforecastlibrary-export')")
public void export(HttpServletResponse response, @RequestBody TForecastLibrary searchVo) {
//Ekp1.9.11查询条件 社保生成月和公积金生成月必填其一
if (Common.isEmpty(searchVo.getSocialCreateMonth()) && Common.isEmpty(searchVo.getProvidentCreateMonth())) {
return;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......
......@@ -70,6 +70,10 @@ public class TIncomeController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TIncome>> getTIncomePage(Page<TIncome> page, TIncomeSearchVo tIncome) {
//Ekp1.9.11查询条件 数据生成时间必填
if (Common.isEmpty(tIncome.getDataCreateMonth())) {
return null;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tIncome);
return new R<>(tIncomeService.getTIncomePage(page, tIncome));
......@@ -155,6 +159,10 @@ public class TIncomeController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tincome-export')")
public void export(HttpServletResponse response, @RequestBody TIncomeSearchVo searchVo) {
//Ekp1.9.11查询条件 数据生成时间必填
if (Common.isEmpty(searchVo.getDataCreateMonth())) {
return;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tIncomeService.listExport(response, searchVo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment