feat: IsTriggerPull 多次刷轨迹被置为null
This commit is contained in:
parent
a3e395a272
commit
1805cc5b76
@ -12,13 +12,14 @@ namespace SJZY.Track.Application.CAP.EventHandlers;
|
||||
|
||||
public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICapSubscribe
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly IForewarningNotifyService _forewarningNotifyService;
|
||||
private readonly ITrackPullCacheService _trackPullCacheService;
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly IProvideQueries _provideQueries;
|
||||
|
||||
private readonly ITrackPullCacheService _trackPullCacheService;
|
||||
|
||||
public TrackChangeAfterUpdateOrderEventHandler(IOrderRepository orderRepository,
|
||||
IForewarningNotifyService forewarningNotifyService, ITrackPullCacheService trackPullCacheService, IProvideQueries provideQueries)
|
||||
IForewarningNotifyService forewarningNotifyService, ITrackPullCacheService trackPullCacheService,
|
||||
IProvideQueries provideQueries)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
_forewarningNotifyService = forewarningNotifyService;
|
||||
@ -34,7 +35,7 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
if (orders.Count == 0) return;
|
||||
|
||||
var updateOrders = new List<OrderEntity>();
|
||||
var providerDic= await GetProviderDic(@event.OrderIds);
|
||||
var providerDic = await GetProviderDic(@event.OrderIds);
|
||||
foreach (var order in orders)
|
||||
{
|
||||
if (order.LatestTrackContent != @event.TrackContent)
|
||||
@ -48,11 +49,11 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
}
|
||||
|
||||
// 执行轨迹兜底时 时区缺失和发生地缺失标记,1表示时区,2表示发生地,3表示两种
|
||||
if (@event.DeficiencyTagValue > 0 && @event.DeficiencyTagValue<=3)
|
||||
if (@event.DeficiencyTagValue > 0 && @event.DeficiencyTagValue <= 3)
|
||||
{
|
||||
order.DeficiencyTag = @event.DeficiencyTagValue;
|
||||
}
|
||||
|
||||
|
||||
if (!order.IsCompleted)
|
||||
{
|
||||
order.IsCompleted = @event.IsCompleted;
|
||||
@ -60,15 +61,18 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
|
||||
if (!string.IsNullOrEmpty(@event.TrackCode) && providerDic.TryGetValue(order.Id, out var provider))
|
||||
{
|
||||
var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(provider.SubSystemId, provider.ServiceProviderId);
|
||||
|
||||
if (!string.IsNullOrEmpty(config?.ParamConfig.TrackContentCode) && config.ParamConfig.TrackContentCode!.ToLower() == @event.TrackCode.ToLower())
|
||||
var config =
|
||||
await _trackPullCacheService.GetPullParamWithContentConfigAsync(provider.SubSystemId,
|
||||
provider.ServiceProviderId);
|
||||
|
||||
if (!string.IsNullOrEmpty(config?.ParamConfig.TrackContentCode) &&
|
||||
config.ParamConfig.TrackContentCode!.ToLower() == @event.TrackCode.ToLower())
|
||||
{
|
||||
// 触发拉取节点
|
||||
order.IsTriggerPull = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
order.LatestTrackContent = @event.TrackContent;
|
||||
order.LatestTrackEnContent = @event.TrackEnContent;
|
||||
order.LatestTrackPlace = @event.TrackPlace;
|
||||
@ -80,7 +84,7 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
await _orderRepository.UpdateRangeAsync(updateOrders, x => new
|
||||
{
|
||||
x.IsCompleted, x.LatestTrackContent, x.LatestTrackEnContent, x.LatestTrackPlace, x.LatestTrackTime,
|
||||
x.LatestTrackTimeZone,x.IsTriggerPull,x.DeficiencyTag
|
||||
x.LatestTrackTimeZone, x.IsTriggerPull, x.DeficiencyTag
|
||||
});
|
||||
|
||||
// 预警计算
|
||||
@ -110,7 +114,8 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
ArrivalPostCode = order.ArrivalPostCode,
|
||||
IsTransit = order.IsTransit,
|
||||
LeavePort = order.LeavePort,
|
||||
ProductCode = order.ProductCode
|
||||
ProductCode = order.ProductCode,
|
||||
IsTriggerPull = order.IsTriggerPull
|
||||
});
|
||||
}
|
||||
|
||||
@ -139,7 +144,7 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取服务商字典
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user