|
|
|
@ -639,4 +639,24 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr |
|
|
|
|
return ServiceResult.OprateSuccess("可以取消发布!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> StartExam(long id) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (!await _ghre_ExamRecordServices.AnyAsync(x => x.ExamId == id)) |
|
|
|
|
{ |
|
|
|
|
var exam = await base.QueryById(id); |
|
|
|
|
var insrt = new InsertGhre_ExamRecordInput() |
|
|
|
|
{ |
|
|
|
|
ExamId = id, |
|
|
|
|
UserId = UserContext.Current.User_Id, |
|
|
|
|
ActualBeginTime = DateTime.Now, |
|
|
|
|
ExamPaperId = exam.ExamPaperId |
|
|
|
|
}; |
|
|
|
|
await _ghre_ExamRecordServices.Add(insrt); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess("操作成功!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |