fix 使用id获取记录

This commit is contained in:
2025-07-05 13:54:11 +08:00
parent 60e43bfb9d
commit e3720d6905

View File

@@ -340,17 +340,6 @@ public class AssignmentService : IAssignmentService
DeviceTaskEnumType.SyncDateTime
};
//排除UploadRecord,SyncDateTime的任务,获取最近的任务ID
var limitData = await _dbContext.Queryable<DeviceTaskEntity>()
.Where(x => x.ModifiedTime >= limitTime)
.Where(x => x.DeviceUniqueNo == deviceUniqueNo)
.Where(x => !types.Contains(x.Type))
.OrderBy(x => x.Id)
.Select(x => new { x.Id })
.FirstAsync();
var startId = limitData?.Id;
//获取其他任务ID
var otherIds = await _dbContext.Queryable<DeviceTaskEntity>()
.Where(x => x.DeviceUniqueNo == deviceUniqueNo)
@@ -359,6 +348,17 @@ public class AssignmentService : IAssignmentService
.Select(x => x.Id)
.ToListAsync();
//排除UploadRecord,SyncDateTime的任务,获取最近的任务ID
var limitData = await _dbContext.Queryable<DeviceTaskEntity>()
.Where(x => x.ModifiedTime >= limitTime)
.Where(x => x.DeviceUniqueNo == deviceUniqueNo)
.Where(x => !otherIds.Contains(x.Id))
.OrderBy(x => x.Id)
.Select(x => new { x.Id })
.FirstAsync();
var startId = limitData?.Id;
return (startId, otherIds);
}