Merge branch 'S02-轨迹中台第二部分' into test
This commit is contained in:
commit
96dfa9e136
@ -22,6 +22,11 @@ public class TrackDeleteEvent
|
||||
/// </summary>
|
||||
public int UpSubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
/// </summary>
|
||||
public string? OperationMan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已经处理过的订单
|
||||
/// </summary>
|
||||
|
||||
@ -3,6 +3,7 @@ using DotNetCore.CAP.Filter;
|
||||
using SJZY.Expand.ABP.Core;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Domain.Consts;
|
||||
|
||||
namespace SJZY.Track.Application.EventHandlers;
|
||||
|
||||
@ -17,6 +18,8 @@ public class CAPFilter : SubscribeFilter
|
||||
/// <returns></returns>
|
||||
public override Task OnSubscribeExecutingAsync(ExecutingContext context)
|
||||
{
|
||||
if (context.DeliverMessage.Headers["cap-msg-name"] == GlobalConst.TrackRefreshSubscribe)
|
||||
return Task.CompletedTask;
|
||||
var argumentJsonStr = context.Arguments.ToJson();
|
||||
|
||||
context.DeliverMessage.Headers["sjzy-receive-time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff");
|
||||
|
||||
@ -37,6 +37,7 @@ public class TrackRefreshEventHandler : ITransientDependency, ICapSubscribe
|
||||
var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(attach.SubSystemId,
|
||||
attach.ServiceProviderId);
|
||||
|
||||
if (@event.Data == null) return;
|
||||
var data = JObject.Parse(@event.Data.ToString()!);
|
||||
var orderToken = data[config.ParamConfig.OrderPath];
|
||||
if (orderToken is JArray orderTokens)
|
||||
|
||||
@ -80,7 +80,7 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
var orders = await _orderRepository.GetListAsync(x =>
|
||||
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo), x => new
|
||||
{
|
||||
x.Id, x.OrderNo, x.SubSystemId, x.LatestPushTrackContentId, x.CustomId
|
||||
x.Id, x.OrderNo, x.SubSystemId, x.LatestPushTrackContentId, x.CustomId, x.IsCompleted
|
||||
});
|
||||
|
||||
foreach (var order in orders)
|
||||
@ -98,7 +98,9 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
OrderId = order.Id,
|
||||
SubSystemId = order.SubSystemId,
|
||||
LatestPushTrackContentId = order.LatestPushTrackContentId,
|
||||
CustomId = order.CustomId
|
||||
CustomId = order.CustomId,
|
||||
IsCompleted = order.IsCompleted,
|
||||
OperationMan = CurrentUserRequest.CurrentUser.Name
|
||||
};
|
||||
await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, @event);
|
||||
}
|
||||
@ -138,6 +140,7 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
OrderId = order.Id,
|
||||
TrackCodes = codes.Select(x => x.TrackCode).ToList(),
|
||||
SubSystemId = order.SubSystemId,
|
||||
OperationMan = CurrentUserRequest.CurrentUser.Name
|
||||
};
|
||||
await _capPublisher.PublishAsync(GlobalConst.TrackDeleteSubscribe, @event);
|
||||
|
||||
@ -177,6 +180,7 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
OrderId = group.Key,
|
||||
TrackCodes = codes.Select(x => x.TrackCode).ToList(),
|
||||
SubSystemId = orders.First(x => x.Id == group.Key).SubSystemId,
|
||||
OperationMan = CurrentUserRequest.CurrentUser.Name
|
||||
};
|
||||
await _capPublisher.PublishAsync(GlobalConst.TrackDeleteSubscribe, @event);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user