From 1f8a3d3d373cacb05dc9db9be01ed62c15b1b66f Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 9 Jul 2024 16:01:38 +0800 Subject: [PATCH] ModifyAdjustScore --- Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 1273b8f0..5b1580fd 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -143,7 +143,7 @@ public class Ghre_ExamRecordServices : BaseServices paper.TotalScore) return ServiceResult.OprateFailed($"调整后得分为【{score1}】,不可大于卷面总分【{Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "")}】!"); + var paperId = entity.ExamPaperId; + var examPaper = await Db.Queryable().Where(x => x.Id == paperId).FirstAsync(); + if (examPaper != null) + entity.IsPass = examPaper.PassScore > (entity.Score + entity.AdjustScore) ? false : true; + await Update(entity); return ServiceResult.OprateSuccess("修改成功!"); @@ -329,6 +334,11 @@ public class Ghre_ExamRecordServices : BaseServices().Where(x => x.Id == paperId).FirstAsync(); + if (examPaper != null) + record.IsPass = examPaper.PassScore > (record.Score + record.AdjustScore) ? false : true; + await Db.Updateable(record).ExecuteCommandAsync(); await Db.Updateable(details).ExecuteCommandAsync();