feat 获取考勤设备
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
@@ -154,7 +155,7 @@ public class DeviceService : IDeviceService
|
||||
public async Task<Pagination<DeviceResponse>> GetDeviceByNoAsync(DevicePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(x=>x.UniqueNo == request.UniqueNo)
|
||||
.Where(x => x.UniqueNo == request.UniqueNo)
|
||||
.Select(device => new DeviceResponse
|
||||
{
|
||||
FuncsStr = device.Funcs.ToString()
|
||||
@@ -165,9 +166,17 @@ public class DeviceService : IDeviceService
|
||||
return page;
|
||||
}
|
||||
|
||||
public Task<List<DeviceResponse>> GetAttendanceDevicesAsync()
|
||||
public async Task<List<DeviceResponse>> GetAttendanceDevicesAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.Enable)
|
||||
.Select(x => new DeviceResponse
|
||||
{
|
||||
FuncsStr = x.Funcs.ToString()
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
|
||||
return devices.Where(x => x.Funcs.Contains(DeviceFuncEnumType.Attendance)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user