fix 轨迹刷新定时任务bug

This commit is contained in:
李鹏军 2024-03-26 09:37:19 +08:00
parent c053a83a27
commit e5e3b2ecce

View File

@ -86,10 +86,10 @@ public class TrackPullService : ApplicationService
} }
var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId); var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId);
var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode;
foreach (var group in orders.GroupBy(x => foreach (var group in orders.GroupBy(x =>
new TrackRefreshAttach(x.ServiceProviderId, x.ServiceProviderCode, x.SubSystemId, new { x.SubSystemId, x.OrderType }))
x.OrderType)))
{ {
var data = group.Select(x => new var data = group.Select(x => new
{ {
@ -98,8 +98,10 @@ public class TrackPullService : ApplicationService
// 批量获取轨迹 // 批量获取轨迹
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
InterfaceRelayConst.GetTrackInterfaceCode, group.Key.ServiceProviderCode, data, InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data,
GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key)); 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); await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count);