fix id返回,仅判断meal设,移除心跳间隔30秒判断

This commit is contained in:
2024-06-17 10:32:57 +08:00
parent 909d310620
commit a9d9427da6
3 changed files with 14 additions and 8 deletions

View File

@@ -83,9 +83,9 @@ public class DeviceSaveRequest : IValidatableObject
yield return new ValidationResult($"{DeviceTypeEnumType.Door.GetDescription()}才可设置作为考勤设备", new[] { nameof(AsAttendance) }); yield return new ValidationResult($"{DeviceTypeEnumType.Door.GetDescription()}才可设置作为考勤设备", new[] { nameof(AsAttendance) });
} }
if (HeartbeatInterval != 0 && HeartbeatInterval < 30) if (HeartbeatInterval < 0)
{ {
yield return new ValidationResult("心跳间隔需要设置>=30秒", new[] { nameof(HeartbeatInterval) }); yield return new ValidationResult("心跳间隔不可小于0", new[] { nameof(HeartbeatInterval) });
} }
} }
} }

View File

@@ -126,10 +126,14 @@ public class DeviceService : IDeviceService
var item = request[i]; var item = request[i];
await SaveAsync(item); await SaveAsync(item);
var registry = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => x.DeviceUniqueNo == item.UniqueNo).FirstAsync(); if (item.Type == DeviceTypeEnumType.Meal)
businessPlaces.Any(x => x.Code == item.BusinessPlaceCode).ThrowIfFalse("营业点不存在"); {
registry.BusinessPlaceCode = item.BusinessPlaceCode;
await _dbContext.UpdateAsync(registry); var registry = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => x.DeviceUniqueNo == item.UniqueNo).FirstAsync();
businessPlaces.Any(x => x.Code == item.BusinessPlaceCode).ThrowIfFalse("营业点不存在");
registry.BusinessPlaceCode = item.BusinessPlaceCode;
await _dbContext.UpdateAsync(registry);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -269,7 +273,7 @@ public class DeviceService : IDeviceService
_dbContext.Client.QueryFilter.Restore(); _dbContext.Client.QueryFilter.Restore();
} }
} }
public async Task<List<DeviceResponse>> GetAttendanceDevicesAsync() public async Task<List<DeviceResponse>> GetAttendanceDevicesAsync()
{ {

View File

@@ -7,6 +7,8 @@ namespace Dlhis.Basic.Organization.Response;
public class GainfoPageResponse public class GainfoPageResponse
{ {
public long Id { get; set; }
public string No { get; set; } public string No { get; set; }
/// <summary> /// <summary>