diff --git a/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs b/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs index 92158487..e19cf28f 100644 --- a/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs +++ b/Src/Dlhis.Basic/Device/EventBusHandler/CancelDuplicationTaskHandler.cs @@ -63,6 +63,7 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler x.Type == DeviceTaskEnumType.Update) .Where(x => x.Status == DeviceTaskStatusEnumType.Wait) .Where(x => x.Id != item.Id) + .Where(x => item.CreateTime > x.CreateTime) .Select(x => new IdVersion { Id = x.Id, Version = x.Version }).ToList(); } //最新一条删除人员信息 @@ -78,6 +79,7 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler x.Status == DeviceTaskStatusEnumType.Wait) .Where(x => x.Id != item.Id) + .Where(x => item.CreateTime > x.CreateTime) .Select(x => new IdVersion { Id = x.Id, Version = x.Version }) ); } @@ -87,6 +89,7 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler x.Type == DeviceTaskEnumType.Add || x.Type == DeviceTaskEnumType.Update) .Where(x => !currentIds.Contains(x.Id)) .Where(x => x.Status == DeviceTaskStatusEnumType.Wait) + .Where(x => item.CreateTime > x.CreateTime) .FirstOrDefault(); //逻辑正确,最终beforeTask.type == DeviceTaskEnumType.Add @@ -98,6 +101,7 @@ public class CancelDuplicationTaskHandler : IAsyncChannelHandler x.Type == DeviceTaskEnumType.Add || x.Type == DeviceTaskEnumType.Update) .Where(x => !currentIds.Contains(x.Id)) .Where(x => x.Status == DeviceTaskStatusEnumType.Wait) + .Where(x => item.CreateTime > x.CreateTime) .FirstOrDefault(); }