zhengzhou-byd-lms/DOAN.Service/Bydlms/BydClockInRecordService.cs
2025-02-22 14:31:52 +08:00

80 lines
2.3 KiB
C#

using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model.Bydlms.Dto;
using DOAN.Model.Bydlms;
using DOAN.Repository;
using DOAN.Service.Bydlms.IBydlmsService;
namespace DOAN.Service.Bydlms
{
/// <summary>
/// 考勤打卡记录Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IBydClockInRecordService), ServiceLifetime = LifeTime.Transient)]
public class BydClockInRecordService : BaseService<BydClockInRecord>, IBydClockInRecordService
{
/// <summary>
/// 查询考勤打卡记录列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<BydClockInRecordDto> GetList(BydClockInRecordQueryDto parm)
{
var predicate = QueryExp(parm);
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<BydClockInRecord, BydClockInRecordDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public BydClockInRecord GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加考勤打卡记录
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public BydClockInRecord AddBydClockInRecord(BydClockInRecord model)
{
model.Id = SnowFlakeSingle.Instance.NextId().ToString();
return Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改考勤打卡记录
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateBydClockInRecord(BydClockInRecord model)
{
return Update(model, true);
}
/// <summary>
/// 查询导出表达式
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
private static Expressionable<BydClockInRecord> QueryExp(BydClockInRecordQueryDto parm)
{
var predicate = Expressionable.Create<BydClockInRecord>();
return predicate;
}
}
}