review
This commit is contained in:
parent
7d8e8c584a
commit
74c66fff3f
@ -2,6 +2,7 @@ using System.Text.Json;
|
||||
using DotNetCore.CAP;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.OTel;
|
||||
@ -388,6 +389,12 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
return string.IsNullOrWhiteSpace(json) ? default : System.Text.Json.JsonSerializer.Deserialize<T>(json);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* review by xiaolipro at 2024-12-24
|
||||
* todo:无用的方法,可以删除 @王云龙
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// 获取来源系统接口的参数名
|
||||
/// </summary>
|
||||
@ -427,6 +434,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
if (string.IsNullOrWhiteSpace(trackExtraJson)) return;
|
||||
|
||||
dict.TryAdd("extra",JObject.FromObject(trackExtraJson));
|
||||
var trackExtra = ExtractTrackExtraDict(trackExtraJson);
|
||||
|
||||
if (trackExtra.Count == 0) return;
|
||||
|
||||
@ -49,6 +49,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
var content = await HandleTrackAsync(@event, canNextOrderIds);
|
||||
|
||||
// todo: 广播提取到一个服务里去,异步处理,不影响主流程
|
||||
// 处理广播事件
|
||||
PublicTrackTopic(@event, content);
|
||||
|
||||
@ -247,6 +248,8 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||
EstimatedDeliveryDate = @event.EstimatedDeliveryDate
|
||||
});
|
||||
|
||||
|
||||
// todo:推送是否广播传入
|
||||
// 触发轨迹推送事件(异步)
|
||||
var trackPushEvent = new TrackPushEvent
|
||||
{
|
||||
|
||||
@ -82,6 +82,7 @@ public class TrackPushCompletedEventHandler : ITransientDependency, IRabbitHandl
|
||||
log.Message = @event.Message;
|
||||
log.RequestId = @event.RequestId;
|
||||
|
||||
// todo:这里不需要查es,log里面有
|
||||
//查出推送轨迹,写入推送广播
|
||||
var tracks = await _trackDetailsEsRepository
|
||||
.GetListAsync(new[] { log.OrderId }, new List<string>
|
||||
@ -145,6 +146,8 @@ public class TrackPushCompletedEventHandler : ITransientDependency, IRabbitHandl
|
||||
/// </summary>
|
||||
private async Task PublicTrackPushTopicAsync(TrackDetailsIndex track, TrackPushRecordIndex pushRecord, bool isFailure = false, string? errorMsg = null)
|
||||
{
|
||||
// view by xiaolipro at 2024-12-24
|
||||
// todo:热路径下进行数据库查询影响性能,建议减少或缓存,或异步处理@王云龙
|
||||
var statusList = await _trackStatusRepository.GetListAsync(m => m.SubSystemId == track.SubSystemId);
|
||||
if (statusList == null)
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user