diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs index 0367196b..168dae3a 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs @@ -34,7 +34,9 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService, { var data = new TrackPullConfigDto(); - Expression> exp = x => id.HasValue ? x.Id == id : x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId; + Expression> exp = x => + (!id.HasValue || x.Id == id) && (id.HasValue || (x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId)); + var trackPullConfigEntity = await _trackPullConfigRepository.GetFirstAsync(exp); if (trackPullConfigEntity == null) return data;