From 8b6a2cabe0ef6cf2384537f6878964469e256eda Mon Sep 17 00:00:00 2001
From: YangYuGang <1378265336@qq.com>
Date: 星期三, 12 三月 2025 08:59:31 +0800
Subject: [PATCH] Merge branch 'master' of http://47.115.28.255:8110/r/TigerClouds-Tech/Server/TigerApi6_2024

---
 Tiger.Controllers.System/Controllers/Base/BaseController.cs |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/Tiger.Controllers.System/Controllers/Base/BaseController.cs b/Tiger.Controllers.System/Controllers/Base/BaseController.cs
index 7783881..8f3399b 100644
--- a/Tiger.Controllers.System/Controllers/Base/BaseController.cs
+++ b/Tiger.Controllers.System/Controllers/Base/BaseController.cs
@@ -569,10 +569,49 @@
             {
                 await file.CopyToAsync(stream);
             }
-
-            return Ok(new { file.FileName, file.ContentType, file.Length, url= $@"{BizConfig.Configuration["DownloadAddress"]}/"+ file.FileName });
+            var downloadAddress = entityName == "BAS_LABEL_TEMP" || entityName == "BAS_LABEL_VAR" ? "/Template" : "";
+            return Ok(new { file.FileName, file.ContentType, file.Length, url= $@"{BizConfig.Configuration["DownloadAddress"]}{downloadAddress}/"+ file.FileName });
         }
 
         #endregion
+
+        #region 瀵煎叆Excel
+        [HttpPost]
+        public async Task<IActionResult> ImportExcel([FromBody] ApiAction<ImportInput> action)
+        {
+            ApiAction response;
+            try
+            {
+                IImportExcel import = DI.Resolve(action.Data.typeFullName) as IImportExcel;
+                response = action.GetResponse(await import.Import(action.NewDataEntity(),action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = action.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+
+        /// <summary>
+        /// 瀵煎叆Excel鍓嶉獙璇�
+        /// </summary>
+        /// <param name="action"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> ValidateTableImport([FromBody] ApiAction<ImportValidateInput> action)
+        {
+            ApiAction response;
+            try
+            {
+                IImportExcel import = DI.Resolve(action.Data.typeFullName) as IImportExcel;
+                response = action.GetResponse(await import.ValidateTableImport(action.NewDataEntity(), action.Data));
+            }
+            catch (System.Exception ex)
+            {
+                response = action.GetResponse().CatchExceptionWithLog(ex);
+            }
+            return Ok(response);
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3