diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index 9fbfa3cb..dff9b029 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -109796,13 +109796,13 @@ LABL 0 Arial Unicode MS,8,N B008CEB4-7C11-4C3C-A36E-DAF2CF483B2F -关联ID -LinkId +课程场景ID +CourseSceneId 1716860201 Administrator -1716877222 +1717031496 Administrator -关联ID +课程场景ID bigint diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs index 3d69ee88..a2656c0c 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamController.cs @@ -68,4 +68,7 @@ public class Ghre_ExamController : BaseController + /// 获取通用列表下拉 + /// + /// + /// + [HttpPost, Route("GetSelect")] + public async Task> GetSelectAsync(long? linkId) + { + return await _service.GetSelectAsync(linkId); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 8cc54fc1..a829e5df 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -1435,9 +1435,9 @@ 关联类型 - + - 关联ID + 课程场景ID @@ -4323,9 +4323,9 @@ 关联类型 - + - 关联ID + 课程场景ID diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index f0a2d653..ebaf4ec6 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -652,6 +652,13 @@ + + + 获取通用列表下拉 + + + + 试卷题目(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs index 4f66fba8..99c51b9f 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs @@ -20,5 +20,7 @@ namespace Tiobon.Core.IServices Task UpdateStatus(long[] ids, string status); Task> QueryList(QueryBody body, string status); + + Task> GetSelectAsync(long? linkId); } } \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_Exam.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_Exam.Dto.Base.cs index d430a97b..dd3726e8 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_Exam.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_Exam.Dto.Base.cs @@ -33,9 +33,9 @@ namespace Tiobon.Core.Model.Models public string LinkType { get; set; } /// - /// 关联ID + /// 课程场景ID /// - public long? LinkId { get; set; } + public long? CourseSceneId { get; set; } /// /// 课程ID diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_Exam.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_Exam.cs index d6e85865..4878f84a 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_Exam.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_Exam.cs @@ -35,9 +35,9 @@ namespace Tiobon.Core.Model.Models public string LinkType { get; set; } /// - /// 关联ID + /// 课程场景ID /// - public long? LinkId { get; set; } + public long? CourseSceneId { get; set; } /// /// 课程ID diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index bad3b70c..613f618c 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -448,7 +448,7 @@ namespace Tiobon.Core.Services input.pageData.styleInfo.coverImage = exampaper.CoverUrl; input.pageData.styleInfo.paperStyle = exampaper.Style; input.pageData.styleInfo.coverBackGround = exampaper.CoverBackGround; - + input.pageData.examPaperSetType = exampaper.SetMethod; input.pageData.examPaperSetData = await _ghre_ExamPaperConfigServices.Query(x => x.ExamPaperId == Id, "TaxisNo ASC"); @@ -730,5 +730,61 @@ delete from Ghre_ExamPaperQuestion WHERE ExamPaperId='{id}';"); if (model.baseData.AnswerTime <= 0) throw new Exception("答题时间需大于0!"); } + + #region 获取通用列表下拉 + /// + /// 获取通用列表下拉 + /// + /// + /// + public async Task> GetSelectAsync(long? linkId) + { + var result = new CommonSelect(); + var TableColumn = new JArray(); + var DT_TablePageInfoT1 = new JArray(); + var DT_TableDataT1 = new JArray(); + var searchItem = new JObject(); + JObject item; + DataTable dt; + string sql; + searchItem = [ + new JProperty("defaultHidden", true), + new JProperty("field","value"), + new JProperty("label","试卷ID"), + ]; + TableColumn.Add(searchItem); + searchItem = [ + new JProperty("field","label"), + new JProperty("label","试卷名称"), + ]; + TableColumn.Add(searchItem); + + sql = $"SELECT Id, PaperNo, PaperName FROM Ghre_ExamPaper WHERE LinkId='{linkId}' AND IsEnable=1 ORDER BY CreateTime DESC"; + dt = await Db.Ado.GetDataTableAsync(sql); + + for (int i = 0; i < dt.Rows.Count; i++) + { + item = [ + new JProperty("value",long.Parse(dt.Rows[i]["Id"].ToString())), + new JProperty("label", dt.Rows[i]["PaperName"].ToString() + "("+dt.Rows[i]["PaperNo"].ToString()+")") + ]; + DT_TableDataT1.Add(item); + } + + item = [ + new JProperty("ListMax",100), + new JProperty("ListMin",10), + new JProperty("PageNum",1), + new JProperty("PageSize",99999), + new JProperty("TotalCount",dt.Rows.Count), + new JProperty("UIType","Auto") + ]; + DT_TablePageInfoT1.Add(item); + result.JM_TableColumnT1.TableColumn = TableColumn; + result.DT_TableDataT1 = DT_TableDataT1; + result.DT_TablePageInfoT1 = DT_TablePageInfoT1; + return new ServiceResult() { Success = true, Message = "查询成功", Data = result, }; + } + #endregion } } \ 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 d925e18b..4ea4a67d 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -298,6 +298,17 @@ public class Ghre_ExamServices : BaseServices - + - 关联ID + 课程场景ID @@ -4323,9 +4323,9 @@ 关联类型 - + - 关联ID + 课程场景ID diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index f0a2d653..ebaf4ec6 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -652,6 +652,13 @@ + + + 获取通用列表下拉 + + + + 试卷题目(Controller)