From e6f76629d3f654787a5c81c7f80e5838850e1aa9 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 28 May 2024 18:06:58 +0800 Subject: [PATCH] =?UTF-8?q?2.=E6=96=B0=E5=A2=9E=E8=80=83=E8=AF=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B5=E3=80=90=E8=8D=89=E7=A8=BF=E7=AE=B1=E3=80=81?= =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E3=80=81=E5=B7=B2=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E3=80=91=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Ghre/Ghre_ExamController.cs | 14 + Tiobon.Core.Api/Tiobon.Core.xml | 6 + .../Ghre/IGhre_ExamServices.cs | 2 + .../Ghre/Ghre_ExamServices.cs | 146 ++++- Tiobon.Core/Tiobon.Core.Model.xml | 500 ++++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 16 + 6 files changed, 674 insertions(+), 10 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs index 926ace5b..78b4576f 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs @@ -11,4 +11,18 @@ public class Ghre_ExamController : BaseController + /// 查询初始化数据 + /// + /// + [HttpPost, Route("GetModuleInfo")] + public dynamic GetModuleInfo([FromBody] ModuleParam param) + { + var data = _service.GetModuleInfo(param); + return data; + } + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index be2225f0..58565c66 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -584,6 +584,12 @@ Ghre_Exam(Controller) + + + 查询初始化数据 + + + 试卷配置(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs index e26f1a0c..0fe3af96 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs @@ -1,4 +1,5 @@ using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices @@ -8,5 +9,6 @@ namespace Tiobon.Core.IServices /// public interface IGhre_ExamServices :IBaseServices { + dynamic 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 fbcbba4a..b4278a4d 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -4,20 +4,146 @@ using Tiobon.Core.Model.Models; using Tiobon.Core.Services.BASE; using Tiobon.Core.IRepository.Base; using Tiobon.Core.Common.Caches; +using System.Dynamic; +using Newtonsoft.Json.Linq; +using Tiobon.Core.Model; +using System.Data; +using Tiobon.Core.Common; +using AgileObjects.AgileMapper; +using Newtonsoft.Json; -namespace Tiobon.Core.Services +namespace Tiobon.Core.Services; + +/// +/// Ghre_Exam (服务) +/// +public class Ghre_ExamServices : BaseServices, IGhre_ExamServices { - /// - /// Ghre_Exam (服务) - /// - public class Ghre_ExamServices : BaseServices, IGhre_ExamServices + private readonly IBaseRepository _dal; + public Ghre_ExamServices(ICaching caching, IBaseRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + base._caching = caching; + } + public dynamic GetModuleInfo(ModuleParam param) { - private readonly IBaseRepository _dal; - public Ghre_ExamServices(ICaching caching, IBaseRepository dal) + dynamic result = new ExpandoObject(); + dynamic data = new ExpandoObject(); + + var Toolbar = new List(); + + Toolbar.Add(new Toolbar() + { + fnKey = "NewYN", + fnKeyValue = null, + fnTitle = "新增", + fnType = "table", + position = "left", + icon = "ghr-icon-add", + display = true + }); + Toolbar.Add(new Toolbar() + { + fnKey = "Release", + fnKeyValue = null, + fnTitle = "发布", + fnType = "table", + position = "left", + icon = "ghr-publish", + display = true + }); + + var DT_Procedure = new DT_Procedure(); + + var sql = "select QueryProcedure, EditProcedure, IUDProcedure from Ghrs_Menu where MenuNo='{0}'"; + sql = string.Format(sql, param.menuName, App.User.ID, param.langId); + var dt = Db.Ado.GetDataTable(sql); + if (dt.Rows.Count > 0) { - this._dal = dal; - base.BaseDal = dal; - base._caching = caching; + DT_Procedure.QueryProcedure = dt.Rows[0]["QueryProcedure"].ToString(); + DT_Procedure.EditProcedure = dt.Rows[0]["EditProcedure"].ToString(); + DT_Procedure.IUDProcedure = dt.Rows[0]["IUDProcedure"].ToString(); } + sql = $@"SELECT PageSettingQueryId, + elementType, + field, + [dbo].[FLangKeyToValue] (Meky, {param.langId}, label) + label, + Meky, + multipleSelect, + dataType, + required, + palceholder, + dataSourceType, + dbo.FS_GetdataSourceBySet + (dataSource, APIDataSourceType, Ghrs_PageSettingQuery.APIDataSourceID) + dataSource, + sortable, + sortOrder, + defaultHidden, + ConfigIsShow, + filterable, + CAST(CASE WHEN width = '' THEN '100' ELSE width END AS INT) width, + align, + fixed, + editable, + searchable, + searchRequired, + searchColumnSeq, + multipleSearchValue, + maxTagCount, + selfDefine, + selectUI, + isPrimaryKey, + 'false' + isSorted, + 'false' + isHidden, + CASE + WHEN searchColumnSeq IS NULL OR searchColumnSeq = '' THEN 'false' + ELSE 'true' + END + isSearched, + SortNo, + -- searchCanOperator, + ( select ParaDetailNo operator, + [dbo].[FLangKeyToValue](MKey,1,ParaDetailName) operatorDesc, + SqlFunction operatorIcon + from Ghrs_ParaDetail where ParaMasterId=13 and IsEnable=1 + and ParaDetailNo in (select Value from dbo.Fs1_GHR30_SplitString2(searchCanOperator,',')) + order by (select positon from dbo.Fs1_GHR30_SplitString2(searchCanOperator,',') + where value= ParaDetailNo) + FOR JSON Path ) searchOperator1, + '' + searchColumnDefaultValue, + '' + AppColumnType + FROM Ghrs_PageSettingQuery + WHERE PageNo = '{param.menuName}' + AND elementType NOT IN ('PageGroup') + AND IsEnable = 1 + ORDER BY SortNo ASC"; + + sql = string.Format(sql, param.menuName, App.User.ID, param.langId); + var TableColumn = Db.Ado.SqlQuery(sql); + var SearchFormFields = Mapper.Map(TableColumn).ToANew>(); + SearchFormFields.ForEach(x => + { + if (!string.IsNullOrWhiteSpace(x.searchOperator1)) + x.searchOperator = JsonConvert.DeserializeObject>(x.searchOperator1); + x.searchOperator1 = null; + }); + + data.Toolbar = Toolbar; + data.DT_Procedure = DT_Procedure; + data.SearchFormFields = SearchFormFields; + + result.Success = true; + result.Status = 200; + result.Data = data; + result.Message = "查询成功"; + return result; } + } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 77dde1e4..65d91378 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -805,6 +805,141 @@ 预留字段12 + + + Ghre_Exam (Dto.Base) + + + + + 关联类型 + + + + + 关联ID + + + + + 课程ID + + + + + 试卷ID + + + + + 考试编号 + + + + + 日期类型 + + + + + 开始时间 + + + + + 结束时间 + + + + + 学完多久 + + + + + 考试形式 + + + + + 是否关联开班 + + + + + 开班ID + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 试卷 (Dto.Base) @@ -1165,6 +1300,96 @@ 预留字段12 + + + Ghre_ExamStaff (Dto.Base) + + + + + 试卷ID + + + + + 员工ID + + + + + 来源 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 题目 (Dto.Base) @@ -1714,6 +1939,11 @@ 课件附件 (Dto.EditInput) + + + Ghre_Exam (Dto.EditInput) + + 试卷 (Dto.EditInput) @@ -1729,6 +1959,11 @@ 试卷题目 (Dto.EditInput) + + + Ghre_ExamStaff (Dto.EditInput) + + 题目 (Dto.EditInput) @@ -1789,6 +2024,11 @@ 课件附件 (Dto.InsertInput) + + + Ghre_Exam (Dto.InsertInput) + + 试卷 (Dto.InsertInput) @@ -1804,6 +2044,11 @@ 试卷题目 (Dto.InsertInput) + + + Ghre_ExamStaff (Dto.InsertInput) + + 题目 (Dto.InsertInput) @@ -2798,6 +3043,141 @@ 预留字段12 + + + Ghre_Exam (Model) + + + + + 关联类型 + + + + + 关联ID + + + + + 课程ID + + + + + 试卷ID + + + + + 考试编号 + + + + + 日期类型 + + + + + 开始时间 + + + + + 结束时间 + + + + + 学完多久 + + + + + 考试形式 + + + + + 是否关联开班 + + + + + 开班ID + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 试卷 (Model) @@ -3158,6 +3538,96 @@ 预留字段12 + + + Ghre_ExamStaff (Model) + + + + + 试卷ID + + + + + 员工ID + + + + + 来源 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 题目 (Model) @@ -4576,6 +5046,21 @@ 修改信息 + + + Ghre_Exam(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + 试卷(Dto.View) @@ -4611,6 +5096,21 @@ 试卷题目(Dto.View) + + + Ghre_ExamStaff(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + 题目(Dto.View) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 6f5e6ce0..58565c66 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -579,6 +579,17 @@ 课件(Controller) + + + Ghre_Exam(Controller) + + + + + 查询初始化数据 + + + 试卷配置(Controller) @@ -631,6 +642,11 @@ 试卷题目(Controller) + + + Ghre_ExamStaff(Controller) + + 题目答案(Controller)