fix 判断逻辑取反
This commit is contained in:
@@ -68,27 +68,26 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler<CancelDuplicati
|
||||
//最新一条删除人员信息
|
||||
else if (item.Type == DeviceTaskEnumType.Delete && item.Status == DeviceTaskStatusEnumType.Wait)
|
||||
{
|
||||
//判断是否成功
|
||||
//存在成功下发的任务,此处可以直接把其他任务取消
|
||||
if (await db.Queryable<DeviceTaskEntity>().Where(x => x.UserNo == item.UserNo)
|
||||
.Where(x => x.DeviceUniqueNo == item.DeviceUniqueNo)
|
||||
.Where(x => x.TenantId == item.TenantId).Where(x => x.Status == DeviceTaskStatusEnumType.Success).AnyAsync())
|
||||
{
|
||||
ignoreData.AddRange(data.Where(x => x.Type == DeviceTaskEnumType.Add
|
||||
|| x.Type == DeviceTaskEnumType.Delete
|
||||
|| x.Type == DeviceTaskEnumType.Update)
|
||||
.Where(x => x.Status == DeviceTaskStatusEnumType.Wait)
|
||||
.Where(x => x.Id != item.Id)
|
||||
.Select(x => new IdVersion { Id = x.Id, Version = x.Version })
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var beforeTask = data.Where(x => x.Type == DeviceTaskEnumType.Add || x.Type == DeviceTaskEnumType.Update)
|
||||
.Select(x => new IdVersion { Id = x.Id, Version = x.Version })
|
||||
.FirstOrDefault(x => x.Id != item.Id);
|
||||
|
||||
if (beforeTask != null) ignoreData.Add(beforeTask);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ignoreData.AddRange(data.Where(x => x.Type == DeviceTaskEnumType.Add
|
||||
|| x.Type == DeviceTaskEnumType.Delete
|
||||
|| x.Type == DeviceTaskEnumType.Update)
|
||||
.Where(x => x.Status == DeviceTaskStatusEnumType.Wait)
|
||||
.Where(x => x.Id != item.Id)
|
||||
.Select(x => new IdVersion { Id = x.Id, Version = x.Version })
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user