feat: 揽收订单与列表支持管理端按客户筛选

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-07-16 12:41:20 +08:00
parent 1cf55b2669
commit a9338a4b25
4 changed files with 19 additions and 4 deletions

View File

@ -169,6 +169,11 @@ public class CustomerSenderAddressOutput
/// </summary> /// </summary>
public class OrderPickupCreateInput public class OrderPickupCreateInput
{ {
/// <summary>
/// 客户 ID(管理端代创建必传;客户门户可省略)。
/// </summary>
public int? CustomerId { get; set; }
public string? RequestId { get; set; } public string? RequestId { get; set; }
public string? ClientNo { get; set; } public string? ClientNo { get; set; }

View File

@ -38,6 +38,13 @@ public class OrderPaginatedInput
[global::System.Text.Json.Serialization.JsonPropertyName("orderSource")] [global::System.Text.Json.Serialization.JsonPropertyName("orderSource")]
public string? OrderSource { get; set; } public string? OrderSource { get; set; }
/// <summary>
/// 客户 ID(管理端可选;不传则查全部)。
/// </summary>
[Newtonsoft.Json.JsonProperty("customerId")]
[global::System.Text.Json.Serialization.JsonPropertyName("customerId")]
public int? CustomerId { get; set; }
/// <summary> /// <summary>
/// 关键词。 /// 关键词。
/// </summary> /// </summary>

View File

@ -45,8 +45,11 @@ public partial class OrderService
throw new BusinessException("揽收时间不能为空"); throw new BusinessException("揽收时间不能为空");
} }
var customer = await OmsSessionHelper.ResolveSessionCustomerAsync(CustomerRepository, CurrentUser); var customerId = await WarehouseCustomerHelper.ResolveRequiredCustomerIdAsync(
var senderAddress = await CustomerSenderAddressRepository.GetOwnedAsync(input.SenderAddressId, customer.Id); CustomerRepository,
CurrentUser,
input.CustomerId);
var senderAddress = await CustomerSenderAddressRepository.GetOwnedAsync(input.SenderAddressId, customerId);
if (senderAddress == null) if (senderAddress == null)
{ {
throw new BusinessException("发件地址不存在"); throw new BusinessException("发件地址不存在");
@ -77,7 +80,7 @@ public partial class OrderService
input, input,
senderAddress, senderAddress,
warehouse, warehouse,
customer.Id, customerId,
senderCountryCode); senderCountryCode);
return await CreateParcelCoreAsync( return await CreateParcelCoreAsync(

View File

@ -50,7 +50,7 @@ public partial class OrderService : ApplicationService
var customerId = await OmsSessionHelper.ResolveListCustomerIdAsync( var customerId = await OmsSessionHelper.ResolveListCustomerIdAsync(
CustomerRepository, CustomerRepository,
CurrentUser, CurrentUser,
null); input.CustomerId);
var filter = BuildListFilter(input, customerId); var filter = BuildListFilter(input, customerId);
await ApplyInternalOrderDataScopeAsync(filter); await ApplyInternalOrderDataScopeAsync(filter);
var pageIndex = OmsDocHelper.NormalizePage(input.Page); var pageIndex = OmsDocHelper.NormalizePage(input.Page);