From dc1e5cd2c50bdcd712b5f95b2170bf7d421db4f0 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 30 四月 2025 13:19:09 +0800 Subject: [PATCH] 来料打印更新 --- Tiger.Controllers.System/Controllers/Base/BaseController.cs | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/Tiger.Controllers.System/Controllers/Base/BaseController.cs b/Tiger.Controllers.System/Controllers/Base/BaseController.cs index 24899c1..8f3399b 100644 --- a/Tiger.Controllers.System/Controllers/Base/BaseController.cs +++ b/Tiger.Controllers.System/Controllers/Base/BaseController.cs @@ -574,5 +574,44 @@ } #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