diff --git a/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs b/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs index 3a00b25e..485c4296 100644 --- a/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs +++ b/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs @@ -68,27 +68,26 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler().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 }) - ); } }