|
|
@ -16,12 +16,38 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var result = await base.QueryFilterPage(filter, condition, IsEnable); |
|
|
|
var result = await base.QueryFilterPage(filter, condition, IsEnable); |
|
|
|
|
|
|
|
var DT_TableDataT1 = result.result.DT_TableDataT1; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < result.result.DT_TableDataT1.Count; i++) |
|
|
|
var deptIds = DT_TableDataT1.Select(x => x.DeptId).Distinct().ToList(); |
|
|
|
|
|
|
|
var courseIds = DT_TableDataT1.Select(x => x.CourseId).Distinct().ToList(); |
|
|
|
|
|
|
|
var schoolIds = DT_TableDataT1.Select(x => x.SchoolId).Distinct().ToList(); |
|
|
|
|
|
|
|
var staffIds = new List<int>(); |
|
|
|
|
|
|
|
for (int i = 0; i < DT_TableDataT1.Count; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var DT_TableDataT1 = result.result.DT_TableDataT1[i]; |
|
|
|
if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) |
|
|
|
|
|
|
|
staffIds.AddRange(JsonHelper.JsonToObj<List<int>>(DT_TableDataT1[i].StaffIds)); |
|
|
|
|
|
|
|
DT_TableDataT1[i].PlanType = await GetParaLabel("TrainingCategory", DT_TableDataT1[i].PlanType); |
|
|
|
|
|
|
|
DT_TableDataT1[i].PlanType = await GetParaLabel("TrainingCategory", DT_TableDataT1[i].PlanType); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
staffIds = staffIds.Distinct().ToList(); |
|
|
|
|
|
|
|
var staffs = await Db.Queryable<Ghra_Staff>().Where(x => staffIds.Contains(x.StaffID)).ToListAsync(); |
|
|
|
|
|
|
|
var depts = await Db.Queryable<Ghro_Dept>().Where(x => deptIds.Contains(x.DeptID)).ToListAsync(); |
|
|
|
|
|
|
|
var courses = await Db.Queryable<Ghre_Course>().Where(x => courseIds.Contains(x.Id)).ToListAsync(); |
|
|
|
|
|
|
|
var schools = await Db.Queryable<Ghre_School>().Where(x => schoolIds.Contains(x.Id)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < DT_TableDataT1.Count; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var staffIds1 = JsonHelper.JsonToObj<List<int>>(DT_TableDataT1[i].StaffIds); |
|
|
|
|
|
|
|
if (staffIds1.Any()) |
|
|
|
|
|
|
|
DT_TableDataT1[i].StaffNames = string.Join("、", staffs.Where(x => staffIds1.Contains(x.StaffID)).Select(x => x.StaffName)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DT_TableDataT1.PlanType = await GetParaLabel("TrainingCategory", result.result.DT_TableDataT1[i].PlanType); |
|
|
|
DT_TableDataT1[i].CourseName = courses.Where(x => x.Id == DT_TableDataT1[i].CourseId).Select(x => x.CourseName).First(); |
|
|
|
|
|
|
|
DT_TableDataT1[i].DeptName = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptName).First(); |
|
|
|
|
|
|
|
DT_TableDataT1[i].SchoolName = courses.Where(x => x.Id == DT_TableDataT1[i].SchoolId).Select(x => x.CourseName).First(); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|