31 lines
1.9 KiB
Go
31 lines
1.9 KiB
Go
package entity
|
||
|
||
import (
|
||
"time"
|
||
|
||
"gitea.com/red-future/common/beans"
|
||
)
|
||
|
||
const DataStatisticsCollection = "data_statistics"
|
||
|
||
// DataStatistics 数据统计实体 (用于存储每天/每位客服的汇总数据)
|
||
type DataStatistics struct {
|
||
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||
Date *time.Time `bson:"date" json:"date"` // 统计日期 (格式: YYYY-MM-DD)
|
||
AccountName string `bson:"accountName" json:"accountName"` // 客服账号名称
|
||
CustomerServiceName string `bson:"customerServiceName" json:"customerServiceName"` // 客服名称
|
||
CustomerServicePlatform string `bson:"customerServicePlatform" json:"customerServicePlatform"` // 客服平台
|
||
|
||
// 以下字段由 Data 表中的 bool 字段累加统计得出
|
||
InboundCount int `bson:"inboundCount" json:"inboundCount"` // 进线人数 (汇总 IsInbound)
|
||
ActiveCount int `bson:"activeCount" json:"activeCount"` // 开口人数 (汇总 IsActive)
|
||
ServedCount int `bson:"servedCount" json:"servedCount"` // 接待人数 (汇总 IsServed)
|
||
ContactCardSentCount int `bson:"contactCardSentCount" json:"contactCardSentCount"` // 留资卡发送数量 (汇总 HasSentContactCard)
|
||
NameCardSentCount int `bson:"nameCardSentCount" json:"nameCardSentCount"` // 名片发送数量 (汇总 HasSentNameCard)
|
||
LeftContactInfoCount int `bson:"leftContactInfoCount" json:"leftContactInfoCount"` // 留资人数 (汇总 HasLeftContactInfo)
|
||
|
||
ResponseRate30s float64 `bson:"responseRate30s" json:"responseRate30s"` // 30秒响应率
|
||
ResponseRate60s float64 `bson:"responseRate60s" json:"responseRate60s"` // 60秒响应率
|
||
ResponseRate360s float64 `bson:"responseRate360s" json:"responseRate360s"` // 360秒响应率
|
||
}
|