From 933e9c04064ad59893c49bcc93d024626cc055aa Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 10 Mar 2025 14:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=94=AF=E4=BA=9A=E5=A8=81?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=80=83=E8=AF=95=E9=A1=B5=E9=9D=A2=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 7a851bf8..d6bccdfd 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -895,11 +895,16 @@ public class Ghre_ExamRecordServices : BaseServices= (exampaper.RetakeTimes ?? 0)) return ServiceResult.OprateFailed($"重考次数已达上限,已重考次数【{entity.RetakeTimes ?? 0}】,允许重考次数【{exampaper.RetakeTimes ?? 0}】!"); - if (entity.Status == Consts.DIC_EXAM_RECORD_STATUS.EXAM_END) - entity.Status = Consts.DIC_EXAM_RECORD_STATUS.EXAMING; + if (entity.Status == DIC_EXAM_RECORD_STATUS.EXAM_END) + entity.Status = DIC_EXAM_RECORD_STATUS.EXAMING; entity.RetakeTimes = entity.RetakeTimes is null ? 1 : entity.RetakeTimes + 1; - entity.ScoreStatus = Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE; + entity.ScoreStatus = DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE; + + var sql = $@"UPDATE Ghre_ExamRecordDetail SET IsEnable=0 WHERE ExamRecordId='{entity.Id}'; + UPDATE Ghre_ExamRecordAnswer SET IsEnable=0 WHERE ExamRecordId='{entity.Id}';"; + + await Db.Ado.ExecuteCommandAsync(sql); await Update(entity, new List() {