From d2178870187557a09cd27454d300d41cc1a8d606 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 23 Apr 2025 10:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E8=B4=B9=E7=94=A8=E8=AE=B2?= =?UTF-8?q?=E5=B8=88=E6=9F=A5=E8=AF=A2=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Tiobon.Core.Model.xml | 5 ++ ...hre_TrainFeeApplyOrder_Boltone.Dto.Base.cs | 1 + .../View/Ghra/Ghra_Staff.Dto.View.cs | 6 +++ ...hre_TrainFeeApplyOrder_Boltone.Dto.View.cs | 7 +++ Tiobon.Core.Services/CommonServices.cs | 14 +++-- .../Ghra/Ghra_StaffServices.cs | 13 +++++ ...Ghre_TrainFeeApplyOrder_BoltoneServices.cs | 51 ++++++++++++++++++- .../Ghrh/Ghrh_TemplateServices.cs | 3 +- Tiobon.Core/Tiobon.Core.Model.xml | 5 ++ 9 files changed, 100 insertions(+), 5 deletions(-) diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 4d5e29d2..c537d061 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -35863,6 +35863,11 @@ 部门 + + + 部门 + + 岗位 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.Base.cs index 9ebaf1da..e69f83ba 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.Base.cs @@ -287,4 +287,5 @@ public class Ghre_TrainFeeApplyOrder_BoltoneBase public int? ReverseI2 { get; set; } public List Attachments { get; set; } = new List(); + public List Details { get; set; } = new List(); } 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 088e39ed..bfc21537 100644 --- a/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghra/Ghra_Staff.Dto.View.cs @@ -64,6 +64,11 @@ public class Ghra_StaffDto : Ghra_Staff /// public string DeptName { get; set; } + /// + /// 部门 + /// + public string ParentDeptName { get; set; } + /// /// 岗位 /// @@ -81,4 +86,5 @@ public class Ghra_StaffDto : Ghra_Staff public int? TitleId { get; set; } public int? DeptId { get; set; } + public int? ParentDeptId { get; set; } } diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.View.cs index 2875da1c..e4e7098f 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_TrainFeeApplyOrder_Boltone.Dto.View.cs @@ -31,4 +31,11 @@ public class Ghre_TrainFeeApplyOrder_BoltoneDto : Ghre_TrainFeeApplyOrder_Bolton /// 修改信息 /// public string UpdateDataInfo { get; set; } + public string ApplicantName { get; set; } + public string ApplicantDeptName { get; set; } + public string TeacherName { get; set; } + public string DeptName { get; set; } + public string IsApplyFee1 { get; set; } + + } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 9bed353d..9a25182d 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -3941,9 +3941,9 @@ public partial class CommonServices : BaseServices>, ICommon case "F_ESS_TrainFeeApplyOrder_Boltone": if (param.doType == "Insert") { - flowReturn.DT_TableDataT1 = new List() + flowReturn.DT_TableDataT1 = new List() { - new Ghre_TrainFeeApplyOrder_Boltone() + new InsertGhre_TrainFeeApplyOrder_BoltoneInput() { ApplicantId = App.User.StaffId, ApplicantDeptId = GetStaffDeptId(), @@ -4358,7 +4358,7 @@ public partial class CommonServices : BaseServices>, ICommon #region 写入数据,并判断是否有错误 string json = param.jsonParam.ToString(); - var dict = JsonHelper.JsonToObj(json); + var dict = JsonHelper.JsonToObj(json); var dict1 = JsonHelper.JsonToObj(json); //dict.RequestNo = await GenerateContinuousSequence("Ghrh_HumanRequest", "RequestNo", "R"); id = await Db.Insertable(dict).ExecuteReturnSnowflakeIdAsync(); @@ -4370,6 +4370,14 @@ public partial class CommonServices : BaseServices>, ICommon id = id1; + + dict1.Details.ForEach(x => + { + x.OrderId = id; + x.Id = SnowFlakeSingle.Instance.NextId(); + }); + await Db.Insertable(dict1.Details).ExecuteCommandAsync(); + if (dict1.Attachments.Any()) { var ids = dict1.Attachments.Select(x => x.AttachmentID).ToList(); diff --git a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs index 5f7759ed..f9473a33 100644 --- a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs +++ b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs @@ -53,6 +53,19 @@ public class Ghra_StaffServices : BaseServices().Where(x => x.DeptID == entity.DeptId).FirstAsync(); + + if (dept != null) + entity.DeptName = dept.DeptName; + + dept = await Db.Queryable().Where(x => x.ParentDeptID == entity.DeptId).FirstAsync(); + if (dept != null) + entity.ParentDeptName = dept.DeptName; + } + var licences = await Db.Ado.SqlQueryAsync($"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_TrainFeeApplyOrder_BoltoneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TrainFeeApplyOrder_BoltoneServices.cs index 3a8785dd..583b3c03 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TrainFeeApplyOrder_BoltoneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TrainFeeApplyOrder_BoltoneServices.cs @@ -1,4 +1,6 @@ -namespace Tiobon.Core.Services; +using Tiobon.Core.IServices; + +namespace Tiobon.Core.Services; /// /// 培训费用_宝连通 (服务) @@ -12,4 +14,51 @@ public class Ghre_TrainFeeApplyOrder_BoltoneServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) + { + + var result = await base.QueryFilterPage(filter, "WorkState=1", IsEnable); + + var DT_TableDataT1 = result.result.DT_TableDataT1; + + var applicantDeptIds = DT_TableDataT1.Select(x => x.ApplicantDeptId).Distinct().ToList(); + var deptIds = DT_TableDataT1.Select(x => x.DeptId).Distinct().ToList(); + var teacherIds = DT_TableDataT1.Select(x => x.TeacherId).Distinct().ToList(); + deptIds.AddRange(applicantDeptIds); + deptIds = deptIds.Distinct().ToList(); + + + + + var staffIds = DT_TableDataT1.Select(x => x.ApplicantId).Distinct().ToList(); + staffIds.AddRange(teacherIds); + 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(); + + + for (int i = 0; i < DT_TableDataT1.Count; i++) + { + DT_TableDataT1[i].InOrOut = await GetParaLabel("CourseInOrOut", DT_TableDataT1[i].InOrOut); + DT_TableDataT1[i].TrainFeeCourseType = await GetParaLabel("TrainFeeCourseType-Boltone", DT_TableDataT1[i].TrainFeeCourseType); + DT_TableDataT1[i].TrainTimeType = await GetParaLabel("TrainTimeType-Boltone", DT_TableDataT1[i].TrainTimeType); + if (DT_TableDataT1[i].ApplicantId.IsNotEmptyOrNull()) + DT_TableDataT1[i].ApplicantName = staffs.FirstOrDefault(x => x.StaffID == DT_TableDataT1[i].ApplicantId)?.StaffName; + + if (DT_TableDataT1[i].ApplicantDeptId.IsNotEmptyOrNull()) + DT_TableDataT1[i].ApplicantDeptName = depts.FirstOrDefault(x => x.DeptID == DT_TableDataT1[i].ApplicantDeptId)?.DeptName; + + if (DT_TableDataT1[i].DeptId.IsNotEmptyOrNull()) + DT_TableDataT1[i].DeptName = depts.FirstOrDefault(x => x.DeptID == DT_TableDataT1[i].DeptId)?.DeptName; + if (DT_TableDataT1[i].TeacherId.IsNotEmptyOrNull()) + DT_TableDataT1[i].TeacherName = staffs.FirstOrDefault(x => x.StaffID == DT_TableDataT1[i].TeacherId)?.StaffName; + + DT_TableDataT1[i].IsApplyFee1 = DT_TableDataT1[i].IsApplyFee == 1 ? "是" : "否"; + } + + return result; + } + } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs index afeec6e0..5f5017bd 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs @@ -109,7 +109,8 @@ public class Ghrh_TemplateServices : BaseServices().Where(x => x.ResumeId == resumeId).OrderByDescending(x => x.ApplyTime).SingleAsync(); + var offerApplyOrder = await Db.Queryable().Where(x => x.ResumeId == resumeId) + .OrderByDescending(x => x.ApplyTime).FirstAsync(); if (offerApplyOrder != null) { diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 4d5e29d2..c537d061 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -35863,6 +35863,11 @@ 部门 + + + 部门 + + 岗位