feat: IsTriggerPull 多次刷轨迹被置为null

This commit is contained in:
钟喜旺 2024-08-06 11:35:52 +08:00
parent a3e395a272
commit 1805cc5b76

View File

@ -12,13 +12,14 @@ namespace SJZY.Track.Application.CAP.EventHandlers;
public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICapSubscribe public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICapSubscribe
{ {
private readonly IOrderRepository _orderRepository;
private readonly IForewarningNotifyService _forewarningNotifyService; private readonly IForewarningNotifyService _forewarningNotifyService;
private readonly ITrackPullCacheService _trackPullCacheService; private readonly IOrderRepository _orderRepository;
private readonly IProvideQueries _provideQueries; private readonly IProvideQueries _provideQueries;
private readonly ITrackPullCacheService _trackPullCacheService;
public TrackChangeAfterUpdateOrderEventHandler(IOrderRepository orderRepository, public TrackChangeAfterUpdateOrderEventHandler(IOrderRepository orderRepository,
IForewarningNotifyService forewarningNotifyService, ITrackPullCacheService trackPullCacheService, IProvideQueries provideQueries) IForewarningNotifyService forewarningNotifyService, ITrackPullCacheService trackPullCacheService,
IProvideQueries provideQueries)
{ {
_orderRepository = orderRepository; _orderRepository = orderRepository;
_forewarningNotifyService = forewarningNotifyService; _forewarningNotifyService = forewarningNotifyService;
@ -60,9 +61,12 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
if (!string.IsNullOrEmpty(@event.TrackCode) && providerDic.TryGetValue(order.Id, out var provider)) if (!string.IsNullOrEmpty(@event.TrackCode) && providerDic.TryGetValue(order.Id, out var provider))
{ {
var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(provider.SubSystemId, provider.ServiceProviderId); var config =
await _trackPullCacheService.GetPullParamWithContentConfigAsync(provider.SubSystemId,
provider.ServiceProviderId);
if (!string.IsNullOrEmpty(config?.ParamConfig.TrackContentCode) && config.ParamConfig.TrackContentCode!.ToLower() == @event.TrackCode.ToLower()) if (!string.IsNullOrEmpty(config?.ParamConfig.TrackContentCode) &&
config.ParamConfig.TrackContentCode!.ToLower() == @event.TrackCode.ToLower())
{ {
// 触发拉取节点 // 触发拉取节点
order.IsTriggerPull = 1; order.IsTriggerPull = 1;
@ -110,7 +114,8 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
ArrivalPostCode = order.ArrivalPostCode, ArrivalPostCode = order.ArrivalPostCode,
IsTransit = order.IsTransit, IsTransit = order.IsTransit,
LeavePort = order.LeavePort, LeavePort = order.LeavePort,
ProductCode = order.ProductCode ProductCode = order.ProductCode,
IsTriggerPull = order.IsTriggerPull
}); });
} }