You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.6 KiB
52 lines
1.6 KiB
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
|
|
|
|
}
|
|
|