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>
public class OrderPickupCreateInput
{
/// <summary>
/// 客户 ID(管理端代创建必传;客户门户可省略)。
/// </summary>
public int? CustomerId { get; set; }
public string? RequestId { get; set; }
public string? ClientNo { get; set; }

View File

@ -38,6 +38,13 @@ public class OrderPaginatedInput
[global::System.Text.Json.Serialization.JsonPropertyName("orderSource")]
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>

View File

@ -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(

View File

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