track/src/SJZY.Track.Domain/Aggregates/TrackDetailsAggregate/ITrackDetailsEsRepository.cs

52 lines
2.1 KiB
C#

using SJZY.Expand.ElasticSearch.Services;
using SJZY.Track.Domain.Dtos.TrackDetails;
using SJZY.Track.Domain.Enums;
namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
public interface ITrackDetailsEsRepository : IElasticsearchClientService<TrackDetailsIndex>
{
Task<List<TrackDetailsIndex>> GetListAsync(int[] orderIds, string trackCode, bool forUpsert = false);
// 复杂查询,返回 k:订单id v:轨迹列表
Task<Dictionary<int, List<TrackDetailsIndex>>> GetOrderTracksDictAsync(GetOrderTracksDictVO input);
// 查询订单的每个轨迹状态的最旧/早轨迹,返回 k:订单id v:[k:轨迹状态id,v:最早轨迹]
Task<Dictionary<int, Dictionary<int, TrackDetailsIndex>>> GetTrackStatusEarliestDictAsync(HashSet<int> orderIds);
// 查询订单的最新/晚轨迹,返回 k:订单id v:最早轨迹,按创建时间
Task<Dictionary<int, TrackDetailsIndex>> GetLatestDictAsync(HashSet<int> orderIds);
Task<List<TrackDetailsIndex>> GetLatestListAsync(int[] eventOrderIds, List<string> trackCodes);
Task<List<TrackDetailsIndex>> GetListAsync(int subSystemId, int orderType, List<string> orderNos, List<string>? trackCodes = null);
Task<bool> AnyAsync(int orderId, string originTrackDataHash);
Task UpdateAsync(TrackDetailsIndex index);
Task UpdateManyAsync(List<TrackDetailsIndex> indexes, int maxRetries = 3);
Task BulkUpdateAsync(List<TrackDetailsIndex> indexes, int maxRetries = 3);
Task AddManyAsync(List<TrackDetailsIndex> index);
Task AddAsync(TrackDetailsIndex track);
Task<List<TrackDetailsIndex>> GetListAsync(int orderId);
Task<List<TrackDetailsIndex>> GetListAsync(int[] orderIds, List<string>? trackCodes = null, TrackSourceEnum? source = null);
Task<List<int>> DeleteTrackAsync(int[] orderIds, List<string> trackCodes);
Task DeleteTrackByIdAsync(string id, string indexName);
Task DeleteTrackByIdsAsync(HashSet<string> esIds);
Task<List<TrackDetailsIndex>> GetDataByIds(string[] ids);
Task<TrackDetailsIndex?> GetDetailAsync(string orderNo, string trackCode, int orderType, int subSystemId, DateTime trackTime);
Task MigrateAsync();
}