From 93b63d4862e109cbec0638f2df73b243579b32af Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 9 Apr 2025 11:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B=E3=80=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=9C=BA=E6=99=AF=E6=9F=A5=E8=AF=A2=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AD=A6=E5=88=86=E8=A7=84=E5=88=99=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/Ghre/Ghre_Course.Dto.View.cs | 1 + .../View/Ghre/Ghre_CourseScene.Dto.View.cs | 1 + .../Ghre/Ghre_CourseSceneServices.cs | 7 +++---- Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs | 3 ++- .../Ghre/Ghre_CreditRuleServices.cs | 15 +++++++++++++++ Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs | 9 +++++++++ Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs | 1 + 7 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_Course.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_Course.Dto.View.cs index 1bceed49..f72697a7 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_Course.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_Course.Dto.View.cs @@ -52,5 +52,6 @@ public class Ghre_CourseDto : Ghre_Course public List CourseClassIds { get; set; } = new List(); public List CourseSceneIds1 { get; set; } = new List(); public string BuiltInLabel { get; set; } + public string CreditRuleName { get; set; } } diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs index e3a77920..9bea9ad3 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs @@ -38,5 +38,6 @@ public class Ghre_CourseSceneDto : Ghre_CourseScene public List Courses { get; set; } public string BuiltInLabel { get; set; } + public string CreditRuleName { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs index c66064f8..75060738 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs @@ -1,7 +1,4 @@ -using System.Net; -using Tiobon.Core.IServices; - -namespace Tiobon.Core.Services; +namespace Tiobon.Core.Services; /// /// 课程场景 (服务) @@ -48,6 +45,8 @@ public class Ghre_CourseSceneServices : BaseServices(); var coures = await Db.Queryable().Where(x => x.CourseSceneIds != null && x.CourseSceneIds.Contains(objId.ObjToString())).ToListAsync(); + if (DT_TableDataT1.CreditRuleId != null) + DT_TableDataT1.CreditRuleName = (await Db.Queryable().Where(x => x.Id == DT_TableDataT1.CreditRuleId).FirstAsync())?.RuleName; DT_TableDataT1.Courses = coures; return DT_TableDataT1; diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs index 9a8a9e67..0ff25ce9 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs @@ -340,7 +340,8 @@ public class Ghre_CourseServices : BaseServices().Where(x => x.StaffID == DT_TableDataT1.ManagerId).FirstAsync())?.StaffName; if (DT_TableDataT1.CourseWareId != null) DT_TableDataT1.CourseWareName = (await Db.Queryable().Where(x => x.Id == DT_TableDataT1.CourseWareId).FirstAsync())?.CourseWareName; - + if (DT_TableDataT1.CreditRuleId != null) + DT_TableDataT1.CreditRuleName = (await Db.Queryable().Where(x => x.Id == DT_TableDataT1.CreditRuleId).FirstAsync())?.RuleName; return DT_TableDataT1; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CreditRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CreditRuleServices.cs index f59d7540..b148a7e2 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CreditRuleServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CreditRuleServices.cs @@ -12,4 +12,19 @@ public class Ghre_CreditRuleServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) + { + var data = await base.QueryFilterPage(filter, condition, IsEnable); + data.result.DT_TableDataT1.ForEach(x => + { + if (x.RuleType == "StudyCompletedPercent") + x.RuleType = "学习完成"; + else if (x.RuleType == "ExamPassPercent") + x.RuleType = "考试合格"; + else if (x.RuleType == "ScoreRanges") + x.RuleType = "分数段"; + }); + return data; + } } \ 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 861bd730..eed195d4 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -834,6 +834,15 @@ public class Ghre_ExamServices : BaseServices DateTime.MinValue)