Merge remote-tracking branch 'origin/S03-轨迹中台优化项' into test
This commit is contained in:
commit
b96191241d
@ -234,8 +234,8 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
|
|
||||||
public async Task DeleteTrackAsync(int[] orderIds, List<string> trackCodes)
|
public async Task DeleteTrackAsync(int[] orderIds, List<string> trackCodes)
|
||||||
{
|
{
|
||||||
var search = await Context.SearchAsync<TrackDetailsIndex>(s => s
|
var search = await Context.SearchAsync<TrackDetailsIndex>(x => x
|
||||||
.Source(fd => fd.Includes(f => f.Field("indexName")))
|
.Source(s => s.Includes(fd => fd.Field(f => f.IndexName)))
|
||||||
.Size(1000)
|
.Size(1000)
|
||||||
.Query(q => q
|
.Query(q => q
|
||||||
.Bool(b => b
|
.Bool(b => b
|
||||||
@ -245,13 +245,13 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.Scroll("1m") // 设置滚动时间
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!search.IsValid)
|
||||||
while (search.IsValid && search.Documents.Any())
|
|
||||||
{
|
{
|
||||||
// 处理滚动查询结果
|
throw new Exception($"轨迹查询异常,原因:{search.DebugInformation}。");
|
||||||
|
}
|
||||||
|
|
||||||
var tracks = search.ToIdList();
|
var tracks = search.ToIdList();
|
||||||
|
|
||||||
foreach (var track in tracks)
|
foreach (var track in tracks)
|
||||||
@ -263,17 +263,6 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
if (!r.IsValid)
|
if (!r.IsValid)
|
||||||
throw new Exception($"轨迹数据删除失败,原因:{r.ServerError.Error}");
|
throw new Exception($"轨迹数据删除失败,原因:{r.ServerError.Error}");
|
||||||
}
|
}
|
||||||
|
|
||||||
var scrollId = search.ScrollId; // 更新滚动ID
|
|
||||||
|
|
||||||
// 滚动查询
|
|
||||||
search = await Context.ScrollAsync<TrackDetailsIndex>("1m", scrollId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!search.IsValid)
|
|
||||||
{
|
|
||||||
throw new Exception($"轨迹查询异常,原因:{search.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