Commit 002253e2 authored by 李驰骋's avatar 李驰骋

excel导出方法调整

parent e3ba36e6
......@@ -26,8 +26,9 @@ import ${packageName}.dto${childPackageName}.${ClassName}Create;
import ${packageName}.dto${childPackageName}.${ClassName}Update;
import ${packageName}.dto${childPackageName}.${ClassName}ExcelExport;
import ${packageName}.service${childPackageName}.I${ClassName}Service;
import com.ximai.common.utils.poi.ExcelUtil;
import com.ximai.common.utils.excel.ExcelWriter;
import cn.hutool.core.bean.BeanUtil;
import java.io.IOException;
#if($table.crud || $table.sub)
import com.ximai.common.core.page.TableDataInfo;
#elseif($table.tree)
......@@ -97,11 +98,10 @@ public class ${ClassName}Controller extends BaseController
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ${ClassName} ${className}) {
public void export(HttpServletResponse response, ${ClassName} ${className}) throws IOException {
List<${ClassName}Dto> list = ${className}Service.select${ClassName}List(${className});
ExcelUtil<${ClassName}ExcelExport> util = new ExcelUtil<${ClassName}ExcelExport>(${ClassName}ExcelExport.class);
List<${ClassName}ExcelExport> tempList = BeanUtil.copyToList(list, ${ClassName}ExcelExport.class);
util.exportExcel(response, tempList, "${functionName}数据");
List<${ClassName}ExcelExport> exportList = BeanUtil.copyToList(list, ${ClassName}ExcelExport.class);
ExcelWriter.write(response, ${ClassName}ExcelExport.class, exportList);
}
/**
......
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