年度人力配置新增根据年度获取审批显示列

年度人力配置新增 审批流查询明细接口
master
xiaochanghai 6 months ago
parent b5e1942d3a
commit e96942ecbd
  1. 14
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanApplyOrderController.cs
  2. 12
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_YearHumanSettingsController.cs
  3. 15
      Tiobon.Core.Api/Tiobon.Core.xml
  4. 2
      Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs
  5. 6
      Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs
  6. 2
      Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs
  7. 11
      Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs
  8. 77
      Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs
  9. 15
      Tiobon.Core/Tiobon.Core.xml

@ -11,4 +11,18 @@ public class Ghrh_YearHumanApplyOrderController : BaseController<IGhrh_YearHuman
public Ghrh_YearHumanApplyOrderController(IGhrh_YearHumanApplyOrderServices service) : base(service)
{
}
#region 根据审批单ID获取数据
/// <summary>
///
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("QueryByWorkId/{id}")]
public async Task<ServiceResult<Ghrh_YearHumanApplyOrderDto>> QueryByWorkId(int id)
{
return await _service.QueryByWorkId(id);
}
#endregion
}

@ -11,4 +11,16 @@ public class Ghrh_YearHumanSettingsController : BaseController<IGhrh_YearHumanSe
public Ghrh_YearHumanSettingsController(IGhrh_YearHumanSettingsServices service) : base(service)
{
}
#region 根据年份查询审批Column
/// <summary>
///
/// </summary>
/// <param name="curentYear"></param>
/// <param name="langId"></param>
/// <returns></returns>
[HttpPost("QueryApplyColumn/{curentYear}/{langId}")]
public async Task<ServiceResult<List<FlowTableColumn>>> QueryApplyColumn(int curentYear, int langId) => await _service.QueryApplyColumn(curentYear, langId);
#endregion
}

@ -1735,11 +1735,26 @@
年度人力申请(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_YearHumanApplyOrderController.QueryByWorkId(System.Int32)">
<summary>
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_YearHumanSettingsController">
<summary>
年度人力配置(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_YearHumanSettingsController.QueryApplyColumn(System.Int32,System.Int32)">
<summary>
</summary>
<param name="curentYear"></param>
<param name="langId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrm_MessageTextController">
<summary>
Ghrm_MessageText(Controller)

@ -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;
/// </summary>
public interface IGhrh_YearHumanApplyOrderServices : IBaseServices<Ghrh_YearHumanApplyOrder, Ghrh_YearHumanApplyOrderDto, InsertGhrh_YearHumanApplyOrderInput, EditGhrh_YearHumanApplyOrderInput>
{
Task<ServiceResult<Ghrh_YearHumanApplyOrderDto>> QueryByWorkId(int objId);
}

@ -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;
/// <summary>
/// 年度人力配置(自定义服务接口)
/// </summary>
public interface IGhrh_YearHumanSettingsServices :IBaseServices<Ghrh_YearHumanSettings, Ghrh_YearHumanSettingsDto, InsertGhrh_YearHumanSettingsInput, EditGhrh_YearHumanSettingsInput>
public interface IGhrh_YearHumanSettingsServices : IBaseServices<Ghrh_YearHumanSettings, Ghrh_YearHumanSettingsDto, InsertGhrh_YearHumanSettingsInput, EditGhrh_YearHumanSettingsInput>
{
}
Task<ServiceResult<List<FlowTableColumn>>> QueryApplyColumn(int curentYear, int langId);
}

@ -31,4 +31,6 @@ public class Ghrh_YearHumanApplyOrderDto : Ghrh_YearHumanApplyOrder
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public List<Ghrh_YearHumanSettings> Items { get; set; }
}

@ -6,10 +6,21 @@
public class Ghrh_YearHumanApplyOrderServices : BaseServices<Ghrh_YearHumanApplyOrder, Ghrh_YearHumanApplyOrderDto, InsertGhrh_YearHumanApplyOrderInput, EditGhrh_YearHumanApplyOrderInput>, IGhrh_YearHumanApplyOrderServices
{
private readonly IBaseRepository<Ghrh_YearHumanApplyOrder> _dal;
//private readonly Ghrh_YearHumanSettingsServices _ghrh_YearHumanSettingsServices;
public Ghrh_YearHumanApplyOrderServices(ICaching caching, IBaseRepository<Ghrh_YearHumanApplyOrder> dal)
{
this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
//_ghrh_YearHumanSettingsServices = ghrh_YearHumanSettingsServices;
}
public async Task<ServiceResult<Ghrh_YearHumanApplyOrderDto>> QueryByWorkId(int objId)
{
var entity = await base.QuerySingleDto(x => x.WorkID == objId);
if (entity != null)
entity.Items = await Db.Queryable<Ghrh_YearHumanSettings>().Where(x => x.OrderId == entity.Id).ToListAsync();
return ServiceResult<Ghrh_YearHumanApplyOrderDto>.OprateSuccess("查询成功!", entity);
}
}

@ -110,11 +110,14 @@ public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSetting
result.result.JM_TableColumnT1.TableColumn?.ForEach(x =>
{
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<Ghrh_YearHumanSetting
return result;
}
public async Task<ServiceResult<List<FlowTableColumn>>> 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<Ghrh_Config>().Where(x => x.ConfigCode == "ESS_Recruit_Year_Human_Start_Month").FirstAsync();
var startMonth = config != null ? config.ConfigValue.ObjToInt() : 1;
#region 处理起始月
var months = new List<string>();
List<int> 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<int> 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<List<FlowTableColumn>>.OprateSuccess("查询成功!", flowReturn.result.JM_TableColumnT1.TableColumn); ;
}
}

@ -1735,11 +1735,26 @@
年度人力申请(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_YearHumanApplyOrderController.QueryByWorkId(System.Int32)">
<summary>
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_YearHumanSettingsController">
<summary>
年度人力配置(Controller)
</summary>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_YearHumanSettingsController.QueryApplyColumn(System.Int32,System.Int32)">
<summary>
</summary>
<param name="curentYear"></param>
<param name="langId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrm_MessageTextController">
<summary>
Ghrm_MessageText(Controller)

Loading…
Cancel
Save