diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_Plan.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_Plan.Dto.View.cs index 9d87b0cc..779d696d 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_Plan.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_Plan.Dto.View.cs @@ -33,6 +33,7 @@ public class Ghre_PlanDto : Ghre_Plan public string UpdateDataInfo { get; set; } public string StaffNames { get; set; } public string CourseName { get; set; } + public string DeptNo { get; set; } public string DeptName { get; set; } public string SchoolName { get; set; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs index 4682cc81..ad0e79ae 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs @@ -88,7 +88,11 @@ public class Ghre_PlanServices : BaseServices x.Id == DT_TableDataT1[i].CourseId).Select(x => x.CourseName).FirstOrDefault(); if (DT_TableDataT1[i].DeptId.IsNotEmptyOrNull()) + { DT_TableDataT1[i].DeptName = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptName).FirstOrDefault(); + DT_TableDataT1[i].DeptNo = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).Select(x => x.DeptNo).FirstOrDefault(); + + } if (DT_TableDataT1[i].SchoolId.IsNotEmptyOrNull()) DT_TableDataT1[i].SchoolName = schools.Where(x => x.Id == DT_TableDataT1[i].SchoolId).Select(x => x.SchoolName).FirstOrDefault(); @@ -585,7 +589,7 @@ public class Ghre_PlanServices : BaseServices x.CourseId == o.Id).FirstOrDefault()?.CourseName; if (x.DeptId != null) + { x.DeptName = depts.Where(o => x.DeptId == o.DeptID).FirstOrDefault()?.DeptName; + x.DeptNo = depts.Where(o => x.DeptId == o.DeptID).FirstOrDefault()?.DeptNo; + + } if (x.SponsorId != null) x.SponsorName = staffs.Where(o => x.SponsorId == o.StaffID).FirstOrDefault()?.StaffName; @@ -737,8 +741,8 @@ INSERT INTO [120.26.205.42].[GhrUshio].[dbo].Ghre_GHR50Plan (PlanID, CourseName, --课程名称 TrainDays, --培训天数 TrainStaffId, --培训对象 工号拼接 - TrainNum --培训人数 - ) + TrainNum, --培训人数 +InorOut ) SELECT A.Id, 1, A.CreateBy, @@ -757,7 +761,7 @@ INSERT INTO [120.26.205.42].[GhrUshio].[dbo].Ghre_GHR50Plan (PlanID, FROM OPENJSON(A.StaffIds) WITH (TrainStaffId INT '$') AS JsonData INNER JOIN Ghra_Staff S ON JsonData.TrainStaffId = S.StaffID FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '') AS StaffNames, - A.TrainNum + A.TrainNum,A.InorOut FROM Ghre_Plan A LEFT JOIN [120.26.205.42].[GhrUshio].[dbo].Ghre_GHR50Plan B ON B.PlanID = A.Id