牛尾培训计划优化

master
xiaochanghai 1 month ago
parent 11aa96c377
commit bd097bca78
  1. 1
      Tiobon.Core.Model/View/Ghre/Ghre_Plan.Dto.View.cs
  2. 9
      Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs
  3. 10
      Tiobon.Core.Services/Ghre/Ghre_RequestServices.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; }

@ -88,7 +88,11 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr
if (DT_TableDataT1[i].CourseId.IsNotEmptyOrNull() && DT_TableDataT1[i].CourseName.IsNullOrEmpty())
DT_TableDataT1[i].CourseName = courses.Where(x => 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<Ghre_Plan, Ghre_PlanDto, InsertGhr
});
dict.Add("Month", JsonHelper.ObjToJson(value2));
dict.Add("Month", JsonHelper.ObjToJson(value2));
}
else
{
@ -648,7 +652,8 @@ public class Ghre_PlanServices : BaseServices<Ghre_Plan, Ghre_PlanDto, InsertGhr
}
}
}else
}
else
dict.Add(x.field, null);
}
}

@ -64,7 +64,11 @@ FROM Ghre_Request A
// x.CourseName = courses.Where(o => 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

Loading…
Cancel
Save