Merge remote-tracking branch 'origin/S03-轨迹中台优化项' into test

This commit is contained in:
dingenwen 2024-05-09 14:26:59 +08:00
commit 8dc31a93e5
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
public interface ITrackDetailsRepository 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); 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) public async Task<List<MatchTrackContentDto>> MatchTrackContentAsync(int[] orderIds, string code)
{ {
if (orderIds.Length == 0) return new List<MatchTrackContentDto>();
return await Context.Queryable<OrderTemplateEntity>() return await Context.Queryable<OrderTemplateEntity>()
.LeftJoin<TrackTemplateContentEntity>((x, a) => x.TrackTemplateId == a.TrackTemplateId) .LeftJoin<TrackTemplateContentEntity>((x, a) => x.TrackTemplateId == a.TrackTemplateId)
.LeftJoin<TrackContentEntity>((x, a, b) => a.TrackContentId == b.Id) .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, 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 ? await Context.SearchAsync<TrackDetailsIndex>(s => s
.Source() .Source()
.Size(1000) .Size(1000)
@ -31,7 +31,8 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
) )
: await Context.SearchAsync<TrackDetailsIndex>(s => s : await Context.SearchAsync<TrackDetailsIndex>(s => s
.Source(s2 => s2.Includes(fd => fd .Source(s2 => s2.Includes(fd => fd
.Field(f => f.IndexName))) .Field(f => f.IndexName)
.Field(f => f.OrderId)))
.Size(1000) .Size(1000)
.Query(q => q .Query(q => q
.Bool(b => b .Bool(b => b