feat: 工作台统计补充店铺数量与待处理店铺订单,包裹单号前缀改为 ID
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
a9338a4b25
commit
fc823ed24e
@ -49,4 +49,14 @@ public class OrderWorkplaceStatsOutput
|
|||||||
/// 问题件数量。
|
/// 问题件数量。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Problematic { get; set; }
|
public int Problematic { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 店铺数量。
|
||||||
|
/// </summary>
|
||||||
|
public int StoreCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 店铺订单待处理数量(履约状态 pending)。
|
||||||
|
/// </summary>
|
||||||
|
public int StoreOrderPending { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,7 +191,7 @@ public partial class OrderService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string ParcelServiceNoPrefix = "NE";
|
private const string ParcelServiceNoPrefix = "ID";
|
||||||
|
|
||||||
private static void NormalizeParcelCreateInput(OrderParcelCreateInput input)
|
private static void NormalizeParcelCreateInput(OrderParcelCreateInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,11 +3,19 @@ using Oms.Application.Dtos.Orders;
|
|||||||
using Oms.Application.Shared;
|
using Oms.Application.Shared;
|
||||||
using Oms.Domain.OrdersAggregate;
|
using Oms.Domain.OrdersAggregate;
|
||||||
using Oms.Domain.OrdersAggregate.Consts;
|
using Oms.Domain.OrdersAggregate.Consts;
|
||||||
|
using Oms.Domain.OrdersAggregate.Repositories;
|
||||||
|
using Oms.Domain.WarehouseAggregate.Consts;
|
||||||
|
|
||||||
namespace Oms.Application.Services.Orders;
|
namespace Oms.Application.Services.Orders;
|
||||||
|
|
||||||
public partial class OrderService
|
public partial class OrderService
|
||||||
{
|
{
|
||||||
|
private ISalesStoreRepository SalesStoreRepository =>
|
||||||
|
LazyServiceProvider.GetRequiredService<ISalesStoreRepository>();
|
||||||
|
|
||||||
|
private ISalesStoreOrderRepository SalesStoreOrderRepository =>
|
||||||
|
LazyServiceProvider.GetRequiredService<ISalesStoreOrderRepository>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作台订单统计概览。
|
/// 工作台订单统计概览。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,6 +54,17 @@ public partial class OrderService
|
|||||||
+ GetCount(OrderStatusCodes.DeliverySuccess)
|
+ GetCount(OrderStatusCodes.DeliverySuccess)
|
||||||
+ GetCount(OrderStatusCodes.DeliveryFailed);
|
+ GetCount(OrderStatusCodes.DeliveryFailed);
|
||||||
|
|
||||||
|
var customerId = filter.CustomerId;
|
||||||
|
var storeCount = customerId is > 0
|
||||||
|
? await SalesStoreRepository.CountAsync(x => x.CustomerId == customerId.Value)
|
||||||
|
: await SalesStoreRepository.CountAsync(_ => true);
|
||||||
|
var storeOrderPending = customerId is > 0
|
||||||
|
? await SalesStoreOrderRepository.CountAsync(x =>
|
||||||
|
x.CustomerId == customerId.Value
|
||||||
|
&& x.FulfillStatus == SalesStoreFulfillStatusCodes.Pending)
|
||||||
|
: await SalesStoreOrderRepository.CountAsync(x =>
|
||||||
|
x.FulfillStatus == SalesStoreFulfillStatusCodes.Pending);
|
||||||
|
|
||||||
return new OrderWorkplaceStatsOutput
|
return new OrderWorkplaceStatsOutput
|
||||||
{
|
{
|
||||||
Total = counts.Values.Sum(),
|
Total = counts.Values.Sum(),
|
||||||
@ -57,6 +76,8 @@ public partial class OrderService
|
|||||||
Shipped = shipped,
|
Shipped = shipped,
|
||||||
PendingOnline = GetCount(OrderStatusCodes.PendingOnline),
|
PendingOnline = GetCount(OrderStatusCodes.PendingOnline),
|
||||||
Problematic = GetCount(OrderStatusCodes.Problematic),
|
Problematic = GetCount(OrderStatusCodes.Problematic),
|
||||||
|
StoreCount = storeCount,
|
||||||
|
StoreOrderPending = storeOrderPending,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user