From 923aac7ea6e9bbae1eb8f911297c1ddb4040a7e4 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 18 Jul 2024 09:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96ESS=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_StudyRecordController.cs | 14 ++++ .../Ghre/IGhre_StudyRecordServices.cs | 5 +- .../Ghre/Ghre_StudyRecordServices.cs | 76 +++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRecordController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRecordController.cs index 0de96f9a..1ce90429 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRecordController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_StudyRecordController.cs @@ -11,4 +11,18 @@ public class Ghre_StudyRecordController : BaseController + /// 获取ESS查询条件 + /// + /// + /// + [HttpPost, Route("QueryESSSearchFields")] + public async Task> QueryESSSearchFields([FromBody] QueryBody body) + { + return await _service.QueryESSSearchFields(body); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordServices.cs index 45272442..e228256a 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordServices.cs @@ -1,4 +1,6 @@ -using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Common; +using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices @@ -8,5 +10,6 @@ namespace Tiobon.Core.IServices /// public interface IGhre_StudyRecordServices :IBaseServices { + Task> QueryESSSearchFields(QueryBody body); } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index 80bfa3ee..e4be238e 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -116,5 +116,81 @@ namespace Tiobon.Core.Services return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); } + + + #region 获取ESS查询条件 + public async Task> QueryESSSearchFields(QueryBody body) + { + var entity = new CoursePublicSearch(); + string sql = @"SELECT Langkey field, + CASE {2} + 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 IsEnable = 1 + AND (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%')"; + sql = string.Format(sql, body.menuName, App.User.ID, body.langId); + entity.DT_PageMutiMsg = await Db.Ado.SqlQueryAsync(sql); + entity.SearchFields.Add(new CoursePublicSearchField() + { + label = "课程编号/名称", + field = "CourseNoOrName", + elementType = "Input", + editable = true, + required = false, + multipleSelect = false, + }); + entity.SearchFields.Add(new CoursePublicSearchField() + { + label = "课程分类", + field = "CourseClassId", + elementType = "ApiSelect", + dataSource = "CommonList_TrainingCourseClass", + editable = true, + required = false, + multipleSelect = false, + }); + entity.SearchFields.Add(new CoursePublicSearchField() + { + label = "'课程场景", + field = "CourseSceneId", + elementType = "ApiSelect", + dataSource = "CommonList_TrainingCourseScene", + editable = true, + required = false, + multipleSelect = false, + }); + entity.SearchFields.Add(new CoursePublicSearchField() + { + label = "'课程状态", + field = "CourseStatus", + elementType = "ApiSelect", + dataSource = "TBParaDetail_Train_CourseIsOpen", + editable = true, + required = false, + multipleSelect = false, + }); + entity.SearchFields.Add(new CoursePublicSearchField() + { + label = "'学习状态", + field = "StudyStatus", + elementType = "ApiSelect", + dataSource = "TBParaDetail_Train_CourseIsOpen", + editable = true, + required = false, + multipleSelect = false, + }); + return ServiceResult.OprateSuccess("", entity); + } + #endregion } } \ No newline at end of file