fix 移除无效判断,api
This commit is contained in:
@@ -66,7 +66,6 @@ public class DevicePermissionsController : ControllerBase
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[DataPermission]
|
||||
[HttpGet("assignments-unique")]
|
||||
public async Task<List<GainfoDto>> GetAssignmentUniqueAsync([FromQuery] DeviceGetAssignmentUniquesRequest request)
|
||||
{
|
||||
|
||||
@@ -163,16 +163,6 @@ public class DevicesController : ControllerBase
|
||||
return await _deviceService.GetAttendanceDevicesAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取考勤设备在线、离线及总数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("devicesnumbers")]
|
||||
public async Task<DeviceNumberResponse> GetDeviceNumberAsync()
|
||||
{
|
||||
return await _deviceService.GetDeviceNumberAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取考勤在线/离线设备详情列表
|
||||
/// </summary>
|
||||
|
||||
@@ -14,8 +14,6 @@ public interface IDeviceService : IScopeDependency
|
||||
|
||||
Task<List<DeviceResponse>> GetAttendanceDevicesAsync();
|
||||
|
||||
Task<DeviceNumberResponse> GetDeviceNumberAsync();
|
||||
|
||||
Task<Pagination<DevicePageResponse>> GetOnlineStatusPageAsync(DeviceOnlineAndOfflineRequest request);
|
||||
|
||||
Task ImportAsync(List<DeviceImportRequest> request);
|
||||
|
||||
@@ -288,21 +288,6 @@ public class DeviceService : IDeviceService
|
||||
return devices.Where(x => x.Type == DeviceTypeEnumType.Attendance).ToList();
|
||||
}
|
||||
|
||||
public async Task<DeviceNumberResponse> GetDeviceNumberAsync()
|
||||
{
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Type == DeviceTypeEnumType.Attendance || (x.Type == DeviceTypeEnumType.Door && x.AsAttendance)).ToListAsync();
|
||||
|
||||
var offlineNumber = await GetOfflineDevicesCount(devices);
|
||||
|
||||
var res = new DeviceNumberResponse
|
||||
{
|
||||
OfflineNumber = offlineNumber.Count,
|
||||
TotalNumber = devices.Count,
|
||||
OnlineNumber = devices.Count - offlineNumber.Count
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取离线设备
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user