考试结束时需要实时判定学习完成状态

master
xiaochanghai 2 months ago
parent 055e192c51
commit 71e1f3ba93
  1. 18
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs

@ -1226,6 +1226,10 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
_logger.LogInformation($"【DealPass:{studyRecordId}】1");
var studyRecord = await Db.Queryable<Ghre_StudyRecord>().FirstAsync(x => x.Id == record.StudyRecordId);
studyRecord.ReverseI1 = 1;
await Db.Updateable(studyRecord).UpdateColumns(it => new { it.ReverseI1 }, true)//true表示追加AOP赋值列
.ExecuteCommandAsync();
var examPaper = await Db.Queryable<Ghre_ExamPaper>().FirstAsync(x => x.Id == record.ExamPaperId);
_logger.LogInformation($"【DealPass:{studyRecordId}】PassScore:{examPaper.PassScore},Score:{record.Score},PassScore:{record.AdjustScore},");
@ -1308,6 +1312,20 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
}
}
#endregion
#region 处理学习完成状态
if (record.IsPass == true)
{
var exam = await Db.Queryable<Ghre_Exam>().Where(x => x.Id == record.ExamId && (x.StudyFinishedRule == DIC_EXAM_STUDY_FINISHED_RULE.NO_STUDY_EXAM_PASS || x.StudyFinishedRule == DIC_EXAM_STUDY_FINISHED_RULE.EXAM_PASS)).FirstAsync();
if (exam != null)
{
studyRecord.CompleteStatus = DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.FINISHED;
await Db.Updateable(studyRecord).UpdateColumns(it => new { it.CompleteStatus }, true)
.ExecuteCommandAsync();
}
}
#endregion
_logger.LogInformation($"【DealPass:{studyRecordId}】2");
}

Loading…
Cancel
Save