From 0d3bee9a26ac2c552779e904ae6700ea23f3dd31 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 4 Mar 2025 10:46:32 +0800 Subject: [PATCH] =?UTF-8?q?ESS=E5=BC=80=E7=8F=AD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=8D=E5=AD=A6=E4=B9=A0=E7=9B=B4=E6=8E=A5=E8=80=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Ghre/Ghre_OpenClass.cs | 2 +- .../View/Ghre/Ghre_StaffGroup.Dto.View.cs | 3 + .../Ghre/Ghre_OpenClassServices.cs | 5 +- .../Ghre/Ghre_StudyRecordServices.cs | 101 +++++------------- 4 files changed, 35 insertions(+), 76 deletions(-) diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_OpenClass.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_OpenClass.cs index e910b3f8..bc4d12c9 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_OpenClass.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_OpenClass.cs @@ -178,7 +178,7 @@ public class Ghre_OpenClass : BasePoco /// /// 是否需要学习 /// - public int? IsRequireStudy { get; set; } + public bool? IsRequireStudy { get; set; } /// /// 发布状态 diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_StaffGroup.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_StaffGroup.Dto.View.cs index 6c80fa40..c37401ac 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_StaffGroup.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_StaffGroup.Dto.View.cs @@ -101,4 +101,7 @@ public class Ghre_StaffGroupDto : Ghre_StaffGroup /// 不包含员工 /// public List ExclStaffIds { get; set; } = new List(); + + public int MasterId { get; set; } + public string DataType { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs index 8b6717cb..6e993910 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs @@ -272,7 +272,7 @@ public class Ghre_OpenClassServices : BaseServices.OprateSuccess("导出成功", result); + return ServiceResult.OprateSuccess("导出成功", result); } #endregion @@ -374,7 +374,8 @@ public class Ghre_OpenClassServices : BaseServices().Where(x => x.OpenClassId != null && ids.Contains(x.OpenClassId.Value) && x.StaffId == staffId).ToListAsync(); - var dt = DateTime.Now.Date; + var dt = DateTime.Now; entitys.ForEach(x => { @@ -1311,11 +1251,25 @@ WHERE A.Status !='Temporary' AND EXISTS ( x.ShowExamBtn = false; x.ShowRegisterBtn = false; - if (dt >= x.RegisterStartTime && dt <= x.RegisterEndTime && x.OpenClassStatus == "Publish" && !openClassStaffs.Any(o => o.OpenClassId == x.Id)) + x.DisableExamBtn = true; + x.DisableStudyBtn = true; + + + if (x.OpenClassStatus == "Publish" && !openClassStaffs.Any(o => o.OpenClassId == x.Id)) + { x.ShowRegisterBtn = true; + x.DisableRegisterBtn = true; + if (dt >= x.RegisterStartTime && dt <= x.RegisterEndTime) + x.DisableRegisterBtn = false; - if (dt >= x.CourseBeginDate && dt <= x.CourseEndDate && (x.OpenClassStatus == "Publish" || x.OpenClassStatus == "Opening") && openClassStaffs.Any(o => o.OpenClassId == x.Id)) + }else if (openClassStaffs.Any(o => o.OpenClassId == x.Id)) + { x.ShowStudyBtn = true; + x.ShowExamBtn = true; + } + + if (dt >= x.CourseBeginDate && dt <= x.CourseEndDate && (x.OpenClassStatus == "Publish" || x.OpenClassStatus == "Opening") && openClassStaffs.Any(o => o.OpenClassId == x.Id)) + x.DisableStudyBtn = false; if (x.CourseBeginDate != null && x.CourseEndDate != null) x.CourseDateString = DateTimeHelper.ConvertToDayString(x.CourseBeginDate) + "~" + DateTimeHelper.ConvertToDayString(x.CourseEndDate); @@ -1330,8 +1284,9 @@ WHERE A.Status !='Temporary' AND EXISTS ( //if (x.CourseBeginDate != null && x.CourseEndDate != null) // if (x.StudyProgress >= 100 || !(x.CourseBeginDate.Value.Date <= DateTime.Now.Date && x.CourseEndDate.Value.Date >= DateTime.Now.Date)) // x.DisableStudyBtn = true; - if (!x.ExamId.IsNull()) - x.ShowExamBtn = true; + if (!x.ExamId.IsNull() && x.ExamBeginDate != null && x.ExamEndDate != null && x.ExamBeginDate <= dt && x.ExamEndDate >= dt) + x.DisableExamBtn = false; + if (x.StudyProgress < 100 || x.ExamId.IsNull()) x.DisableExamBtn = true; if (x.FeedbackOrderId.IsNull())