2.新增考试查询页【草稿箱、已发布、已归档】初始化信息接口

master
xiaochanghai 1 year ago
parent 870125a30b
commit 5f6d21ed4b
  1. 4
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs
  2. 2
      Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs
  3. 31
      Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs

@ -18,9 +18,9 @@ public class Ghre_ExamController : BaseController<IGhre_ExamServices, Ghre_Exam,
/// </summary>
/// <returns></returns>
[HttpPost, Route("GetModuleInfo")]
public dynamic GetModuleInfo([FromBody] ModuleParam param)
public async Task<dynamic> GetModuleInfo([FromBody] ModuleParam param)
{
var data = _service.GetModuleInfo(param);
var data = await _service.GetModuleInfo(param);
return data;
}

@ -9,6 +9,6 @@ namespace Tiobon.Core.IServices
/// </summary>
public interface IGhre_ExamServices : IBaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhre_ExamInput, EditGhre_ExamInput>
{
dynamic GetModuleInfo(ModuleParam param);
Task<dynamic> GetModuleInfo(ModuleParam param);
}
}

@ -24,7 +24,7 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
base.BaseDal = dal;
base._caching = caching;
}
public dynamic GetModuleInfo(ModuleParam param)
public async Task<dynamic> GetModuleInfo(ModuleParam param)
{
dynamic result = new ExpandoObject();
dynamic data = new ExpandoObject();
@ -133,9 +133,38 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
x.searchOperator1 = null;
});
#region DT_PageMutiMsg
var DT_PageMutiMsg = await _caching.GetAsync<List<DT_PageMutiMsg>>("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<DT_PageMutiMsg>(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;

Loading…
Cancel
Save