diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_TitleSkill_BoltoneController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_TitleSkill_BoltoneController.cs index 58848ebe..1a12c483 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_TitleSkill_BoltoneController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_TitleSkill_BoltoneController.cs @@ -1,4 +1,6 @@ -namespace Tiobon.Core.Api.Controllers; +using Tiobon.Core.Model.ViewModels.Extend; + +namespace Tiobon.Core.Api.Controllers; /// /// 岗位技能_宝连通(Controller) @@ -11,4 +13,12 @@ public class Ghre_TitleSkill_BoltoneController : BaseController QueryMatrix(string status, [FromBody] QueryBody filter) + { + return await _service.QueryMatrix(filter); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 9c9df59e..d4f97082 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -38488,6 +38488,26 @@ Type Description balabala + + + 入职日期 + + + + + 员工类别1 + + + + + 部门 + + + + + 岗位 + + 封面图 diff --git a/Tiobon.Core.IServices/Ghre/IGhre_TitleSkill_BoltoneServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_TitleSkill_BoltoneServices.cs index 7983b38a..5d1b5f8e 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_TitleSkill_BoltoneServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_TitleSkill_BoltoneServices.cs @@ -1,8 +1,13 @@ -namespace Tiobon.Core.IServices; +using Tiobon.Core.Common; +using Tiobon.Core.Model.ViewModels.Extend; +using Tiobon.Core.Model; + +namespace Tiobon.Core.IServices; /// /// 岗位技能_宝连通(自定义服务接口) /// public interface IGhre_TitleSkill_BoltoneServices : IBaseServices { + Task QueryMatrix(QueryBody filter); } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs index a5d74b50..5f7759ed 100644 --- a/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs +++ b/Tiobon.Core.Services/Ghra/Ghra_StaffServices.cs @@ -21,11 +21,25 @@ public class Ghra_StaffServices : BaseServices x.DeptID != null).Select(x => x.DeptID.Value).ToList(); + var depts = await Db.Queryable().Where(x => x.DeptID != null && deptIds.Contains(x.DeptID.Value)).ToListAsync(); + + var titleIds = result.result.DT_TableDataT1.Where(x => x.TitleID != null).Select(x => x.TitleID.Value).ToList(); + var titles = await Db.Queryable().Where(x => x.TitleID != null && titleIds.Contains(x.TitleID.Value)).ToListAsync(); + for (int i = 0; i < result.result.DT_TableDataT1.Count; i++) { result.result.DT_TableDataT1[i].GenderLabel = await GetParaLabel("Gender", result.result.DT_TableDataT1[i].Gender); result.result.DT_TableDataT1[i].IndateLabel = DateTimeHelper.ConvertToDayString(result.result.DT_TableDataT1[i].Indate); + result.result.DT_TableDataT1[i].StaffType1Label = await GetParaLabel(result.result.DT_TableDataT1[i].StaffType1); + result.result.DT_TableDataT1[i].StaffType2Label = await GetParaLabel(result.result.DT_TableDataT1[i].StaffType2); + + if (result.result.DT_TableDataT1[i].DeptID != null) + result.result.DT_TableDataT1[i].DeptName = depts.Where(o => o.DeptID == result.result.DT_TableDataT1[i].DeptID).FirstOrDefault()?.DeptName; + + if (result.result.DT_TableDataT1[i].TitleID != null) + result.result.DT_TableDataT1[i].TitleName = titles.Where(o => o.TitleID == result.result.DT_TableDataT1[i].TitleID).FirstOrDefault()?.TitleName; } return result; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs index 7f2908c7..100b20a0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs @@ -1,4 +1,9 @@ -namespace Tiobon.Core.Services; +using MySqlX.XDevAPI.Common; +using NPOI.SS.Formula.Functions; +using OfficeOpenXml.FormulaParsing; +using System.Collections.Generic; + +namespace Tiobon.Core.Services; /// /// 岗位技能_宝连通 (服务) @@ -6,11 +11,18 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices, IGhre_TitleSkill_BoltoneServices { private readonly IBaseRepository _dal; - public Ghre_TitleSkill_BoltoneServices(ICaching caching, IBaseRepository dal) + private readonly ICommonServices _commonServices; + private readonly IGhra_StaffServices _staffServices; + public Ghre_TitleSkill_BoltoneServices(ICaching caching, + IBaseRepository dal, + IGhra_StaffServices staffServices, + ICommonServices commonServices) { this._dal = dal; base.BaseDal = dal; base._caching = caching; + _staffServices = staffServices; + _commonServices = commonServices; } public override async Task> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) { @@ -101,4 +113,100 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices QueryMatrix(QueryBody filter) + { + dynamic obj = new ExpandoObject(); + dynamic result = new ExpandoObject(); + + var result2 = await _staffServices.QueryFilterPage(filter); + + var DT_TableDataT1 = result2.result.DT_TableDataT1; + + ModuleParam param = new ModuleParam() + { + langId = filter.langId, + menuName = filter.menuName + }; + var module = await _commonServices.GetModuleInfoAsync(param); + + //var result1 = new ServicePageResult(filter.pageNum, result2.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, entitys); + //result1.result.JM_TableColumnT1 = module.Data.JM_TableColumnT1; + + var titleSkills = await base.QueryFilterPage(new QueryBody() + { + menuName = "F_TitleSkill_Boltone", + pageNum = 1, + pageSize = 10000, + orderBy = "" + }); + var columns = new JArray(); + + for (int i = 0; i < result2.result.DT_TableDataT1.Count; i++) + { + var column = result2.result.DT_TableDataT1[i]; + + var item = new JObject + { + new JProperty("StaffID", column.StaffID), + new JProperty("DeptName", column.DeptName), + new JProperty("IndateLabel", column.IndateLabel), + new JProperty("StaffNo", column.StaffNo), + new JProperty("StaffName", column.StaffName), + new JProperty("StaffType1Label", column.StaffType1Label), + new JProperty("TitleName", column.TitleName), + }; + columns.Add(item); + } + + + var list = titleSkills.result.DT_TableDataT1.Select(x => new + { + Code = x.DeptId + "_" + x.TitleId + "_" + x.RequiredElective, + Name = x.DeptName + "(" + x.RequiredElective + ")", + x.CourseId, + x.CourseName, + x.DeptId, + x.DeptName, + x.TitleId, + x.TitleName, + x.RequiredElective, + }).ToList(); + + var group = list.GroupBy(x => new { x.Name }) + .Select(x => + new + { + x.Key.Name, + items = x.ToList() + + }).ToList(); + group = group.OrderBy(x => x.Name).ToList(); + + var demoColumn = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field == "Demo").FirstOrDefault(); + group.ForEach(x => + { + x.items.ForEach(item => + { + var column1 = Mapper.Map(demoColumn).ToANew(); + column1.field = item.CourseId + "" + item.DeptId + item.TitleId + item.RequiredElective; + column1.label = item.CourseName; + column1.GroupName = x.Name; + module.Data.JM_TableColumnT1.TableColumn.Add(column1); + }); + + }); + module.Data.JM_TableColumnT1.TableColumn = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field != "Demo").ToList(); + + + result.JM_TableColumnT1 = module.Data.JM_TableColumnT1; + result.DT_TablePageInfoT1 = result2.result.DT_TablePageInfoT1; + result.DT_TableDataT1 = columns; + obj.result = result; + obj.Success = true; + obj.code = "0"; + obj.type = "success"; + obj.message = "查询成功!"; + return obj; + } } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 9c9df59e..d4f97082 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -38488,6 +38488,26 @@ Type Description balabala + + + 入职日期 + + + + + 员工类别1 + + + + + 部门 + + + + + 岗位 + + 封面图