From a9338a4b25f12cd15ee8f6862ed26fe1028b58d7 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Thu, 16 Jul 2026 12:41:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=BD=E6=94=B6=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=B8=8E=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=AB=AF=E6=8C=89=E5=AE=A2=E6=88=B7=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../Dtos/Orders/CustomerSenderAddressDtos.cs | 5 +++++ src/Oms.Application/Dtos/Orders/OrderPaginatedInput.cs | 7 +++++++ .../Services/Orders/OrderService.Pickup.cs | 9 ++++++--- src/Oms.Application/Services/Orders/OrderService.cs | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Oms.Application/Dtos/Orders/CustomerSenderAddressDtos.cs b/src/Oms.Application/Dtos/Orders/CustomerSenderAddressDtos.cs index 8755a37..da181ec 100644 --- a/src/Oms.Application/Dtos/Orders/CustomerSenderAddressDtos.cs +++ b/src/Oms.Application/Dtos/Orders/CustomerSenderAddressDtos.cs @@ -169,6 +169,11 @@ public class CustomerSenderAddressOutput /// public class OrderPickupCreateInput { + /// + /// 客户 ID(管理端代创建必传;客户门户可省略)。 + /// + public int? CustomerId { get; set; } + public string? RequestId { get; set; } public string? ClientNo { get; set; } diff --git a/src/Oms.Application/Dtos/Orders/OrderPaginatedInput.cs b/src/Oms.Application/Dtos/Orders/OrderPaginatedInput.cs index eaf3cf0..90a4787 100644 --- a/src/Oms.Application/Dtos/Orders/OrderPaginatedInput.cs +++ b/src/Oms.Application/Dtos/Orders/OrderPaginatedInput.cs @@ -38,6 +38,13 @@ public class OrderPaginatedInput [global::System.Text.Json.Serialization.JsonPropertyName("orderSource")] public string? OrderSource { get; set; } + /// + /// 客户 ID(管理端可选;不传则查全部)。 + /// + [Newtonsoft.Json.JsonProperty("customerId")] + [global::System.Text.Json.Serialization.JsonPropertyName("customerId")] + public int? CustomerId { get; set; } + /// /// 关键词。 /// diff --git a/src/Oms.Application/Services/Orders/OrderService.Pickup.cs b/src/Oms.Application/Services/Orders/OrderService.Pickup.cs index 42c3e5b..e31fe88 100644 --- a/src/Oms.Application/Services/Orders/OrderService.Pickup.cs +++ b/src/Oms.Application/Services/Orders/OrderService.Pickup.cs @@ -45,8 +45,11 @@ public partial class OrderService throw new BusinessException("揽收时间不能为空"); } - var customer = await OmsSessionHelper.ResolveSessionCustomerAsync(CustomerRepository, CurrentUser); - var senderAddress = await CustomerSenderAddressRepository.GetOwnedAsync(input.SenderAddressId, customer.Id); + var customerId = await WarehouseCustomerHelper.ResolveRequiredCustomerIdAsync( + CustomerRepository, + CurrentUser, + input.CustomerId); + var senderAddress = await CustomerSenderAddressRepository.GetOwnedAsync(input.SenderAddressId, customerId); if (senderAddress == null) { throw new BusinessException("发件地址不存在"); @@ -77,7 +80,7 @@ public partial class OrderService input, senderAddress, warehouse, - customer.Id, + customerId, senderCountryCode); return await CreateParcelCoreAsync( diff --git a/src/Oms.Application/Services/Orders/OrderService.cs b/src/Oms.Application/Services/Orders/OrderService.cs index 19345ad..9b98ca5 100644 --- a/src/Oms.Application/Services/Orders/OrderService.cs +++ b/src/Oms.Application/Services/Orders/OrderService.cs @@ -50,7 +50,7 @@ public partial class OrderService : ApplicationService var customerId = await OmsSessionHelper.ResolveListCustomerIdAsync( CustomerRepository, CurrentUser, - null); + input.CustomerId); var filter = BuildListFilter(input, customerId); await ApplyInternalOrderDataScopeAsync(filter); var pageIndex = OmsDocHelper.NormalizePage(input.Page);