|
|
|
@ -158,7 +158,7 @@ namespace Tiobon.Core.Services |
|
|
|
|
label = "学习状态", |
|
|
|
|
field = "StudyStatus", |
|
|
|
|
elementType = "ApiSelect", |
|
|
|
|
dataSource = "TBParaDetail_Train_CourseIsOpen", |
|
|
|
|
dataSource = "TBParaDetail_Train_TrainingStudyStatus", |
|
|
|
|
editable = true, |
|
|
|
|
required = false, |
|
|
|
|
multipleSelect = false, |
|
|
|
@ -372,7 +372,9 @@ namespace Tiobon.Core.Services |
|
|
|
|
B.StandardHour, |
|
|
|
|
B.CreditPoints, |
|
|
|
|
B.Outline CourseRemarkSz, |
|
|
|
|
A.StudyProgress |
|
|
|
|
A.StudyProgress, |
|
|
|
|
A.CourseBeginTime, |
|
|
|
|
A.CourseEndTime |
|
|
|
|
FROM Ghre_StudyRecord A |
|
|
|
|
LEFT JOIN Ghre_Course B ON A.CourseId = B.Id |
|
|
|
|
LEFT JOIN Ghra_Staff c ON B.TeacherId = c.StaffID |
|
|
|
@ -471,6 +473,9 @@ namespace Tiobon.Core.Services |
|
|
|
|
course.CourseWareList[j].Attachments = await Db.Queryable<Ghre_CourseWareAttachment>().Where(x => x.CourseWareId == course.CourseWareList[j].Id).ToListAsync(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (course.CourseBeginTime != null && course.CourseEndTime != null) |
|
|
|
|
course.CourseDateString = DateTimeHelper.ConvertToDayString(course.CourseBeginTime) + "~" + DateTimeHelper.ConvertToDayString(course.CourseEndTime); |
|
|
|
|
|
|
|
|
|
return ServiceResult<Ghre_StudyRecordCourse>.OprateSuccess("查询成功!", course); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -544,10 +549,17 @@ namespace Tiobon.Core.Services |
|
|
|
|
var studyStatus = DicStudyRecordStudyStatus.NO_FINISH; |
|
|
|
|
if (studyProgress == 100) |
|
|
|
|
studyStatus = DicStudyRecordStudyStatus.HAS_FINISH; |
|
|
|
|
sql = $"UPDATE Ghre_StudyRecord SET StudyProgress = ISNULL(StudyProgress, 0)+{studyProgress},StudyStatus='{studyStatus}' WHERE Id='{studyRecordId}'"; |
|
|
|
|
|
|
|
|
|
sql = $"UPDATE Ghre_StudyRecord SET StudyProgress = {studyProgress},StudyStatus='{studyStatus}' WHERE Id='{studyRecordId}'"; |
|
|
|
|
if (studyProgress > 0) await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
sql = $"UPDATE Ghre_StudyRecord SET BeginTime=GETDATE(),StudyStatus='{studyStatus}' WHERE BeginTime IS NULL AND Id='{studyRecordId}'"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
|
|
|
|
|
if (studyProgress == 100) |
|
|
|
|
{ |
|
|
|
|
sql = $"UPDATE Ghre_StudyRecord SET EndTime=GETDATE() WHERE EndTime IS NULL AND Id='{studyRecordId}'"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|