From da22d8d58d6fa90a27d739ed7ae3220497e3ae98 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 28 May 2025 13:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E8=AE=B0=E5=BD=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=A1=A8=E5=BE=85=E6=96=B0=E5=A2=9E=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=BB=A5=E5=8F=8A=E6=96=B0=E5=A2=9E=E5=88=97?= =?UTF-8?q?=20=E8=AF=81=E4=B9=A6=E8=A7=84=E5=88=99=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8F=91=E6=94=BE=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_CertificateController.cs | 15 +++++++++++++++ .../View/Ghre/Ghre_StudyRecord.Dto.View.cs | 1 + .../Ghre/Ghre_CertificateRuleServices.cs | 4 +--- .../Ghre/Ghre_StudyRecordServices.cs | 13 ++++++++++--- Tiobon.Core/Tiobon.Core.xml | 8 ++++++++ 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateController.cs index 1a500476..b545134c 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CertificateController.cs @@ -17,4 +17,19 @@ public class Ghre_CertificateController : BaseController + /// 根据条件查询数据 + /// + /// RuleId + /// 条件 + /// + [HttpPost, Route("QueryByRuleId/{RuleId}")] + public async Task> Query(long RuleId, [FromBody] QueryBody body) + { + return await _service.QueryFilterPage(body, $"CertificateRuleId='{RuleId}'"); + } + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs index cd242039..2e5feed1 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs @@ -173,5 +173,6 @@ public class Ghre_StudyRecordDto : Ghre_StudyRecord public List Groups { get; set; } = new List(); public long? ExamRecordId { get; set; } + public string StudyFinishedRule { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs index 03ae27ec..ac93ce0c 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CertificateRuleServices.cs @@ -1,6 +1,4 @@ -using static Tiobon.Core.Model.Consts; - -namespace Tiobon.Core.Services; +namespace Tiobon.Core.Services; /// /// 培训证书规则 (服务) diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index 4ff843db..198bfc26 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -93,8 +93,13 @@ public class Ghre_StudyRecordServices : BaseServices().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); - entitys.ForEach(entity => + + for (int i = 0; i < entitys.Count; i++) { + var entity = entitys[i]; + entity.StudyStatus = await GetParaLabel("TrainingStudyStatus", entity.StudyStatus); + entity.StudyFinishedRule = await GetParaLabel("TrainStudyFinishedRule", entity.StudyFinishedRule); + entity.CompleteStatus = entity.CompleteStatus == DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.FINISHED ? "已完成" : "未完成"; if (!string.IsNullOrWhiteSpace(entity.Indate)) entity.Indate = DateTimeHelper.ConvertToDayString(entity.Indate); entity.ExamDate = DateTimeHelper.ConvertToDayString(entity.ExamDate); @@ -119,7 +124,9 @@ public class Ghre_StudyRecordServices : BaseServices(filter.pageNum, total, filter.pageSize, entitys); @@ -998,7 +1005,7 @@ public class Ghre_StudyRecordServices : BaseServices + + + 根据条件查询数据 + + RuleId + 条件 + + Ghre_CertificateDesign(Controller)