From c6e99193c3590a7837022077de57329306f38011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Thu, 25 Apr 2024 17:00:27 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=BD=A8=E8=BF=B9=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=BC=95=E5=8F=91=E7=9A=84=E4=B8=BB=E8=A1=A8=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventHandlers/TrackDeleteEventHandler.cs | 3 ++- .../Repositories/TrackDetailsRepository.cs | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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)