培训报表 新增查询新入职员工页面

master
xiaochanghai 5 months ago
parent a9fe0bca80
commit 712cf53d73
  1. 35
      Tiobon.Core.Api/Controllers/ReportController.cs
  2. 20
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 6
      Tiobon.Core.Common/Helper/DateTimeHelper.cs
  4. 14
      Tiobon.Core.IServices/IReportServices.cs
  5. 52
      Tiobon.Core.Services/ReportServices.cs

@ -0,0 +1,35 @@
namespace Tiobon.Core.Controllers;
/// <summary>
/// 公共服务
/// </summary>
[Produces("application/json")]
[Route("api/Report")]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class ReportController : BaseApiController
{
private readonly ILogger<CommonController> _logger;
private readonly IReportServices _services;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="logger"></param>
/// <param name="services"></param>
public ReportController(ILogger<CommonController> logger, IReportServices services)
{
_services = services;
_logger = logger;
}
#region 获取新入职人员列表
/// <summary>
/// 获取新入职人员列表
/// </summary>
/// <param name="filter"></param>
/// <param name="condition"></param>
/// <returns></returns>
[HttpPost, Route("QueryNewStaff")]
public async Task<ServicePageResult<Ghra_StaffDto>> QueryNewStaffAsync([FromBody] QueryBody filter, string condition)=> await _services.QueryNewStaffAsync(filter, condition, true);
#endregion
}

@ -571,6 +571,26 @@
</summary>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Controllers.ReportController">
<summary>
公共服务
</summary>
</member>
<member name="M:Tiobon.Core.Controllers.ReportController.#ctor(Microsoft.Extensions.Logging.ILogger{Tiobon.Core.Controllers.CommonController},Tiobon.Core.IServices.IReportServices)">
<summary>
构造函数
</summary>
<param name="logger"></param>
<param name="services"></param>
</member>
<member name="M:Tiobon.Core.Controllers.ReportController.QueryNewStaffAsync(Tiobon.Core.Common.QueryBody,System.String)">
<summary>
获取新入职人员列表
</summary>
<param name="filter"></param>
<param name="condition"></param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Controllers.TasksQzController.Get(System.Int32,System.String)">
<summary>
分页获取

@ -100,7 +100,11 @@ public class DateTimeHelper
}
return dateTime.ToString(@"yyyy\/MM\/dd");
}
/// <summary>
/// 格式化DateTime类型为字符串类型,精确到天,如:2008/01/01
/// </summary>
/// <param name="dateTime"></param>
/// <returns></returns>
public static DateTime ConvertToDay(DateTime dateTime)
{
string result = ConvertToDayString(dateTime);

@ -0,0 +1,14 @@
using Tiobon.Core.Common;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
namespace Tiobon.Core.IServices;
/// <summary>
/// IReportServices
/// </summary>
public interface IReportServices : IBaseServices<RootEntityTkey<int>>
{
Task<ServicePageResult<Ghra_StaffDto>> QueryNewStaffAsync(QueryBody filter, string condition, bool? IsEnable = true);
}

@ -0,0 +1,52 @@
using Microsoft.Extensions.Logging;
namespace Tiobon.Core.Services;
public partial class ReportServices : BaseServices<RootEntityTkey<int>>, IReportServices
{
IHttpContextAccessor _httpContextAccessor;
ILogger<PayServices> _logger;
public ICaching _caching;
private readonly IGhra_StaffServices _staffServices;
public ReportServices(ILogger<PayServices> logger, IHttpContextAccessor httpContextAccessor, ICaching caching = null, IGhra_StaffServices staffServices = null)
{
_logger = logger;
_httpContextAccessor = httpContextAccessor;
_caching = caching;
_staffServices = staffServices;
}
#region 获取新入职人员列表
/// <summary>
/// 获取新入职人员列表
/// </summary>
/// <param name="filter"></param>
/// <param name="condition"></param>
/// <param name="IsEnable"></param>
/// <returns></returns>
public async Task<ServicePageResult<Ghra_StaffDto>> QueryNewStaffAsync(QueryBody filter, string condition, bool? IsEnable = true)
{
int month = 3;
var config = await Db.Queryable<Ghre_Config>().Where(x => x.ConfigCode == "New_Staff_Month").FirstAsync();
if (config != null)
{
try
{
month = Convert.ToInt32(config.ConfigValue);
}
catch (Exception)
{
}
}
var dateTime = DateTime.Now.AddMonths(-month);
condition = $"Indate >= '{DateTimeHelper.ConvertToDayString(dateTime)}'";
var result = await _staffServices.QueryFilterPage(filter, condition, IsEnable);
return result;
}
#endregion
}
Loading…
Cancel
Save