|
|
|
@ -1811,18 +1811,7 @@ WHERE A.Id = '{id}'"; |
|
|
|
|
if (studyProgress == 100) |
|
|
|
|
{ |
|
|
|
|
studyStatus = DIC_STUDY_RECORD_STUDY_STATUS.HAS_FINISH; |
|
|
|
|
if (completeStatus == DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.NO_FINISH) |
|
|
|
|
|
|
|
|
|
if (record.ExamId.IsNullOrEmpty()) |
|
|
|
|
{ |
|
|
|
|
if (record.CourseSceneId.IsNotEmptyOrNull() || (record.CourseId != null && await Db.Queryable<Ghre_Course>().AnyAsync(x => x.Id == record.CourseId && x.ExamPaperId == null))) |
|
|
|
|
completeStatus = DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.FINISHED; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (await Db.Queryable<Ghre_Exam>().AnyAsync(x => x.Id == record.ExamId && x.StudyFinishedRule == DIC_EXAM_STUDY_FINISHED_RULE.STUDY_FINISHED)) |
|
|
|
|
completeStatus = DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.FINISHED; |
|
|
|
|
} |
|
|
|
|
await ExamHelper.MarkCompleteStatusAsync(Db, record); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var studyProgress1 = studyProgress.ObjToInt(); |
|
|
|
@ -1833,7 +1822,6 @@ WHERE A.Id = '{id}'"; |
|
|
|
|
StudyProgress = studyProgress1, |
|
|
|
|
StudyStatus = studyStatus, |
|
|
|
|
StandardDuration = mins, |
|
|
|
|
CompleteStatus = completeStatus, |
|
|
|
|
ReverseI1 = 1 |
|
|
|
|
}) |
|
|
|
|
.Where(it => it.Id == studyRecordId) |
|
|
|
@ -2078,8 +2066,6 @@ ORDER BY {filter.orderBy}"; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 发放学分 |
|
|
|
|
/// <summary> |
|
|
|
|
/// 发放学分 |
|
|
|
@ -2192,4 +2178,30 @@ ORDER BY {filter.orderBy}"; |
|
|
|
|
return ServiceResult.OprateSuccess("发放成功!"); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 自动刷新完成状态 |
|
|
|
|
/// <summary> |
|
|
|
|
/// 自动刷新完成状态 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<ServiceResult> MarkCompleteStatus() |
|
|
|
|
{ |
|
|
|
|
var now = DateTime.Now; |
|
|
|
|
//抓取当天提交考试的数据 |
|
|
|
|
var records = await Db.Queryable<Ghre_StudyRecord>() |
|
|
|
|
.Where(x => x.ReverseI1 == 1) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
_logger.LogInformation($"【自动刷新完成状态】查询到{records.Count}条考试数据"); |
|
|
|
|
if (!records.Any()) |
|
|
|
|
return ServiceResult.OprateSuccess("自动刷新完成状态!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < records.Count; i++) |
|
|
|
|
{ |
|
|
|
|
await ExamHelper.MarkCompleteStatusAsync(Db, records[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess("自动刷新完成状态!"); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
} |