|
|
|
@ -907,9 +907,11 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
await Db.Updateable(record).UpdateColumns(it => new { it.IsPass }, true)//true表示追加AOP赋值列 |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
|
await Db.Deleteable<Ghre_CreditPoint>().Where(x => x.ExamId == studyRecord.ExamId).ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
|
if (record.IsPass == true) |
|
|
|
|
{ |
|
|
|
|
if (studyRecord.CourseSceneId.IsNull() && !await Db.Queryable<Ghre_CreditPoint>().AnyAsync(x => x.ExamId == studyRecord.ExamId)) |
|
|
|
|
if (studyRecord.CourseSceneId.IsNull()) |
|
|
|
|
{ |
|
|
|
|
var course = await Db.Queryable<Ghre_Course>().FirstAsync(x => x.Id == studyRecord.CourseId); |
|
|
|
|
#region 学分发放 |
|
|
|
@ -930,6 +932,30 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
var courses = await Db.Queryable<Ghre_Course>().Where(x => x.CourseSceneId == studyRecord.CourseSceneId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < courses.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var snap = await Db.Queryable<Ghre_CourseSnap>().FirstAsync(x => x.CourseId == courses[i].Id); |
|
|
|
|
|
|
|
|
|
#region 学分发放 |
|
|
|
|
var creditPoint = new Ghre_CreditPoint() |
|
|
|
|
{ |
|
|
|
|
CourseId = courses[i].Id, |
|
|
|
|
CourseSnapId = snap?.Id, |
|
|
|
|
StaffId = studyRecord.StaffId, |
|
|
|
|
ExamId = studyRecord.ExamId, |
|
|
|
|
Date = DateTime.Now.Date, |
|
|
|
|
CreditPoints = courses[i].CreditPoints |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
await Db.Insertable(creditPoint).ExecuteReturnSnowflakeIdListAsync(); |
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|