|
|
@ -27,7 +27,7 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) |
|
|
|
if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) |
|
|
|
staffIds.AddRange(JsonHelper.JsonToObj<List<int>>(DT_TableDataT1[i].StaffIds)); |
|
|
|
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); |
|
|
|
DT_TableDataT1[i].PlanType = await GetParaLabel("TrainingCategory", DT_TableDataT1[i].PlanType); |
|
|
|
DT_TableDataT1[i].Month = await GetParaLabel("MonthSelect", DT_TableDataT1[i].Month); |
|
|
|
} |
|
|
|
} |
|
|
|
staffIds = staffIds.Distinct().ToList(); |
|
|
|
staffIds = staffIds.Distinct().ToList(); |
|
|
|
var staffs = await Db.Queryable<Ghra_Staff>().Where(x => staffIds.Contains(x.StaffID)).ToListAsync(); |
|
|
|
var staffs = await Db.Queryable<Ghra_Staff>().Where(x => staffIds.Contains(x.StaffID)).ToListAsync(); |
|
|
@ -45,10 +45,40 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr |
|
|
|
DT_TableDataT1[i].StaffNames = string.Join("、", staffs.Where(x => staffIds1.Contains(x.StaffID)).Select(x => x.StaffName)); |
|
|
|
DT_TableDataT1[i].StaffNames = string.Join("、", staffs.Where(x => staffIds1.Contains(x.StaffID)).Select(x => x.StaffName)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DT_TableDataT1[i].CourseName = courses.Where(x => x.Id == DT_TableDataT1[i].CourseId).Select(x => x.CourseName).First(); |
|
|
|
DT_TableDataT1[i].CourseName = courses.Where(x => x.Id == DT_TableDataT1[i].CourseId).Select(x => x.CourseName).FirstOrDefault(); |
|
|
|
DT_TableDataT1[i].DeptName = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptName).First(); |
|
|
|
DT_TableDataT1[i].DeptName = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptName).FirstOrDefault(); |
|
|
|
DT_TableDataT1[i].SchoolName = courses.Where(x => x.Id == DT_TableDataT1[i].SchoolId).Select(x => x.CourseName).First(); |
|
|
|
DT_TableDataT1[i].SchoolName = schools.Where(x => x.Id == DT_TableDataT1[i].SchoolId).Select(x => x.SchoolName).FirstOrDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override async Task<long> Add(InsertGhre_PlanInput entity) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (entity.StaffIdList != null) |
|
|
|
|
|
|
|
entity.StaffIds = JsonHelper.ObjToJson(entity.StaffIdList); |
|
|
|
|
|
|
|
var result = await base.Add(entity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override async Task<bool> Update(long Id, EditGhre_PlanInput editModel) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (editModel.StaffIdList != null) |
|
|
|
|
|
|
|
editModel.StaffIds = JsonHelper.ObjToJson(editModel.StaffIdList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = await base.Update(Id, editModel); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override async Task<ServiceFormResult<Ghre_PlanDto>> QueryForm(QueryForm body) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var result = await base.QueryForm(body); |
|
|
|
|
|
|
|
string StaffIds = result.result.DT_TableDataT1[0].StaffIds; |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(StaffIds)) |
|
|
|
|
|
|
|
result.result.DT_TableDataT1[0].StaffIdList = JsonConvert.DeserializeObject<List<int>>(StaffIds); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |