Files
order/model/entity/order_yearly_statistics.go
2026-02-24 16:49:31 +08:00

57 lines
3.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import (
"time"
"gitea.com/red-future/common/beans"
)
// OrderYearlyStatistics 订单年度统计数据实体
type OrderYearlyStatistics struct {
beans.MongoBaseDO `bson:",inline"`
ReportDate time.Time `bson:"report_date" json:"report_date"` // 统计日期(年度第一天)
Period string `bson:"period" json:"period"` // 统计周期描述: 2024
Year int `bson:"year" json:"year"` // 年份
// 订单基础统计
TotalOrders int64 `bson:"total_orders" json:"total_orders"` // 总订单数
CompletedOrders int64 `bson:"completed_orders" json:"completed_orders"` // 已完成订单数
CancelledOrders int64 `bson:"cancelled_orders" json:"cancelled_orders"` // 已取消订单数
PaidOrders int64 `bson:"paid_orders" json:"paid_orders"` // 已支付订单数
// 金额统计(单位:分)
TotalAmount int64 `bson:"total_amount" json:"total_amount"` // 订单总金额
PaidAmount int64 `bson:"paid_amount" json:"paid_amount"` // 已支付金额
RefundAmount int64 `bson:"refund_amount" json:"refund_amount"` // 退款金额
NetAmount int64 `bson:"net_amount" json:"net_amount"` // 净收入金额
// 业务指标
AverageOrderValue int64 `bson:"average_order_value" json:"average_order_value"` // 平均客单价
PaymentRate float64 `bson:"payment_rate" json:"payment_rate"` // 支付成功率
CompletionRate float64 `bson:"completion_rate" json:"completion_rate"` // 完成率
// 用户统计
UniqueUsers int64 `bson:"unique_users" json:"unique_users"` // 唯一用户数
NewUsers int64 `bson:"new_users" json:"new_users"` // 新用户数
ReturningUsers int64 `bson:"returning_users" json:"returning_users"` // 回头用户数
// 商品统计
TotalItems int64 `bson:"total_items" json:"total_items"` // 商品总数量
UniqueAssets int64 `bson:"unique_assets" json:"unique_assets"` // 唯一资产数
TopAssetID string `bson:"top_asset_id,omitempty" json:"top_asset_id"` // 热门资产ID
TopAssetName string `bson:"top_asset_name,omitempty" json:"top_asset_name"` // 热门资产名称
TopAssetCount int64 `bson:"top_asset_count,omitempty" json:"top_asset_count"` // 热门资产销量
// 季度分解
QuarterlyOrders []int64 `bson:"quarterly_orders,omitempty" json:"quarterly_orders"` // 季度订单数4个季度
QuarterlyAmounts []int64 `bson:"quarterly_amounts,omitempty" json:"quarterly_amounts"` // 季度金额4个季度
PeakQuarter int `bson:"peak_quarter,omitempty" json:"peak_quarter"` // 高峰季度
// 月度分解
MonthlyOrders []int64 `bson:"monthly_orders,omitempty" json:"monthly_orders"` // 月度订单数12个月
MonthlyAmounts []int64 `bson:"monthly_amounts,omitempty" json:"monthly_amounts"` // 月度金额12个月
// 同比增长率
YearOverYearGrowth float64 `bson:"year_over_year_growth" json:"year_over_year_growth"` // 同比增长率
}