优化 考试耗费时长逻辑

master
xiaochanghai 11 months ago
parent 0a226fda91
commit e1ef3dd2ba
  1. 9
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs

@ -605,6 +605,14 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
if (!exampaper.AnswerTime.IsNull())
extend.RemainingSecond = exampaper.AnswerTime.Value * 60;
#region 更新实际开始时间
if (extend.ExamStatus != Consts.DIC_EXAM_RECORD_STATUS.EXAM_END)
{
string sql = $"UPDATE Ghre_ExamRecord SET ActualBeginTime = GETDATE() WHERE Id={examRecordId}";
await Db.Ado.ExecuteCommandAsync(sql);
}
#endregion
if (!record.ActualEndTime.IsNull())
{
TimeSpan timeDifference = record.ActualEndTime.Value - record.ActualBeginTime.Value;
@ -612,6 +620,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
extend.UsageTime = $"{timeDifference.Minutes}分{timeDifference.Seconds}秒";
}
return ServiceResult<QueryExam>.OprateSuccess("查询成功!", extend);
}

Loading…
Cancel
Save