fix 用户查询考勤处理
This commit is contained in:
@@ -217,6 +217,45 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceUploadLogUserResponse>> GetUserPageAsync(DeviceUploadLogUserPageRequest request)
|
||||
{
|
||||
var r = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||
.LeftJoin<DeviceEntity>((x, device) => x.DeviceUniqueNo == device.UniqueNo)
|
||||
.LeftJoin<GainfoEntity>((x, device, ga) => x.UserUniqueNo == ga.Code)
|
||||
.WhereIF(request.SearchDateTimePeriod.HasValue(), x => x.RaiseDateTime >= request.SearchDateTimePeriod.Start
|
||||
&& x.RaiseDateTime <= request.SearchDateTimePeriod.End)
|
||||
.Where((x, device) => x.NeedUpload)
|
||||
.WhereIF(request.Search.IsPresent(), (x, device, ga) =>
|
||||
x.UserUniqueNo == request.Search
|
||||
|| x.DeviceUniqueNo == request.Search
|
||||
)
|
||||
.OrderBy(x => x.RaiseDateTime, OrderByType.Desc)
|
||||
.Select((x, device, ga) => new DeviceUploadLogUserResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
OriginUserUniqueNo = x.UserUniqueNo,
|
||||
DeviceUniqueNo = x.DeviceUniqueNo,
|
||||
RaiseDateTime = x.RaiseDateTime,
|
||||
CreateTime = x.CreateTime,
|
||||
SerialNo = x.SerialNo,
|
||||
UserNo = ga.No,
|
||||
UserCode = ga.Code,
|
||||
UserName = ga.Name,
|
||||
DeployPlace = device.DeployPlace,
|
||||
NeedUpload = x.NeedUpload,
|
||||
Sync = x.Sync,
|
||||
Status = x.Status,
|
||||
}).ToPageListAsync(request.PageIndex, request.PageSize);
|
||||
|
||||
return new Pagination<DeviceUploadLogUserResponse>
|
||||
{
|
||||
PageIndex = request.PageIndex,
|
||||
PageSize = request.PageSize,
|
||||
Total = 0,
|
||||
Data = r
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceUploadLogResponse>> GetPageAsync(DeviceUploadLogPageRequest request)
|
||||
{
|
||||
DeviceUploadLogTypeEnumType? type = request.Type switch
|
||||
|
||||
Reference in New Issue
Block a user