|
|
|
@ -176,7 +176,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
.OrderBy(x => x.TaxisNo) |
|
|
|
|
.Where(x => x.ExamRecordDetailId != null && detailIds.Contains(x.ExamRecordDetailId.Value)) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
if (record.ScoreStatus == "NoScore") |
|
|
|
|
if (record.ScoreStatus == Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE) |
|
|
|
|
await ExamHelper.SystemMarkAsync(Db, record, details, recordAnswers); |
|
|
|
|
|
|
|
|
|
var exampaper = await Db.Queryable<Ghre_ExamPaper>().FirstAsync(x => x.Id == record.ExamPaperId); |
|
|
|
@ -303,7 +303,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
extend.CommentData = await Db.Ado.SqlQuerySingleAsync<CommentData>(sql); |
|
|
|
|
|
|
|
|
|
if (record.ScoreStatus == "NoScore") |
|
|
|
|
if (record.ScoreStatus == Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE) |
|
|
|
|
extend.CommentData.IsFirstTime = true; |
|
|
|
|
extend.CommentData.Comment = record.Comment; |
|
|
|
|
|
|
|
|
@ -326,7 +326,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
var record = await QuerySingle(x => x.Id == examRecordId); |
|
|
|
|
record.Score = extend.StaffInfo.StaffScore; |
|
|
|
|
record.ScoreStatus = "HasScore"; |
|
|
|
|
record.ScoreStatus = Consts.DIC_EXAM_RECORD_SCORE_STATUS.HAS_SCORE; |
|
|
|
|
record.Comment = extend.CommentData.Comment; |
|
|
|
|
var details = await Db.Queryable<Ghre_ExamRecordDetail>().Where(x => x.ExamRecordId == record.Id).ToListAsync(); |
|
|
|
|
|
|
|
|
@ -395,7 +395,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
.FirstAsync(); |
|
|
|
|
|
|
|
|
|
if (exam.IsNull()) |
|
|
|
|
return ServiceResult<QueryExam>.OprateFailed("该门课程尚未开启考试,清联系HR !"); |
|
|
|
|
return ServiceResult<QueryExam>.OprateFailed("该门课程尚未开启考试,请联系HR !"); |
|
|
|
|
|
|
|
|
|
var insrt = new InsertGhre_ExamRecordInput() |
|
|
|
|
{ |
|
|
|
@ -406,8 +406,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
ExamPaperId = exam.ExamPaperId, |
|
|
|
|
ExamDate = DateTime.Now.Date, |
|
|
|
|
RetakeTimes = 0, |
|
|
|
|
Status = "Wait", |
|
|
|
|
ScoreStatus = "NoScore", |
|
|
|
|
Status = Consts.DIC_EXAM_RECORD_STATUS.WAIT, |
|
|
|
|
ScoreStatus = Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE, |
|
|
|
|
BeginTime = exam.BeginTime, |
|
|
|
|
EndTime = exam.EndTime |
|
|
|
|
}; |
|
|
|
@ -544,7 +544,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
extend.CourseName = record.CourseName; |
|
|
|
|
extend.CanRetake = true; |
|
|
|
|
|
|
|
|
|
if (extend.ExamStatus == "ExamEnd") |
|
|
|
|
if (extend.ExamStatus == Consts.DIC_EXAM_RECORD_STATUS.EXAM_END) |
|
|
|
|
extend.ScoreOut = false; |
|
|
|
|
|
|
|
|
|
//TimeSpan timeDifference = record.EndTime.Value - DateTime.Now; |
|
|
|
@ -572,7 +572,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
return ServiceResult.OprateFailed("无效的考试ID!"); |
|
|
|
|
|
|
|
|
|
#region 试卷 引用次数 |
|
|
|
|
if (entity.Status == "Wait") |
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_RECORD_STATUS.WAIT) |
|
|
|
|
{ |
|
|
|
|
string sql = $"UPDATE Ghre_ExamPaper SET LinkTimes = ISNULL(LinkTimes, 0)+1 WHERE Id={entity.ExamPaperId}"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
@ -581,8 +581,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
if (entity.ActualBeginTime is null) |
|
|
|
|
entity.ActualBeginTime = DateTime.Now; |
|
|
|
|
if (entity.Status == "Wait") |
|
|
|
|
entity.Status = "Examing"; |
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_RECORD_STATUS.WAIT) |
|
|
|
|
entity.Status = Consts.DIC_EXAM_RECORD_STATUS.EXAM_END; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -603,8 +603,8 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
if (entity is null) |
|
|
|
|
return ServiceResult.OprateFailed("无效的考试ID!"); |
|
|
|
|
|
|
|
|
|
if (entity.Status == "ExamEnd") |
|
|
|
|
entity.Status = "Examing"; |
|
|
|
|
if (entity.Status == Consts.DIC_EXAM_RECORD_STATUS.EXAM_END) |
|
|
|
|
entity.Status = Consts.DIC_EXAM_RECORD_STATUS.EXAMING; |
|
|
|
|
|
|
|
|
|
entity.RetakeTimes = entity.RetakeTimes is null ? 1 : entity.RetakeTimes + 1; |
|
|
|
|
|
|
|
|
@ -715,11 +715,11 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
await _context.SaveChangesAsync(); |
|
|
|
|
|
|
|
|
|
record.Status = "ExamEnd"; |
|
|
|
|
record.Status = Consts.DIC_EXAM_RECORD_STATUS.EXAM_END; |
|
|
|
|
record.ActualEndTime = DateTime.Now; |
|
|
|
|
|
|
|
|
|
#region 打分 |
|
|
|
|
if (record.ScoreStatus == "NoScore" && record.Status == "ExamEnd") |
|
|
|
|
if (record.ScoreStatus == Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE && record.Status == Consts.DIC_EXAM_RECORD_STATUS.EXAM_END) |
|
|
|
|
await ExamHelper.SystemMarkAsync(Db, record, recordDetails, recordDetailAnswers); |
|
|
|
|
_context.Ghre_ExamRecordDetail.UpdateRange(recordDetails); |
|
|
|
|
_context.Ghre_ExamRecordAnswer.UpdateRange(recordDetailAnswers); |
|
|
|
|