小程序培训记录接口
This commit is contained in:
@@ -98,6 +98,54 @@ namespace BLL
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据ProjectId、PersonId获取培训任务列表
|
||||
|
||||
/// <summary>
|
||||
/// 根据ProjectId、PersonId获取培训任务列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personId"></param>
|
||||
/// <param name="isRetakeCourse"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.TrainingRecordItemItem> getTrainingRecordItemListByProjectIdPersonId(string projectId, string personId, string isRetakeCourse)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TaskItem
|
||||
join t in db.Training_Task on x.TaskId equals t.TaskId
|
||||
join p in db.Training_Plan on x.PlanId equals p.PlanId
|
||||
join y in db.Training_CompanyTrainingItem on x.TrainingItemCode equals y.CompanyTrainingItemCode into temp
|
||||
//join z in db.Training_CompanyTraining on y.CompanyTrainingId equals z.CompanyTrainingId into temp
|
||||
from y in temp.DefaultIfEmpty()
|
||||
where t.ProjectId == projectId && t.UserId == personId
|
||||
orderby x.TrainingItemCode
|
||||
select new Model.TrainingRecordItemItem
|
||||
{
|
||||
TaskItemId = x.TaskItemId,
|
||||
TaskId = x.TaskId,
|
||||
PlanId = x.PlanId,
|
||||
StartTime = x.StartTime,
|
||||
EndTime = x.EndTime,
|
||||
LearningTime = x.LearnTime,
|
||||
AttachTime = y.LearningTime,
|
||||
VideoProgress = x.VideoProgress,
|
||||
PersonId = x.PersonId,
|
||||
TrainingItemCode = x.TrainingItemCode,
|
||||
TrainingItemName = x.TrainingItemName,
|
||||
AttachUrl = x.AttachUrl.Replace('\\', '/'),
|
||||
IsRetakeCourse = p.IsRetakeCourse == 1 ? 1 : 0,
|
||||
}).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(isRetakeCourse))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.IsRetakeCourse == int.Parse(isRetakeCourse)).ToList();
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据PlanId、PersonId将人员加入培训任务条件
|
||||
|
||||
Reference in New Issue
Block a user