From b763e74c123e40a37be18c6f4c55654833bc5e73 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 14 Mar 2024 20:56:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=8F=96=E5=8F=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CancelDuplicationTaskHandler.cs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) 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 }) - ); } }