From 82ba59b077b05dfabf97938b33c53a5c621466be Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 5 Sep 2024 17:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=85=E9=80=89=E4=BF=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=A1=A8=20=E5=9C=BA=E6=99=AF=E6=97=B6=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Ghre/Ghre_CourseScene.cs | 27 ++++++++++ .../View/Ghre/Ghre_RequiredCourse.Dto.View.cs | 2 + .../Ghre/Ghre_RequiredCourseServices.cs | 9 ++++ .../Ghre/Ghre_StudyRecordServices.cs | 23 ++++++++- Tiobon.Core/Tiobon.Core.Model.xml | 50 +++++++++++++++++++ 5 files changed, 109 insertions(+), 2 deletions(-) diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs index c006fa15..e7c418ce 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs @@ -63,6 +63,33 @@ namespace Tiobon.Core.Model.Models /// public int? SortNo { get; set; } + /// + /// 标准课时 + /// + public int? StandardHour { get; set; } + + /// + /// 学分 + /// + public int? CreditPoints { get; set; } + + /// + /// 封面图 + /// + [Display(Name = "CoverUrl"), Description("封面图"), MaxLength(2000, ErrorMessage = "封面图 不能超过 2000 个字符")] + public string CoverUrl { get; set; } + + /// + /// 是否使用默认封面 + /// + public bool? UseDefaultCoverImage { get; set; } + + /// + /// 默认封面图Name + /// + [Display(Name = "DefaultCoverImageName"), Description("默认封面图Name"), MaxLength(32, ErrorMessage = "默认封面图Name 不能超过 32 个字符")] + public string DefaultCoverImageName { get; set; } + /// /// 默认标志 /// diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_RequiredCourse.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_RequiredCourse.Dto.View.cs index ae5c007d..5413d962 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_RequiredCourse.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_RequiredCourse.Dto.View.cs @@ -50,7 +50,9 @@ public class Ghre_RequiredCourseDto : Ghre_RequiredCourse public string InStatusLabel { get; set; } public string DueDate1 { get; set; } + public string Indate1 { get; set; } + public long? CourseSceneId { get; set; } public string ExamDate1 { get; set; diff --git a/Tiobon.Core.Services/Ghre/Ghre_RequiredCourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_RequiredCourseServices.cs index e0f811b5..ce8c2945 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_RequiredCourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_RequiredCourseServices.cs @@ -73,6 +73,9 @@ public class Ghre_RequiredCourseServices : BaseServices" + (filter.pageNum - 1) * filter.pageSize; var entitys = await Db.Ado.SqlQueryAsync(sql); + var courseSceneIds = entitys.Select(x => x.CourseSceneId).Distinct().ToList(); + + var courses = await Db.Queryable().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); entitys.ForEach(async x => { @@ -85,6 +88,12 @@ public class Ghre_RequiredCourseServices : BaseServices x.CourseSceneId == x.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); + } + #endregion }); return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index 100accd0..482353e0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -19,7 +19,6 @@ using NPOI.SS.Util; using NPOI.XSSF.UserModel; using Microsoft.AspNetCore.Http; using System.Data; -using Org.BouncyCastle.Crypto; namespace Tiobon.Core.Services; @@ -101,6 +100,10 @@ public class Ghre_StudyRecordServices : BaseServices(sql); + var courseSceneIds = entitys.Select(x => x.CourseSceneId).Distinct().ToList(); + + var courses = await Db.Queryable().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); + entitys.ForEach(entity => { if (!string.IsNullOrWhiteSpace(entity.Indate)) @@ -118,6 +121,13 @@ public class Ghre_StudyRecordServices : BaseServices x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); + } + #endregion + }); return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); @@ -181,6 +191,10 @@ public class Ghre_StudyRecordServices : BaseServices(sql); + var courseSceneIds = entitys.Select(x => x.CourseSceneId).Distinct().ToList(); + + var courses = await Db.Queryable().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); + entitys.ForEach(entity => { if (!string.IsNullOrWhiteSpace(entity.Indate)) @@ -197,7 +211,12 @@ public class Ghre_StudyRecordServices : BaseServices x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); + } + #endregion }); return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 1709f1fd..1608985d 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -1955,6 +1955,31 @@ 排序 + + + 标准课时 + + + + + 学分 + + + + + 封面图 + + + + + 是否使用默认封面 + + + + + 默认封面图Name + + 默认标志 @@ -8666,6 +8691,31 @@ 排序 + + + 标准课时 + + + + + 学分 + + + + + 封面图 + + + + + 是否使用默认封面 + + + + + 默认封面图Name + + 默认标志