|
|
|
@ -807,17 +807,63 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
for (DateTime? dt = startTime; dt <= endTime; dt = dt.Value.AddMonths(1)) |
|
|
|
|
{ |
|
|
|
|
string formatted = dt.Value.ToString("yyyy-MM"); |
|
|
|
|
int submitCount = 0; |
|
|
|
|
var courseCount = await Db.Queryable<Ghre_Plan>() |
|
|
|
|
.Where(x => x.Year == dt.Value.Year && x.DeptId == deptId && x.Month.Contains($"\"{dt.Value.Month}\"")) |
|
|
|
|
.CountAsync(); |
|
|
|
|
|
|
|
|
|
if (courseCount > 0) |
|
|
|
|
{ |
|
|
|
|
var planIds = await Db.Queryable<Ghre_Plan>() |
|
|
|
|
.Where(x => x.Year == dt.Value.Year && x.DeptId == deptId && x.Month.Contains($"\"{dt.Value.Month}\"")) |
|
|
|
|
.Select(x => x.Id).ToListAsync(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planIds.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var submitCount1 = await Db.Queryable<Ghre_TrainFeeApplyOrder_Boltone>() |
|
|
|
|
.Where(x => x.PlanId != null && x.PlanId.Contains(planIds[i].ObjToString())).CountAsync(); |
|
|
|
|
submitCount = submitCount + submitCount1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
data.Add(new CompletionRateBLT |
|
|
|
|
{ |
|
|
|
|
Month = formatted |
|
|
|
|
Month = formatted, |
|
|
|
|
SubmitCount = submitCount, |
|
|
|
|
CourseCount = courseCount |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
int submitCount = 0; |
|
|
|
|
var courseCount = 0; |
|
|
|
|
for (DateTime? dt = startTime; dt <= endTime; dt = dt.Value.AddMonths(1)) |
|
|
|
|
{ |
|
|
|
|
string formatted = dt.Value.ToString("yyyy-MM"); |
|
|
|
|
var courseCount1 = await Db.Queryable<Ghre_Plan>() |
|
|
|
|
.Where(x => x.Year == dt.Value.Year && x.DeptId == deptId && x.Month.Contains($"\"{dt.Value.Month}\"")) |
|
|
|
|
.CountAsync(); |
|
|
|
|
courseCount = courseCount + courseCount1; |
|
|
|
|
|
|
|
|
|
if (courseCount > 0) |
|
|
|
|
{ |
|
|
|
|
var planIds = await Db.Queryable<Ghre_Plan>() |
|
|
|
|
.Where(x => x.Year == dt.Value.Year && x.DeptId == deptId && x.Month.Contains($"\"{dt.Value.Month}\"")) |
|
|
|
|
.Select(x => x.Id).ToListAsync(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < planIds.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var submitCount1 = await Db.Queryable<Ghre_TrainFeeApplyOrder_Boltone>() |
|
|
|
|
.Where(x => x.PlanId != null && x.PlanId.Contains(planIds[i].ObjToString())).CountAsync(); |
|
|
|
|
submitCount = submitCount + submitCount1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
data.Add(new CompletionRateBLT |
|
|
|
|
{ |
|
|
|
|
Month = $"{startTime.Value.ToString("yyyy-MM")}~{endTime.Value.ToString("yyyy-MM")}" |
|
|
|
|
Month = $"{startTime.Value.ToString("yyyy-MM")}~{endTime.Value.ToString("yyyy-MM")}", |
|
|
|
|
SubmitCount = submitCount, |
|
|
|
|
CourseCount = courseCount |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -830,6 +876,10 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
|
data[i].RowNo = i + 1; |
|
|
|
|
data[i].DeptName = deptName; |
|
|
|
|
data[i].DeptFullName = deptName1; |
|
|
|
|
if (data[i].CourseCount > 0 && data[i].SubmitCount > 0) |
|
|
|
|
data[i].CompletionRate = data[i].SubmitCount / data[i].CourseCount; |
|
|
|
|
|
|
|
|
|
data[i].CompletionRate1 = $"{data[i].CompletionRate}%"; |
|
|
|
|
//var examCount = await Db.Queryable<Ghre_ExamRecord>() |
|
|
|
|
// .Where(x => x.StudyRecordId != null && studyRecordIds.Contains(x.StudyRecordId.Value)) |
|
|
|
|
// .CountAsync(); |
|
|
|
|