diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index 6f439f73..ecf99371 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -11606,8 +11606,8 @@ LABL 0 Arial Unicode MS,8,N 1741165477 -1741165480 -((46253,-5550), (52147,-1650)) +1741227864 +((29678,-4275), (35572,-375)) 0 16711680 16744448 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_UshioPlan.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_UshioPlan.Dto.Base.cs index 4805d85f..9a96fe73 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_UshioPlan.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_UshioPlan.Dto.Base.cs @@ -190,5 +190,6 @@ public class Ghre_UshioPlanBase /// public int? ReverseI2 { get; set; } - public List StaffId { get; set; } + public List StaffId { get; set; } = new List(); + public List Months { get; set; } = new List(); } diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_UshioPlan.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_UshioPlan.Dto.View.cs index 21e7bc6d..184572bd 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_UshioPlan.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_UshioPlan.Dto.View.cs @@ -36,5 +36,20 @@ public class Ghre_UshioPlanDto : Ghre_UshioPlan public string DeptName { get; set; } public string SchoolName { get; set; } - public List StaffId { get; set; } + public List StaffId { get; set; } = new List(); + public List Months { get; set; } = new List(); + + public decimal? TotalDays { get; set; } = 0; + public string M1 { get; set; } + public string M2 { get; set; } + public string M3 { get; set; } + public string M4 { get; set; } + public string M5 { get; set; } + public string M6 { get; set; } + public string M7 { get; set; } + public string M8 { get; set; } + public string M9 { get; set; } + public string M10 { get; set; } + public string M11 { get; set; } + public string M12 { get; set; } } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 7153ab02..63a90db7 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -2146,7 +2146,7 @@ public partial class CommonServices : BaseServices>, ICommon reorderedNumbers = new(); sort = result.JM_TableColumnT1.TableColumn.Where(x => x.field == "M1").SingleOrDefault()?.SortNo ?? 5; - name1 = await QueryLangValue("F_ResumeMaintenance_0216", "预算编制数"); + name1 = "计划年月"; result.JM_TableColumnT1.TableColumn?.ForEach(x => { if (months.Where(o => o == x.label).Any()) diff --git a/Tiobon.Core.Services/Ghre/Ghre_UshioPlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_UshioPlanServices.cs index 27921935..0a68f4ce 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_UshioPlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_UshioPlanServices.cs @@ -41,23 +41,27 @@ public class Ghre_UshioPlanServices : BaseServices x.DeptId).Distinct().ToList(); - var courseIds = DT_TableDataT1.Select(x => x.CourseId).Distinct().ToList(); + //var courseIds = DT_TableDataT1.Select(x => x.CourseId).Distinct().ToList(); var staffIds = new List(); for (int i = 0; i < DT_TableDataT1.Count; i++) { if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) staffIds.AddRange(JsonHelper.JsonToObj>(DT_TableDataT1[i].StaffIds)); + + if (DT_TableDataT1[i].Month.IsNotEmptyOrNull()) + DT_TableDataT1[i].Months = JsonHelper.JsonToObj>(DT_TableDataT1[i].Month); DT_TableDataT1[i].TrainCategory = await GetParaLabel("TrainingCategory", DT_TableDataT1[i].TrainCategory); DT_TableDataT1[i].Month = await GetParaLabel("MonthSelect", DT_TableDataT1[i].Month); } staffIds = staffIds.Distinct().ToList(); var staffs = await Db.Queryable().Where(x => staffIds.Contains(x.StaffID)).ToListAsync(); var depts = await Db.Queryable().Where(x => deptIds.Contains(x.DeptID)).ToListAsync(); - var courses = await Db.Queryable().Where(x => courseIds.Contains(x.Id)).ToListAsync(); + //var courses = await Db.Queryable().Where(x => courseIds.Contains(x.Id)).ToListAsync(); for (int i = 0; i < DT_TableDataT1.Count; i++) { + DT_TableDataT1[i].InOrOut = await GetParaLabel("CourseInOrOut", DT_TableDataT1[i].InOrOut); if (DT_TableDataT1[i].StaffIds.IsNotEmptyOrNull()) { var staffIds1 = JsonHelper.JsonToObj>(DT_TableDataT1[i].StaffIds); @@ -65,8 +69,34 @@ public class Ghre_UshioPlanServices : BaseServices 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).FirstOrDefault(); - DT_TableDataT1[i].DeptName = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptName).FirstOrDefault(); + //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).FirstOrDefault(); + + + if (DT_TableDataT1[i].TrainNum != null && DT_TableDataT1[i].TrainDays != null) + DT_TableDataT1[i].TotalDays = DT_TableDataT1[i].TrainNum * DT_TableDataT1[i].TrainDays; + + if (DT_TableDataT1[i].Months.Any()) + { + DT_TableDataT1[i].Months.ForEach(x => + { + //if (x.ObjToInt() == 1) DT_TableDataT1[i] = "✔√"; + if (x.ObjToInt() == 1) DT_TableDataT1[i].M1 = "✔"; + else if (x.ObjToInt() == 2) DT_TableDataT1[i].M2 = "✔"; + else if (x.ObjToInt() == 3) DT_TableDataT1[i].M3 = "✔"; + else if (x.ObjToInt() == 4) DT_TableDataT1[i].M4 = "✔"; + else if (x.ObjToInt() == 5) DT_TableDataT1[i].M5 = "✔"; + else if (x.ObjToInt() == 6) DT_TableDataT1[i].M6 = "✔"; + else if (x.ObjToInt() == 7) DT_TableDataT1[i].M7 = "✔"; + else if (x.ObjToInt() == 8) DT_TableDataT1[i].M8 = "✔"; + else if (x.ObjToInt() == 9) DT_TableDataT1[i].M9 = "✔"; + else if (x.ObjToInt() == 10) DT_TableDataT1[i].M10 = "✔"; + else if (x.ObjToInt() == 11) DT_TableDataT1[i].M11 = "✔"; + else if (x.ObjToInt() == 12) DT_TableDataT1[i].M12 = "✔"; + + + }); + } } @@ -102,6 +132,10 @@ public class Ghre_UshioPlanServices : BaseServices>(StaffIds); + + if (!string.IsNullOrWhiteSpace(Month)) + result.result.DT_TableDataT1[0].Months = JsonConvert.DeserializeObject>(Month); + if (result.result.DT_TableDataT1[0].TrainNum != null && result.result.DT_TableDataT1[0].TrainDays != null) + result.result.DT_TableDataT1[0].TotalDays = result.result.DT_TableDataT1[0].TrainNum * result.result.DT_TableDataT1[0].TrainDays; return result; } public async Task> InsertByStatus(InsertGhre_UshioPlanInput insertModel, string status) @@ -156,7 +199,7 @@ public class Ghre_UshioPlanServices : BaseServices