|
|
@@ -152,16 +152,23 @@ public class NewExcelUtil<T> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出CXCEL表
|
|
|
+ * 直接导出CXCEL表
|
|
|
* @param list 导出数据集合
|
|
|
* @param sheetName 工作表的名称
|
|
|
* @param response
|
|
|
*/
|
|
|
- public void exportExcel(List<T> list, String sheetName, HttpServletResponse response) {
|
|
|
+ public Result exportExcel(List<T> list, String sheetName, HttpServletResponse response) {
|
|
|
this.init(list, sheetName);
|
|
|
+ //直接导出
|
|
|
exportExcel(response);
|
|
|
+ return new Result().data(1);
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 导出CXCEL到指定目录下
|
|
|
+ * @param list 导出数据集合
|
|
|
+ * @param sheetName 工作表的名称
|
|
|
+ * @param response
|
|
|
+ */
|
|
|
public Result exportExcel(List<T> list, String sheetName, String uploadPath) {
|
|
|
this.init(list, sheetName);
|
|
|
this.downloadPath=uploadPath;
|