轨迹明细使用订单id查询
This commit is contained in:
parent
adae3501fa
commit
6580831a4a
@ -13,4 +13,5 @@ public interface ITrackDetailsRepository
|
||||
Task<List<TrackDetailsIndex>> GetListAsync(int orderType, List<string> orderNos);
|
||||
|
||||
Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input);
|
||||
Task<List<TrackDetailsIndex>> GetListAsync(int orderId);
|
||||
}
|
||||
@ -37,7 +37,7 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
||||
var response = await Context.UpdateAsync<TrackDetailsIndex>(index.Id, u => u
|
||||
.Index(IndexName)
|
||||
.Doc(index)
|
||||
//.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见
|
||||
//.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见
|
||||
);
|
||||
if (!response.IsValid)
|
||||
throw new Exception($"数据修改失败,原因:{response.DebugInformation}");
|
||||
@ -73,6 +73,21 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
||||
return data.Documents.ToList();
|
||||
}
|
||||
|
||||
public async Task<List<TrackDetailsIndex>> GetListAsync(int orderId)
|
||||
{
|
||||
var data = await Context.SearchAsync<TrackDetailsIndex>(x => x
|
||||
.Source(s => s.Includes(fd => fd
|
||||
.Field(f => f.TrackStatus)
|
||||
.Field(f => f.TrackCode)
|
||||
.Field(f => f.TrackContent)
|
||||
.Field(f => f.TrackPlace)
|
||||
.Field(f => f.TrackTime)
|
||||
.Field(f => f.TraceTimeZone)
|
||||
)).Query(q => q.Terms(t => t.Field(f => f.OrderId).Terms(orderId))));
|
||||
|
||||
return data?.Documents?.ToList();
|
||||
}
|
||||
|
||||
public async Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
||||
{
|
||||
if (input.OrderNos.Count < 1) return default;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user