From bdfbee261427c484ad8e6871ea5b2a710ff5ba5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Tue, 15 Nov 2022 18:10:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BAExcel=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Admin.WebApi/Controllers/BaseController.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ZR.Admin.WebApi/Controllers/BaseController.cs b/ZR.Admin.WebApi/Controllers/BaseController.cs
index 83454ac..fd7d9f8 100644
--- a/ZR.Admin.WebApi/Controllers/BaseController.cs
+++ b/ZR.Admin.WebApi/Controllers/BaseController.cs
@@ -112,6 +112,13 @@ namespace ZR.Admin.WebApi.Controllers
///
///
protected string ExportExcel(List list, string sheetName, string fileName)
+ {
+ var fileInfo = ExportExcelNew(list, sheetName, fileName);
+
+ return fileInfo.Item1;
+ }
+
+ protected (string, string) ExportExcelNew(List list, string sheetName, string fileName)
{
IWebHostEnvironment webHostEnvironment = (IWebHostEnvironment)App.ServiceProvider.GetService(typeof(IWebHostEnvironment));
string sFileName = $"{fileName}{DateTime.Now:MMddHHmmss}.xlsx";
@@ -130,7 +137,7 @@ namespace ZR.Admin.WebApi.Controllers
package.Save();
}
- return sFileName;
+ return (sFileName, newFileName);
}
///