diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs index 420c44e6..f54f366a 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs @@ -34,8 +34,10 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService, { var data = new TrackPullConfigDto(); - Expression> exp = x => - (id == null || x.Id == id) && (id != null || (x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId)); + 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;