diff --git a/src/SJZY.Track.Application/EventHandlers/TrackDeleteEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/TrackDeleteEventHandler.cs index 46b87f8b..bd85a916 100644 --- a/src/SJZY.Track.Application/EventHandlers/TrackDeleteEventHandler.cs +++ b/src/SJZY.Track.Application/EventHandlers/TrackDeleteEventHandler.cs @@ -109,13 +109,14 @@ public class TrackDeleteEventHandler : ITransientDependency, ICapSubscribe // 删除全部轨迹导致的重置行为 if (track == default) { - if (order.LatestTrackTime == null) return; + if (order.LatestTrackTime == null) continue; // tips:订单是支持从已完成态到未完成态的 order.ResetTrackInfo(); } else { + if (order.LatestTrackContent == track.TrackContent) continue; // 删除引发的回退更新 order.LatestTrackContent = track.TrackContent; order.LatestTrackEnContent = track.TrackEnContent; diff --git a/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs index af29d3fd..be3e4d85 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackDetailsRepository.cs @@ -236,17 +236,16 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract trackCodes) { var r = await Context.DeleteByQueryAsync(x => x - .Conflicts(Conflicts.Abort) + .Conflicts(Conflicts.Proceed) .Query( q => q.Terms(t => t.Field(f => f.OrderId).Terms(orderIds)) && q.Term(t => t.IsCanDelete, true) && q.Terms(t => t.Field(f => f.TrackCode.Suffix("keyword")).Terms(trackCodes))) - .WaitForCompletion() ); if (!r.IsValid) - throw new Exception($"轨迹数据删除失败,原因:{r.DebugInformation}"); + throw new Exception($"轨迹数据删除失败,原因:{r.ServerError.Error}"); } public async Task<(List list, long total)> GetListAsync(TrackDetailsQueryInput input)