diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs index 82773688..ad6b9344 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs @@ -18,9 +18,9 @@ public class Ghre_ExamController : BaseController /// [HttpPost, Route("GetModuleInfo")] - public dynamic GetModuleInfo([FromBody] ModuleParam param) + public async Task GetModuleInfo([FromBody] ModuleParam param) { - var data = _service.GetModuleInfo(param); + var data = await _service.GetModuleInfo(param); return data; } diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs index 37373246..f3bb9043 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs @@ -9,6 +9,6 @@ namespace Tiobon.Core.IServices /// public interface IGhre_ExamServices : IBaseServices { - dynamic GetModuleInfo(ModuleParam param); + Task GetModuleInfo(ModuleParam param); } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index 2c0b60be..ca9da5f3 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -24,7 +24,7 @@ public class Ghre_ExamServices : BaseServices GetModuleInfo(ModuleParam param) { dynamic result = new ExpandoObject(); dynamic data = new ExpandoObject(); @@ -133,9 +133,38 @@ public class Ghre_ExamServices : BaseServices>("DT_PageMutiMsg"); + if (DT_PageMutiMsg == null || (DT_PageMutiMsg != null && !DT_PageMutiMsg.Any())) + { + sql = $@"SELECT Langkey field, + CASE {param.langId} + WHEN 1 THEN isnull (Value01, LangValue) + WHEN 2 THEN isnull (Value02, LangValue) + WHEN 3 THEN isnull (Value03, LangValue) + WHEN 4 THEN isnull (Value04, LangValue) + WHEN 5 THEN isnull (Value05, LangValue) + WHEN 6 THEN isnull (Value06, LangValue) + WHEN 7 THEN isnull (Value07, LangValue) + WHEN 8 THEN isnull (Value08, LangValue) + WHEN 9 THEN isnull (Value09, LangValue) + WHEN 10 THEN isnull (Value10, LangValue) + END label + FROM Ghrs_LangKey + WHERE (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%') + AND IsEnable = 1"; + DT_PageMutiMsg = Db.Ado.SqlQuery(sql); + if (DT_PageMutiMsg.Any()) + await _caching.SetAsync("DT_PageMutiMsg", DT_PageMutiMsg); + } + #endregion + data.Toolbar = Toolbar; data.DT_Procedure = DT_Procedure; data.SearchFormFields = SearchFormFields; + data.DT_PageMutiMsg = DT_PageMutiMsg; result.Success = true; result.Status = 200;