From 6e78892c440406c94fa1190d8daa04480620f13a Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 28 十二月 2024 01:31:02 +0800
Subject: [PATCH] 通用导入Excel更新

---
 Tiger.Controllers.System/Controllers/Base/BaseController.cs |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Tiger.Controllers.System/Controllers/Base/BaseController.cs b/Tiger.Controllers.System/Controllers/Base/BaseController.cs
index c544d3f..8f3399b 100644
--- a/Tiger.Controllers.System/Controllers/Base/BaseController.cs
+++ b/Tiger.Controllers.System/Controllers/Base/BaseController.cs
@@ -577,12 +577,13 @@
 
         #region 瀵煎叆Excel
         [HttpPost]
-        public async Task<IActionResult> ImportExcel([FromBody] ApiAction action)
+        public async Task<IActionResult> ImportExcel([FromBody] ApiAction<ImportInput> action)
         {
             ApiAction response;
             try
             {
-                response = action.GetResponse(await DI.Resolve<IImportExcel>().Import(action.NewDataEntity(),action.Data?.ToString()));
+                IImportExcel import = DI.Resolve(action.Data.typeFullName) as IImportExcel;
+                response = action.GetResponse(await import.Import(action.NewDataEntity(),action.Data));
             }
             catch (System.Exception ex)
             {
@@ -597,12 +598,13 @@
         /// <param name="action"></param>
         /// <returns></returns>
         [HttpPost]
-        public async Task<IActionResult> ValidateTableImport([FromBody] ApiAction<ImportEntityValidate> action)
+        public async Task<IActionResult> ValidateTableImport([FromBody] ApiAction<ImportValidateInput> action)
         {
             ApiAction response;
             try
             {
-                response = action.GetResponse(await DI.Resolve<IImportExcel>().ValidateTableImport(action.NewDataEntity(), action.Data));
+                IImportExcel import = DI.Resolve(action.Data.typeFullName) as IImportExcel;
+                response = action.GetResponse(await import.ValidateTableImport(action.NewDataEntity(), action.Data));
             }
             catch (System.Exception ex)
             {

--
Gitblit v1.9.3