From 2c6d730c4bc5ea46926dac1cb529e357f21a5f67 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:25:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=8B=89=E5=8F=96=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=BA=94=E8=AF=A5=E8=BF=94?= =?UTF-8?q?=E5=9B=9Enull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPull/TrackPullCacheService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs index 396ce403..76ae531c 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs @@ -51,19 +51,19 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService public async Task SetPullConfigAsync(int? id = null, int? subSystemId = null, int? serviceProviderId = null) { - var data = new TrackPullParamWithContentConfigDto(); - Expression> exp = x => true; if (id.HasValue) exp = x => x.Id == id; else if (subSystemId.HasValue && serviceProviderId.HasValue) exp = x => x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId; var trackPullConfigEntity = await _trackPullConfigRepository.GetFirstAsync(exp); - if (trackPullConfigEntity == null) return data; + if (trackPullConfigEntity == null) return null; var trackPullConfigDetail = await _trackPullConfigRepository.GetDetailAsync(trackPullConfigEntity.Id); var trackPullContentList = await _trackPullConfigRepository.GetContentListCacheAsync(trackPullConfigEntity.Id); - if (trackPullContentList.Count == 0) return data; + if (trackPullContentList.Count == 0) return null; + + var data = new TrackPullParamWithContentConfigDto(); data.ParamConfig = ObjectMapper.Map(trackPullConfigDetail);