feat: 工作台统计补充店铺数量与待处理店铺订单,包裹单号前缀改为 ID
feat: 工作台统计补充店铺数量与待处理店铺订单,包裹单号前缀改为 ID
This commit is contained in:
commit
6172257575
@ -49,4 +49,14 @@ public class OrderWorkplaceStatsOutput
|
||||
/// 问题件数量。
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
|
||||
@ -3,11 +3,19 @@ using Oms.Application.Dtos.Orders;
|
||||
using Oms.Application.Shared;
|
||||
using Oms.Domain.OrdersAggregate;
|
||||
using Oms.Domain.OrdersAggregate.Consts;
|
||||
using Oms.Domain.OrdersAggregate.Repositories;
|
||||
using Oms.Domain.WarehouseAggregate.Consts;
|
||||
|
||||
namespace Oms.Application.Services.Orders;
|
||||
|
||||
public partial class OrderService
|
||||
{
|
||||
private ISalesStoreRepository SalesStoreRepository =>
|
||||
LazyServiceProvider.GetRequiredService<ISalesStoreRepository>();
|
||||
|
||||
private ISalesStoreOrderRepository SalesStoreOrderRepository =>
|
||||
LazyServiceProvider.GetRequiredService<ISalesStoreOrderRepository>();
|
||||
|
||||
/// <summary>
|
||||
/// 工作台订单统计概览。
|
||||
/// </summary>
|
||||
@ -46,6 +54,17 @@ public partial class OrderService
|
||||
+ GetCount(OrderStatusCodes.DeliverySuccess)
|
||||
+ 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
|
||||
{
|
||||
Total = counts.Values.Sum(),
|
||||
@ -57,6 +76,8 @@ public partial class OrderService
|
||||
Shipped = shipped,
|
||||
PendingOnline = GetCount(OrderStatusCodes.PendingOnline),
|
||||
Problematic = GetCount(OrderStatusCodes.Problematic),
|
||||
StoreCount = storeCount,
|
||||
StoreOrderPending = storeOrderPending,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user