From 60c2b221eaa2975064811b0c412663a4a5fee538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Fri, 1 Mar 2024 14:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=A8=E8=BF=B9=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Events/TrackUpsertEvent.cs | 6 ++++++ .../Services/ProvideServices/TrackService.cs | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs diff --git a/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs new file mode 100644 index 00000000..48784974 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Events/TrackUpsertEvent.cs @@ -0,0 +1,6 @@ +namespace SJZY.Track.Application.Contract.Events; + +public class TrackUpsertEvent +{ + public int OrderId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index 0210a0ac..fad211a8 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -81,7 +81,12 @@ public class TrackService : ApplicationService } // 根据订单关联关系向下刷,不同子系统还需要做内容映射 - var links = await _orderRepository.GetLinkedOrderIdsAsync(orderId); + var linkedOrderIds = await _orderRepository.GetLinkedOrderIdsAsync(orderId); + + if (linkedOrderIds.Count > 0) + { + await _capPublisher.PublishAsync(TrackCustomer.CapSubscribe, new TrackUpsertEvent { }); + } // 推送 return true;