diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs index 9fd4cd56..f404b238 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs @@ -86,10 +86,10 @@ public class TrackPullService : ApplicationService } var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId); + var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode; foreach (var group in orders.GroupBy(x => - new TrackRefreshAttach(x.ServiceProviderId, x.ServiceProviderCode, x.SubSystemId, - x.OrderType))) + new { x.SubSystemId, x.OrderType })) { var data = group.Select(x => new { @@ -98,8 +98,10 @@ public class TrackPullService : ApplicationService // 批量获取轨迹 await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( - InterfaceRelayConst.GetTrackInterfaceCode, group.Key.ServiceProviderCode, data, - GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key)); + InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data, + GlobalConst.TrackRefreshSubscribe, + JsonConvert.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId, serviceProviderCode!, + group.Key.SubSystemId, group.Key.OrderType))); } await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);