This commit is contained in:
李鹏军 2024-05-09 12:01:02 +08:00
parent 5cda1270fb
commit 761446c069
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
public interface ITrackDetailsRepository
{
Task<List<TrackDetailsIndex>> GetListAsync(int[] orderIds, string trackCode, bool onlyIndexName = false);
Task<List<TrackDetailsIndex>> GetListAsync(int[] orderIds, string trackCode, bool forUpsert = false);
Task<List<TrackDetailsIndex>> GetLatestListAsync(int[] eventOrderIds, List<string> trackCodes);

View File

@ -52,6 +52,7 @@ public class ProvideQueries : ISugarRepository, IProvideQueries,
public async Task<List<MatchTrackContentDto>> MatchTrackContentAsync(int[] orderIds, string code)
{
if (orderIds.Length == 0) return new List<MatchTrackContentDto>();
return await Context.Queryable<OrderTemplateEntity>()
.LeftJoin<TrackTemplateContentEntity>((x, a) => x.TrackTemplateId == a.TrackTemplateId)
.LeftJoin<TrackContentEntity>((x, a, b) => a.TrackContentId == b.Id)

View File

@ -14,9 +14,9 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
}
public async Task<List<TrackDetailsIndex>> GetListAsync(int[] orderIds, string trackCode,
bool onlyIndexName = false)
bool forUpsert = false)
{
var r = !onlyIndexName
var r = !forUpsert
? await Context.SearchAsync<TrackDetailsIndex>(s => s
.Source()
.Size(1000)
@ -31,7 +31,8 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
)
: await Context.SearchAsync<TrackDetailsIndex>(s => s
.Source(s2 => s2.Includes(fd => fd
.Field(f => f.IndexName)))
.Field(f => f.IndexName)
.Field(f => f.OrderId)))
.Size(1000)
.Query(q => q
.Bool(b => b