fix:轨迹删除引发的主表维护不完整
This commit is contained in:
parent
4cb5f465da
commit
c6e99193c3
@ -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;
|
||||
|
||||
@ -236,17 +236,16 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
||||
public async Task DeleteTrackAsync(int[] orderIds, List<string> trackCodes)
|
||||
{
|
||||
var r = await Context.DeleteByQueryAsync<TrackDetailsIndex>(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<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user