fix 轨迹删除by查询,code未加关键字
This commit is contained in:
parent
362ea52f2e
commit
0bfc8708be
@ -44,7 +44,7 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
|
|
||||||
if (!r.IsValid)
|
if (!r.IsValid)
|
||||||
{
|
{
|
||||||
LogHelper.Error($"轨迹数据新增失败,原因:{r.DebugInformation}。");
|
LogHelper.Error($"轨迹新增失败,原因:{r.DebugInformation}。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -57,7 +57,7 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
|
|
||||||
if (!r.IsValid)
|
if (!r.IsValid)
|
||||||
{
|
{
|
||||||
LogHelper.Error($"轨迹数据更新失败,原因:{r.DebugInformation}。");
|
LogHelper.Error($"轨迹更新失败,原因:{r.DebugInformation}。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,14 +108,17 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
|
|
||||||
public async Task DeleteTrackAsync(int orderId, List<string> trackCodes)
|
public async Task DeleteTrackAsync(int orderId, List<string> trackCodes)
|
||||||
{
|
{
|
||||||
await Context.UpdateByQueryAsync<TrackDetailsIndex>(x => x
|
var r = await Context.UpdateByQueryAsync<TrackDetailsIndex>(x => x
|
||||||
.Query(
|
.Query(
|
||||||
q =>
|
q =>
|
||||||
q.Term(t => t.OrderId, orderId)
|
q.Term(t => t.OrderId, orderId)
|
||||||
&& q.Terms(t => t.Field(f => f.TrackCode).Terms(trackCodes)))
|
&& q.Terms(t => t.Field(f => f.TrackCode.Suffix("keyword")).Terms(trackCodes)))
|
||||||
.Script(s => s
|
.Script(s => s
|
||||||
.Source("ctx._source.isDeleted = true"))
|
.Source("ctx._source.isDeleted = true"))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!r.IsValid)
|
||||||
|
throw new Exception($"轨迹数据删除失败,原因:{r.DebugInformation}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
public async Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user