From 70e9bf460ec42f20ff8c67efa254985a94372e9a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 14 May 2025 16:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_ExamRecordServices.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index fa112e62..1fb2624d 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -611,10 +611,10 @@ public class Ghre_ExamRecordServices : BaseServices() .Where(x => x.Id == studyRecord.ExamId) .FirstAsync(x => x.Status == Consts.DIC_EXAM_STATUS.RELEASED || x.Status == Consts.DIC_EXAM_STATUS.DISABLED); - - if ((isOpenClass == false && exam.IsRequireStudy == true) || (isOpenClass == true && openClass.IsRequireStudy == true)) - if (studyRecord.StudyProgress.IsNull() || (!studyRecord.StudyProgress.IsNull() && studyRecord.StudyProgress < 100)) - return ServiceResult.OprateFailed("学习尚未结束暂不可考试!"); + if (exam.StudyFinishedRule != DIC_EXAM_STUDY_FINISHED_RULE.NO_STUDY_EXAM_PASS) + if ((isOpenClass == false && exam.IsRequireStudy == true) || (isOpenClass == true && openClass.IsRequireStudy == true)) + if (studyRecord.StudyProgress.IsNull() || (!studyRecord.StudyProgress.IsNull() && studyRecord.StudyProgress < 100)) + return ServiceResult.OprateFailed("学习尚未结束暂不可考试!"); if (exam.IsNull() && (record.Status == DIC_EXAM_RECORD_STATUS.WAIT || record.Status == DIC_EXAM_RECORD_STATUS.EXAMING)) return ServiceResult.OprateFailed("该门课程尚未开启考试,请联系HR !"); @@ -626,7 +626,7 @@ public class Ghre_ExamRecordServices : BaseServices().FirstAsync(x => x.Id == entity.StudyRecordId); if (exam.DateType == Consts.DicExamDateType.AFTER_HOW_LONG) { - entity.BeginTime = studyRecord?.EndTime; + entity.BeginTime = studyRecord?.EndTime ?? DateTime.Now; + if (!entity.BeginTime.IsNull()) entity.EndTime = entity.BeginTime.Value.AddDays(exam.AfterHowLong ?? 7); }