feat 获取考勤数据接口
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.External.OpenApi.Request;
|
||||
using Dlhis.External.OpenApi.Response;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.External.OpenApi.Services.Implements;
|
||||
@@ -57,4 +63,25 @@ public class GainfoService : IGainfoService
|
||||
PNo = x.PNo
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceUploadLogResponse>> GetAttendanceRecordPageAsync(DeviceUploadLogMyRecordRequest request)
|
||||
{
|
||||
return await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||
.LeftJoin<DeviceEntity>((log, d) => log.DeviceUniqueNo == d.UniqueNo)
|
||||
.Where(log => log.UserUniqueNo == request.UserCode)
|
||||
.WhereIF(request.DateTimePeriod.HasValue(), log => log.RaiseDateTime >= request.DateTimePeriod.Start && log.RaiseDateTime <= request.DateTimePeriod.End)
|
||||
.Where((log, d) => d.Type == DeviceTypeEnumType.Attendance || (d.Type == DeviceTypeEnumType.Door && d.AsAttendance))
|
||||
.OrderBy(log => log.RaiseDateTime)
|
||||
.Select((log, d) => new DeviceUploadLogResponse
|
||||
{
|
||||
DeviceUniqueNo = log.DeviceUniqueNo,
|
||||
Id = log.Id,
|
||||
RaiseDateTime = log.RaiseDateTime,
|
||||
SerialNo = log.SerialNo,
|
||||
DeployPlace = d.DeployPlace,
|
||||
Sync = log.Sync,
|
||||
Status = log.Status
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user