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);