feat 处理已知禅道

This commit is contained in:
2025-01-03 17:39:32 +08:00
parent fddf77858e
commit a915492d27
8 changed files with 100 additions and 24 deletions

View File

@@ -153,8 +153,10 @@ public class DeviceUploadLogService : IDeviceUploadLogService
/// <inheritdoc />
public async Task ManuallySetTimeInfoAsync(string deviceNo, DateTime start, DateTime end)
{
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.UniqueNo == deviceNo).SingleAsync();
(device.Type != DeviceTypeEnumType.Attendance && device.Type != DeviceTypeEnumType.Door).ThrowIfTrue("不支持该设备类型");
var exists = await _dbContext.Queryable<DeviceUploadLogManuallyEntity>().Where(x => x.DeviceNo == deviceNo).Where(x => x.IsFinished == false).AnyAsync();
exists.ThrowIfTrue("已存在时间配置尚未完成");
exists.ThrowIfTrue("已存在配置尚未完成");
await _dbContext.InsertAsync(new DeviceUploadLogManuallyEntity
{