From c8b3b99633925c9f26331915cf1d13ce4e73dfa7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com>
Date: Thu, 28 Mar 2024 11:08:23 +0800
Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=BD=A8=E8=BF=B9=E5=88=B7?=
=?UTF-8?q?=E6=96=B0=E6=B2=A1=E6=9C=89=E6=8B=89=E5=8F=96=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E7=9A=84case?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Services/ITrackPullCacheService.cs | 5 +++--
.../EventHandlers/TrackRefreshEventHandler.cs | 3 ++-
.../Services/TrackPull/TrackPullCacheService.cs | 5 ++---
3 files changed, 7 insertions(+), 6 deletions(-)
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;