This commit is contained in:
2024-05-24 09:36:11 +08:00
parent 4fb7817f31
commit f6fab4e448
3 changed files with 47 additions and 7 deletions
+26 -7
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace BLL
{
@@ -36,6 +37,7 @@ namespace BLL
TrainTypeName = db.Base_TrainType.FirstOrDefault(b => b.TrainTypeId == y.TrainTypeId).TrainTypeName,
TrainLevelName = db.Base_TrainLevel.FirstOrDefault(b => b.TrainLevelId == y.TrainLevelId).TrainLevelName,
PlanStatesName = y.States == "3" ? "已完成" : "培训中",
TrainingItemCode = getTrainingItemCode(y.PlanId)
}).ToList();
foreach(var item in getDataLists)
@@ -55,6 +57,18 @@ namespace BLL
return getDataLists;
}
}
public static string getTrainingItemCode(string PlanId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var ids = db.Training_PlanItem.Where(xx => xx.PlanId == PlanId).Select(x => x.CompanyTrainingItemId).ToList();
var codes= db.Training_CompanyTrainingItem.Where(x => ids.Contains(x.CompanyTrainingItemId)).Select(x => x.CompanyTrainingItemCode);
string res = string.Join(",", codes);
return res;
}
return "";
}
#endregion
#region TaskId获取培训任务教材明细列表
@@ -280,15 +294,20 @@ namespace BLL
//}
if (!string.IsNullOrEmpty(VideoProgress))
{
if (!item.VideoProgress.HasValue)
{
item.VideoProgress = 0;
}
item.VideoProgress = item.VideoProgress.Value + int.Parse(VideoProgress);
//if (!item.VideoProgress.HasValue)
//{
// item.VideoProgress = 0;
//}
item.VideoProgress = int.Parse(VideoProgress);
}
var span = endTime.Subtract(startTime);
//item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes;
item.EndTime = endTime;
if (!item.LearnTime.HasValue)
{
item.LearnTime = 0;
}
item.LearnTime = item.LearnTime.Value + (int)span.TotalMinutes;
item.EndTime = endTime;
db.SubmitChanges();