|
|
|
@ -569,11 +569,21 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
if (entity is null) |
|
|
|
|
return ServiceResult.OprateFailed("无效的考试ID!"); |
|
|
|
|
|
|
|
|
|
#region 试卷 引用次数 |
|
|
|
|
if (entity.Status == "Wait") |
|
|
|
|
{ |
|
|
|
|
string sql = $"UPDATE Ghre_ExamPaper SET LinkTimes = ISNULL(LinkTimes, 0)+1 WHERE Id={entity.ExamPaperId}"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
if (entity.ActualBeginTime is null) |
|
|
|
|
entity.ActualBeginTime = DateTime.Now; |
|
|
|
|
if (entity.Status == "Wait") |
|
|
|
|
entity.Status = "Examing"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Update(entity, new List<string>() |
|
|
|
|
{ |
|
|
|
|
"ActualBeginTime", |
|
|
|
|