admin/src/Oms.Domain/OrdersAggregate/Repositories/IOrderRepository.cs
zzh cde0ccb6b0 feat: 新增工作台与实时监控统计 API
- GET /order/workplace-stats 与 /order/workplace-trend 供工作台使用

- GET /monitor/overview 供实时监控页订单/客户/轨迹统计

- 扩展订单仓储聚合查询,status-counts 同步应用数据权限

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 18:24:48 +08:00

103 lines
4.6 KiB
C#

using Fake.Domain.Repositories;
using Oms.Domain.OrdersAggregate.Entities;
namespace Oms.Domain.OrdersAggregate.Repositories;
public interface IOrderRepository : IRepository<Order>
{
Task<(List<Order> Items, int Total)> GetFilteredPagedListAsync(
int pageIndex,
int pageSize,
OrderListFilter filter,
CancellationToken cancellationToken = default);
Task<List<Order>> GetFilteredListAsync(
OrderListFilter filter,
CancellationToken cancellationToken = default);
Task<Order?> GetByServiceNoAsync(string serviceNo, CancellationToken cancellationToken = default);
Task<bool> HasServiceNoAsync(string serviceNo, CancellationToken cancellationToken = default);
Task<Order?> GetByTrackNoAsync(string trackNo, CancellationToken cancellationToken = default);
Task<Order?> GetByWaybillNoAsync(string waybillNo, CancellationToken cancellationToken = default);
Task<Order?> GetByCustomerAndClientNoAsync(int customerId, string clientNo, CancellationToken cancellationToken = default);
Task<Order?> GetByRequestIdAsync(string requestId, CancellationToken cancellationToken = default);
Task<List<OrderSender>> GetSendersByOrderIdsAsync(IEnumerable<int> orderIds, CancellationToken cancellationToken = default);
Task<List<OrderRecipient>> GetRecipientsByOrderIdsAsync(IEnumerable<int> orderIds, CancellationToken cancellationToken = default);
Task<List<OrderDeclaration>> GetDeclarationsByOrderIdsAsync(IEnumerable<int> orderIds, CancellationToken cancellationToken = default);
Task<List<OrderWeight>> GetWeightsByOrderIdsAsync(IEnumerable<int> orderIds, CancellationToken cancellationToken = default);
Task<OrderSender> InsertSenderAsync(OrderSender sender, CancellationToken cancellationToken = default);
Task<OrderRecipient> InsertRecipientAsync(OrderRecipient recipient, CancellationToken cancellationToken = default);
Task InsertDeclarationsAsync(IEnumerable<OrderDeclaration> declarations, CancellationToken cancellationToken = default);
Task ReplaceDeclarationsAsync(int orderId, IEnumerable<OrderDeclaration> declarations, CancellationToken cancellationToken = default);
Task InsertWeightsAsync(IEnumerable<OrderWeight> weights, CancellationToken cancellationToken = default);
Task ReplaceWeightsAsync(int orderId, IEnumerable<OrderWeight> weights, CancellationToken cancellationToken = default);
Task UpsertFeesAsync(int orderId, IEnumerable<OrderFee> fees, CancellationToken cancellationToken = default);
Task DeleteReceivableFeesAsync(int orderId, CancellationToken cancellationToken = default);
Task DeleteReceivableFeesByStageAsync(int orderId, string chargingStage, CancellationToken cancellationToken = default);
Task DeletePayableFeesAsync(int orderId, CancellationToken cancellationToken = default);
Task DeletePayableFeesByStageAsync(int orderId, string chargingStage, CancellationToken cancellationToken = default);
Task UpdateSenderAsync(OrderSender sender, CancellationToken cancellationToken = default);
Task UpdateRecipientAsync(OrderRecipient recipient, CancellationToken cancellationToken = default);
Task<List<OrderFee>> GetFeesByOrderIdsAsync(IEnumerable<int> orderIds, CancellationToken cancellationToken = default);
Task<(List<OrderReceivablePayableRow> Items, int Total)> GetReceivablePayablePagedListAsync(
int pageIndex,
int pageSize,
OrderReceivablePayableFilter filter,
CancellationToken cancellationToken = default);
Task<List<OrderStatusCountRow>> GetStatusCountsAsync(int? customerId, CancellationToken cancellationToken = default);
Task<List<OrderStatusCountRow>> GetStatusCountsByFilterAsync(
OrderListFilter filter,
CancellationToken cancellationToken = default);
Task<int> CountByFilterAndCreateTimeRangeAsync(
OrderListFilter filter,
DateTime startInclusive,
DateTime endExclusive,
CancellationToken cancellationToken = default);
Task<int> CountByFilterAndShipTimeRangeAsync(
OrderListFilter filter,
DateTime startInclusive,
DateTime endExclusive,
CancellationToken cancellationToken = default);
Task<decimal> SumFeeAmountByPayTimeRangeAsync(
OrderListFilter filter,
string feeType,
DateTime startInclusive,
DateTime endExclusive,
CancellationToken cancellationToken = default);
Task<List<Order>> GetOrdersByFilterAndCreateTimeRangeAsync(
OrderListFilter filter,
DateTime startInclusive,
DateTime endExclusive,
CancellationToken cancellationToken = default);
}