From e96942ecbd1707834a40d226a18034396e02f468 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 13 Dec 2024 10:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E4=BA=BA=E5=8A=9B=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A1=E6=89=B9=E6=98=BE=E7=A4=BA=E5=88=97?= =?UTF-8?q?=20=E5=B9=B4=E5=BA=A6=E4=BA=BA=E5=8A=9B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=AE=A1=E6=89=B9=E6=B5=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=98=8E=E7=BB=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrh_YearHumanApplyOrderController.cs | 14 ++++ .../Ghrh/Ghrh_YearHumanSettingsController.cs | 12 +++ Tiobon.Core.Api/Tiobon.Core.xml | 15 ++++ .../Ghrh/IGhrh_YearHumanApplyOrderServices.cs | 2 + .../Ghrh/IGhrh_YearHumanSettingsServices.cs | 6 +- .../Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs | 2 + .../Ghrh/Ghrh_YearHumanApplyOrderServices.cs | 11 +++ .../Ghrh/Ghrh_YearHumanSettingsServices.cs | 77 ++++++++++++++++++- Tiobon.Core/Tiobon.Core.xml | 15 ++++ 9 files changed, 148 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanApplyOrderController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanApplyOrderController.cs index 20a0bb35..d5f6c5c3 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanApplyOrderController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanApplyOrderController.cs @@ -11,4 +11,18 @@ public class Ghrh_YearHumanApplyOrderController : BaseController + /// + /// + /// + /// + [HttpPost("QueryByWorkId/{id}")] + public async Task> QueryByWorkId(int id) + { + return await _service.QueryByWorkId(id); + } + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanSettingsController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanSettingsController.cs index 1789e505..b0f2a1d8 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanSettingsController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanSettingsController.cs @@ -11,4 +11,16 @@ public class Ghrh_YearHumanSettingsController : BaseController + /// + /// + /// + /// + /// + [HttpPost("QueryApplyColumn/{curentYear}/{langId}")] + public async Task>> QueryApplyColumn(int curentYear, int langId) => await _service.QueryApplyColumn(curentYear, langId); + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 6445b6e1..02636cfc 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1735,11 +1735,26 @@ 年度人力申请(Controller) + + + + + + + 年度人力配置(Controller) + + + + + + + + Ghrm_MessageText(Controller) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs index 64bb8c03..9608bdc6 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs @@ -1,4 +1,5 @@ using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; @@ -8,4 +9,5 @@ namespace Tiobon.Core.IServices; /// public interface IGhrh_YearHumanApplyOrderServices : IBaseServices { + Task> QueryByWorkId(int objId); } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs index dbd6633d..23158fd1 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs @@ -1,4 +1,5 @@ using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; @@ -6,6 +7,7 @@ namespace Tiobon.Core.IServices; /// /// 年度人力配置(自定义服务接口) /// - public interface IGhrh_YearHumanSettingsServices :IBaseServices +public interface IGhrh_YearHumanSettingsServices : IBaseServices { - } \ No newline at end of file + Task>> QueryApplyColumn(int curentYear, int langId); +} \ No newline at end of file diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs index 7e808abb..87ad1823 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs @@ -31,4 +31,6 @@ public class Ghrh_YearHumanApplyOrderDto : Ghrh_YearHumanApplyOrder /// 修改信息 /// public string UpdateDataInfo { get; set; } + + public List Items { get; set; } } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs index 3b36ab59..deb036e1 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs @@ -6,10 +6,21 @@ public class Ghrh_YearHumanApplyOrderServices : BaseServices, IGhrh_YearHumanApplyOrderServices { private readonly IBaseRepository _dal; + //private readonly Ghrh_YearHumanSettingsServices _ghrh_YearHumanSettingsServices; public Ghrh_YearHumanApplyOrderServices(ICaching caching, IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; base._caching = caching; + //_ghrh_YearHumanSettingsServices = ghrh_YearHumanSettingsServices; + } + + public async Task> QueryByWorkId(int objId) + { + var entity = await base.QuerySingleDto(x => x.WorkID == objId); + if (entity != null) + entity.Items = await Db.Queryable().Where(x => x.OrderId == entity.Id).ToListAsync(); + return ServiceResult.OprateSuccess("查询成功!", entity); + } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs index d3ae91a9..4cfbe1d3 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs @@ -110,11 +110,14 @@ public class Ghrh_YearHumanSettingsServices : BaseServices { - int month = x.field.Replace("M", null).Replace("F", null).ObjToInt(); if (x.GroupName == "预算编制数") - x.label = year + "-" + x.field.Replace("M", null); - if (month == 12) - year++; + { + + int month = x.field.Replace("M", null).Replace("F", null).ObjToInt(); + x.label = year + "-" + x.field.Replace("M", null).Replace("F", null); + if (month == 12) + year++; + } }); } return result; @@ -144,4 +147,70 @@ public class Ghrh_YearHumanSettingsServices : BaseServices>> QueryApplyColumn(int curentYear, int langId) + { + int flowId = await Db.Ado.GetIntAsync("Select FlowID from Ghrw_Flow where FlowNo='F_ESS_RecruitYearManpowerApply'"); + var param = new FlowParam() { doType = "Insert", jsonParam = new FlowJsonParam() { FlowID = flowId }, menuName = "F_ESS_RecruitYearManpowerApply", langId = langId, userId = App.User.ID }; + + var flowReturn = await _commonServices.GetFlowInfoAsync(param); + var config = await Db.Queryable().Where(x => x.ConfigCode == "ESS_Recruit_Year_Human_Start_Month").FirstAsync(); + + var startMonth = config != null ? config.ConfigValue.ObjToInt() : 1; + + #region 处理起始月 + var months = new List(); + List numbers = new(); + for (int i = 1; i <= 12; i++) + { + if (i < 10) + months.Add("0" + i); + else + months.Add(i.ObjToString()); + numbers.Add(i); + } + // 指定要打头的数字 + int startNumber = startMonth; + var sort = flowReturn.result.JM_TableColumnT1.TableColumn.Where(x => x.field == "M1").SingleOrDefault()?.rowNum ?? 5; + // 创建一个新的列表用于存储重新排序后的结果 + List reorderedNumbers = new(); + flowReturn.result.JM_TableColumnT1.TableColumn?.ForEach(x => + { + if (months.Where(o => o == x.label).Any()) + x.GroupName = "预算编制数"; + + }); + + // 找到指定数字的索引 + int index1 = numbers.IndexOf(startNumber); + if (index1 != -1) + { + // 从指定数字开始,按照循环顺序添加数字 + for (int i = 0; i < numbers.Count; i++) + { + int currentIndex = (index1 + i) % numbers.Count; + reorderedNumbers.Add(numbers[currentIndex]); + } + + foreach (var num in reorderedNumbers) + { + flowReturn.result.JM_TableColumnT1.TableColumn?.ForEach(x => + { + if (x.field.Replace("M", null).ObjToInt() == num) + { + x.rowNum = sort; + x.label = curentYear + "-" + x.field.Replace("M", null); + } + }); + if (num == 12) + curentYear++; + sort++; + } + } + flowReturn.result.JM_TableColumnT1.TableColumn = flowReturn.result.JM_TableColumnT1.TableColumn.OrderBy(x => x.rowNum).ToList(); + #endregion + + return ServiceResult>.OprateSuccess("查询成功!", flowReturn.result.JM_TableColumnT1.TableColumn); ; + + } } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 6445b6e1..02636cfc 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1735,11 +1735,26 @@ 年度人力申请(Controller) + + + + + + + 年度人力配置(Controller) + + + + + + + + Ghrm_MessageText(Controller)