All checks were successful
Build and Deploy / deploy (push) Successful in 1m2s
同步监控 overview 支持日周月经营指标与积压队列。 Co-authored-by: Cursor <cursoragent@cursor.com>
196 lines
5.3 KiB
C#
196 lines
5.3 KiB
C#
namespace Oms.Application.Dtos.Monitor;
|
||
|
||
/// <summary>
|
||
/// 实时监控页概览数据。
|
||
/// </summary>
|
||
public class MonitorOverviewOutput
|
||
{
|
||
public MonitorOrderStatsOutput Order { get; set; } = new();
|
||
|
||
public MonitorCustomerStatsOutput Customer { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 经营指标(订单量/营收/毛利)按日周月维度。
|
||
/// </summary>
|
||
public MonitorOpsStatsOutput Ops { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 实时积压队列(不随维度变化)。
|
||
/// </summary>
|
||
public MonitorQueueStatsOutput Queue { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 订单趋势(随 dimension 变化;兼容字段名 OrderTrend7d 在 day 时等同本字段)。
|
||
/// </summary>
|
||
public List<MonitorTrendPointOutput> OrderTrend { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 近 7 日新增订单趋势(兼容旧前端;dimension=day 时与 OrderTrend 相同)。
|
||
/// </summary>
|
||
public List<MonitorTrendPointOutput> OrderTrend7d { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 营收/毛利趋势(随 dimension 变化)。
|
||
/// </summary>
|
||
public List<MonitorRevenueTrendPointOutput> RevenueTrend { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 近 7 日营收/毛利趋势(兼容旧前端;dimension=day 时与 RevenueTrend 相同)。
|
||
/// </summary>
|
||
public List<MonitorRevenueTrendPointOutput> RevenueTrend7d { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 各线路订单趋势(周/月由前端切换,此处预载两种维度)。
|
||
/// </summary>
|
||
public MonitorRegionTrendBundleOutput RegionOrderTrend { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 各线路应收趋势。
|
||
/// </summary>
|
||
public MonitorRegionTrendBundleOutput RegionReceivableTrend { get; set; } = new();
|
||
|
||
/// <summary>
|
||
/// 各线路签收达标率(基于派送成功/失败订单)。
|
||
/// </summary>
|
||
public List<MonitorRegionRateOutput> RegionSignRates { get; set; } = [];
|
||
|
||
/// <summary>
|
||
/// 轨迹 KPI 汇总(完整率/及时率/OTD,基于订单妥投比例估算)。
|
||
/// </summary>
|
||
public MonitorTrackRatesOutput TrackRates { get; set; } = new();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 经营 KPI:订单量 / 营收 / 毛利(随日周月)。
|
||
/// </summary>
|
||
public class MonitorOpsStatsOutput
|
||
{
|
||
/// <summary>day / week / month</summary>
|
||
public string Dimension { get; set; } = "day";
|
||
|
||
/// <summary>当前周期新建订单数。</summary>
|
||
public int OrderCount { get; set; }
|
||
|
||
/// <summary>订单量环比增长百分比。</summary>
|
||
public decimal? OrderCountGrowthPercent { get; set; }
|
||
|
||
/// <summary>当前周期应收(已付)营收。</summary>
|
||
public decimal Revenue { get; set; }
|
||
|
||
/// <summary>营收环比增长百分比。</summary>
|
||
public decimal? RevenueGrowthPercent { get; set; }
|
||
|
||
/// <summary>当前周期毛利 = 应收 - 应付。</summary>
|
||
public decimal GrossProfit { get; set; }
|
||
|
||
/// <summary>毛利环比增长百分比。</summary>
|
||
public decimal? GrossProfitGrowthPercent { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 实时积压快照(不受日周月影响)。
|
||
/// </summary>
|
||
public class MonitorQueueStatsOutput
|
||
{
|
||
public int PendingPayment { get; set; }
|
||
|
||
public int PendingOnline { get; set; }
|
||
|
||
public int PendingSign { get; set; }
|
||
|
||
public int Problematic { get; set; }
|
||
}
|
||
|
||
public class MonitorOrderStatsOutput
|
||
{
|
||
public int TodayCreated { get; set; }
|
||
|
||
public decimal? TodayCreatedGrowthPercent { get; set; }
|
||
|
||
public int Total { get; set; }
|
||
|
||
public decimal? TotalMonthGrowthPercent { get; set; }
|
||
|
||
public int PendingPayment { get; set; }
|
||
|
||
public int PendingOnline { get; set; }
|
||
|
||
public int PendingSign { get; set; }
|
||
|
||
public int Problematic { get; set; }
|
||
|
||
public decimal TodayRevenue { get; set; }
|
||
|
||
public decimal? TodayRevenueGrowthPercent { get; set; }
|
||
}
|
||
|
||
public class MonitorCustomerStatsOutput
|
||
{
|
||
public int TotalCustomers { get; set; }
|
||
|
||
public decimal? TotalCustomersMonthGrowthPercent { get; set; }
|
||
|
||
public int NewCustomersToday { get; set; }
|
||
|
||
public decimal? NewCustomersGrowthPercent { get; set; }
|
||
|
||
public int OnlineCustomers { get; set; }
|
||
|
||
public int InactiveLogin7d { get; set; }
|
||
|
||
public int InactiveLogin7dDelta { get; set; }
|
||
}
|
||
|
||
public class MonitorTrendPointOutput
|
||
{
|
||
public string Label { get; set; } = string.Empty;
|
||
|
||
public int Count { get; set; }
|
||
}
|
||
|
||
public class MonitorRevenueTrendPointOutput
|
||
{
|
||
public string Label { get; set; } = string.Empty;
|
||
|
||
public decimal Revenue { get; set; }
|
||
|
||
public decimal GrossProfit { get; set; }
|
||
}
|
||
|
||
public class MonitorRegionTrendBundleOutput
|
||
{
|
||
public MonitorRegionTrendPeriodOutput Week { get; set; } = new();
|
||
|
||
public MonitorRegionTrendPeriodOutput Month { get; set; } = new();
|
||
}
|
||
|
||
public class MonitorRegionTrendPeriodOutput
|
||
{
|
||
public List<string> Labels { get; set; } = [];
|
||
|
||
public List<MonitorRegionSeriesOutput> Series { get; set; } = [];
|
||
}
|
||
|
||
public class MonitorRegionSeriesOutput
|
||
{
|
||
public string Region { get; set; } = string.Empty;
|
||
|
||
public List<int> Values { get; set; } = [];
|
||
}
|
||
|
||
public class MonitorRegionRateOutput
|
||
{
|
||
public string Region { get; set; } = string.Empty;
|
||
|
||
public decimal Rate { get; set; }
|
||
}
|
||
|
||
public class MonitorTrackRatesOutput
|
||
{
|
||
public decimal TrackCompleteRate { get; set; }
|
||
|
||
public decimal TrackTimelyRate { get; set; }
|
||
|
||
public decimal OtdRate { get; set; }
|
||
}
|