fix 任务根据设备心跳状态获取
This commit is contained in:
@@ -274,25 +274,7 @@ public class DeviceService : IDeviceService
|
||||
_dbContext.Client.QueryFilter.Restore();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<DeviceResponse> GetDeviceByNoAsync(DeviceByNoRequest request)
|
||||
{
|
||||
var device = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.UniqueNo == request.UniqueNo)
|
||||
.Select(device => new DeviceResponse
|
||||
{
|
||||
FuncsStr = device.Funcs.ToString(),
|
||||
ConnectionInfoStr = device.ConnectionInfo
|
||||
}, true)
|
||||
.SingleAsync();
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<DeviceResponse>> GetAttendanceDevicesAsync()
|
||||
{
|
||||
@@ -347,7 +329,7 @@ public class DeviceService : IDeviceService
|
||||
var onlineDevices = deviceRegistries.Where(x =>
|
||||
{
|
||||
if (x.HeartbeatInterval <= 0) return true;
|
||||
return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval * 3) >= now;
|
||||
return x.LastHeartbeatTime.AddSeconds(x.HeartbeatInterval) >= now;
|
||||
})
|
||||
.Select(x => new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user