diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackPullCacheService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackPullCacheService.cs index 486d4157..e98a6be8 100644 --- a/src/SJZY.Track.Application.Contract/Services/ITrackPullCacheService.cs +++ b/src/SJZY.Track.Application.Contract/Services/ITrackPullCacheService.cs @@ -19,7 +19,8 @@ public interface ITrackPullCacheService /// 子系统id /// 服务商id /// - Task GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId); + Task + GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId); /// /// 设置拉取配置缓存 @@ -28,6 +29,6 @@ public interface ITrackPullCacheService /// 子系统id /// 服务商id /// - Task SetPullConfigAsync(int? id = null, int? subSystemId = null, + Task SetPullConfigAsync(int? id = null, int? subSystemId = null, int? serviceProviderId = null); } \ No newline at end of file diff --git a/src/SJZY.Track.Application/EventHandlers/TrackRefreshEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/TrackRefreshEventHandler.cs index df86b766..2e85c484 100644 --- a/src/SJZY.Track.Application/EventHandlers/TrackRefreshEventHandler.cs +++ b/src/SJZY.Track.Application/EventHandlers/TrackRefreshEventHandler.cs @@ -35,10 +35,11 @@ public class TrackRefreshEventHandler : ITransientDependency, ICapSubscribe { var attach = Base64Helper.DeSerialize(@event.Attach); if (attach is null) return; + var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(attach.SubSystemId, attach.ServiceProviderId); + if (@event.Data == null || config == null) return; - if (@event.Data == null) return; var data = JObject.Parse(@event.Data); var orderToken = data[config.ParamConfig.OrderPath]; if (orderToken is JArray orderTokens) diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs index c5c7f8fd..396ce403 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs @@ -35,7 +35,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService } [NonAction] - public async Task GetPullParamWithContentConfigAsync(int subSystemId, + public async Task GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId) { var data = await RedisHelper.Client.GetAsync(TrackPullContentKey( @@ -48,7 +48,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService } [NonAction] - public async Task SetPullConfigAsync(int? id = null, int? subSystemId = null, + public async Task SetPullConfigAsync(int? id = null, int? subSystemId = null, int? serviceProviderId = null) { var data = new TrackPullParamWithContentConfigDto(); @@ -62,7 +62,6 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService if (trackPullConfigEntity == null) return data; var trackPullConfigDetail = await _trackPullConfigRepository.GetDetailAsync(trackPullConfigEntity.Id); - if (trackPullConfigDetail is null) return data; var trackPullContentList = await _trackPullConfigRepository.GetContentListCacheAsync(trackPullConfigEntity.Id); if (trackPullContentList.Count == 0) return data;