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);