1.导出方法主体
@Override
public String asyncExport(OrderTaxQueryDto queryDto, Lock lock) {
String maxThreadsKeyName = Constants.ORDER_TAX_EXPORT_MAX_KEY;
String maxThreadsPerUserKeyName = Constants.ORDER_TAX_EXPORT_XLSX_MAX_PER_USER_KEY;
String title = "导出";
ExcelManager excelManager = new DefaultExcelManager(title);
excelManager.init(applicationName, true);
excelManager.generateRedisKey(maxThreadsKeyName, maxThreadsPerUserKeyName, lock);
excelManager.asyncExport(() -> (int)this.count(queryDto), (String redisKey, Integer total) -> {
ExportHandler<OrderTaxExportVo> exportHandler = new DefaultExportHandler(title);
String[] heads = {
"公司名称","平台名称"};
exportHandler.init(redisKey, total, heads);
exportHandler.setModelPath("order/orderTax");
exportHandler.createWorkbook(200);
String fileName = "订单(" + getLoginPersonName() + ")" + new SimpleDateFormat("-yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".xlsx";
exportHandler.createTmpFile(fileName);
exportHandler.appendXssExcel((Integer pageNo, Integer pageSize) -> {
queryDto.setOffset((pageNo - 1