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();