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)