From cf101f748fb3a303c6b8aee64034298cc48e845a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 18 Apr 2025 10:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E6=8A=80=E8=83=BD=5F?= =?UTF-8?q?=E5=AE=9D=E8=BF=9E=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Tiobon.Web.pdm | 12 +-- Tiobon.Core.Api/Tiobon.Core.Model.xml | 10 +++ .../View/Ghra/Ghra_Staff.Dto.View.cs | 3 + .../Ghre/Ghre_TitleSkill_Boltone.Dto.View.cs | 17 ++++ .../Ghra/Ghra_StaffServices.cs | 4 +- .../Ghre/Ghre_PlanServices.cs | 2 - .../Ghre/Ghre_TitleSkill_BoltoneServices.cs | 89 +++++++++++++++++++ Tiobon.Core/Tiobon.Core.Model.xml | 10 +++ 8 files changed, 138 insertions(+), 9 deletions(-) diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index 5653640e..4f44865a 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -9743,7 +9743,7 @@ DESTINATION 0 新宋体,8,N 1717726229 1719381754 -((-42337,11400), (-39337,18375)) +((-42449,11400), (-39225,18375)) ((-40837,11400),(-40837,18375)) 2 1 @@ -9966,7 +9966,7 @@ DESTINATION 0 新宋体,8,N 1727337857 1727337857 -((-54786,11250), (-48786,18150)) +((-54898,11250), (-48674,18150)) ((-51786,18150),(-51786,11250)) 2 1 @@ -10010,7 +10010,7 @@ DESTINATION 0 新宋体,8,N 1738913762 1738913762 -((-43349,-30975), (-38849,-24075)) +((-43461,-30975), (-38737,-24075)) ((-41099,-30975),(-41099,-24075)) 2 1 @@ -10055,7 +10055,7 @@ DESTINATION 0 新宋体,8,N 1738915648 1738915648 -((-43011,-23625), (-38511,-17925)) +((-43123,-23625), (-38399,-17925)) ((-40761,-17925),(-40761,-23625)) 2 1 @@ -10077,7 +10077,7 @@ DESTINATION 0 新宋体,8,N 1738916095 1738916119 -((-53924,-23812), (-39449,-17325)) +((-54036,-23812), (-39449,-17325)) ((-51674,-17325),(-51674,-23400),(-39449,-23400)) 2 1 @@ -10099,7 +10099,7 @@ DESTINATION 0 新宋体,8,N 1738916098 1738916104 -((-53999,-31050), (-42899,-24863)) +((-54111,-31050), (-42899,-24863)) ((-51749,-31050),(-51749,-25275),(-42899,-25275)) 2 1 diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index a69a4161..9c9df59e 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -36418,6 +36418,16 @@ 修改信息 + + + 生效日期 + + + + + 失效日期 + + 【牛尾】培训计划(Dto.View1) diff --git a/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs b/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs index 4409a14c..088e39ed 100644 --- a/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs @@ -78,4 +78,7 @@ public class Ghra_StaffDto : Ghra_Staff /// 职务 /// public string JobName { get; set; } + + public int? TitleId { get; set; } + public int? DeptId { get; set; } } diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_TitleSkill_Boltone.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_TitleSkill_Boltone.Dto.View.cs index 5711f2bb..1639ddc8 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_TitleSkill_Boltone.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_TitleSkill_Boltone.Dto.View.cs @@ -31,4 +31,21 @@ public class Ghre_TitleSkill_BoltoneDto : Ghre_TitleSkill_Boltone /// 修改信息 /// public string UpdateDataInfo { get; set; } + + public string CourseName { get; set; } + public string DeptName { get; set; } + public string TitleName { get; set; } + + /// + /// 生效日期 + /// + public string EffectiveDate1 { get; set; } + + /// + /// 失效日期 + /// + public string ExpiryDate1 { get; set; } + + + public string ParentDeptName { get; set; } } diff --git a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs index 49a4ab95..a5d74b50 100644 --- a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs +++ b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs @@ -18,7 +18,7 @@ public class Ghra_StaffServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) - { + { var result = await base.QueryFilterPage(filter, condition, IsEnable); for (int i = 0; i < result.result.DT_TableDataT1.Count; i++) @@ -37,6 +37,8 @@ public class Ghra_StaffServices : BaseServices($"SELECT * FROM Ghra_StaffLicence WHERE StaffID='{id}' AND IsEnable=1"); //var licences = await _ghra_StaffLicenceServices.QueryDto(x => x.StaffID == id); diff --git a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs index 0250c1ab..6d507026 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs @@ -1,7 +1,5 @@ using NPOI.SS.UserModel; using NPOI.SS.Util; -using Tiobon.Core.Model.Models; -using static Tiobon.Core.DataAccess.ReportHelper; using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; diff --git a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs index 9e3e8501..7f2908c7 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs @@ -12,4 +12,93 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) + { + if (filter.orderBy == "EffectiveDate1") + filter.orderBy = "EffectiveDate"; + if (filter.orderBy == "ExpiryDate1") + filter.orderBy = "ExpiryDate"; + + var result = await base.QueryFilterPage(filter, condition, IsEnable); + var DT_TableDataT1 = result.result.DT_TableDataT1; + + var deptIds = DT_TableDataT1.Select(x => x.DeptId).Distinct().ToList(); + var courseIds = DT_TableDataT1.Select(x => x.CourseId).Distinct().ToList(); + var titleIds = DT_TableDataT1.Select(x => x.TitleId).Distinct().ToList(); + + var depts = await Db.Queryable().Where(x => deptIds.Contains(x.DeptID)).ToListAsync(); + + var deptIds1 = depts.Select(x => x.ParentDeptID).Distinct().ToList(); + depts = await Db.Queryable().Where(x => deptIds.Contains(x.DeptID) || deptIds1.Contains(x.DeptID)).ToListAsync(); + var courses = await Db.Queryable().Where(x => courseIds.Contains(x.Id)).ToListAsync(); + var courseScenes = await Db.Queryable().Where(x => courseIds.Contains(x.Id)).ToListAsync(); + var titles = await Db.Queryable().Where(x => titleIds.Contains(x.TitleID)).ToListAsync(); + + for (int i = 0; i < DT_TableDataT1.Count; i++) + { + if (DT_TableDataT1[i].CourseId.IsNotEmptyOrNull()) + DT_TableDataT1[i].CourseName = courses.Where(x => x.Id == DT_TableDataT1[i].CourseId).Select(x => x.CourseName).FirstOrDefault(); + if (DT_TableDataT1[i].CourseName.IsNullOrEmpty()) + DT_TableDataT1[i].CourseName = courseScenes.Where(x => x.Id == DT_TableDataT1[i].CourseId).Select(x => x.SceneName).FirstOrDefault(); + + + if (DT_TableDataT1[i].DeptId.IsNotEmptyOrNull()) + { + var dept = depts.Where(x => x.DeptID == DT_TableDataT1[i].DeptId).FirstOrDefault(); + DT_TableDataT1[i].DeptName = dept?.DeptName; + + if (dept != null && dept.ParentDeptID.IsNotEmptyOrNull()) + DT_TableDataT1[i].ParentDeptName = depts.Where(x => x.DeptID == dept.ParentDeptID).Select(X => X.DeptName).FirstOrDefault(); + + } + if (DT_TableDataT1[i].TitleId.IsNotEmptyOrNull()) + DT_TableDataT1[i].TitleName = titles.Where(x => x.TitleID == DT_TableDataT1[i].TitleId).Select(x => x.TitleName).FirstOrDefault(); + DT_TableDataT1[i].EffectiveDate1 = DateTimeHelper.ConvertToDayString(DT_TableDataT1[i].EffectiveDate); + DT_TableDataT1[i].ExpiryDate1 = DateTimeHelper.ConvertToDayString(DT_TableDataT1[i].ExpiryDate); + } + return result; + } + + //public override async Task Add(InsertGhre_TitleSkill_BoltoneInput entity) + //{ + // if (entity.StaffId != null) + // entity.StaffIds = JsonHelper.ObjToJson(entity.StaffId.OrderBy(n => n).ToList()); + // if (entity.StaffId.IsNotEmptyOrNull() && entity.StaffId.Count > 0) + // entity.TrainNum = entity.StaffId.Count; + // if (entity.Months != null) + // entity.Month = JsonHelper.ObjToJson(entity.Months.OrderBy(n => n).ToList()); + // var result = await base.Add(entity); + + // return result; + //} + + //public override async Task Update(long Id, EditGhre_TitleSkill_BoltoneInput editModel) + //{ + // if (editModel.StaffId != null) + // editModel.StaffIds = JsonHelper.ObjToJson(editModel.StaffId); + + // if (editModel.StaffId.IsNotEmptyOrNull() && editModel.StaffId.Count > 0) + // editModel.TrainNum = editModel.StaffId.Count; + // if (editModel.Months != null) + // editModel.Month = JsonHelper.ObjToJson(editModel.Months.OrderBy(n => n).ToList()); + + // var result = await base.Update(Id, editModel); + // return result; + //} + + //public override async Task> QueryForm(QueryForm body) + //{ + // var result = await base.QueryForm(body); + + // string StaffIds = result.result.DT_TableDataT1[0].StaffIds; + // string Month = result.result.DT_TableDataT1[0].Month; + // if (!string.IsNullOrWhiteSpace(StaffIds)) + // result.result.DT_TableDataT1[0].StaffId = JsonConvert.DeserializeObject>(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; + //} } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index a69a4161..9c9df59e 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -36418,6 +36418,16 @@ 修改信息 + + + 生效日期 + + + + + 失效日期 + + 【牛尾】培训计划(Dto.View1)