feat(csmanualentry): 手动录单支持收号出号分组
- 录单记录新增组别(收号/出号),唯一约束放宽为编号+组别,同一编号两组各可登记一次 - 操作人选项支持组别标记,录单选中后自动带出组别 - 列表新增组别列与筛选,今日统计按收号/出号分列
This commit is contained in:
@@ -8,26 +8,35 @@ const (
|
||||
OptionTypeOperator = "operator" // 操作人
|
||||
)
|
||||
|
||||
// 录单组别。
|
||||
const (
|
||||
EntryGroupCollect = "collect" // 收号
|
||||
EntryGroupSell = "sell" // 出号
|
||||
)
|
||||
|
||||
// CreateRequest 客服手动录单请求。
|
||||
type CreateRequest struct {
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
EntryGroup string `json:"entry_group" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// UpdateRequest 管理员修正录单请求。
|
||||
type UpdateRequest struct {
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
EntryNo string `json:"entry_no" binding:"required"`
|
||||
EntryGroup string `json:"entry_group" binding:"required"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// EntryDTO 录单记录。
|
||||
type EntryDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
EntryNo string `json:"entry_no"`
|
||||
EntryGroup string `json:"entry_group"`
|
||||
Platform string `json:"platform"`
|
||||
Operator string `json:"operator"`
|
||||
AdminID uint64 `json:"admin_id"`
|
||||
@@ -39,13 +48,14 @@ type EntryDTO struct {
|
||||
|
||||
// ListQuery 录单查询条件。
|
||||
type ListQuery struct {
|
||||
EntryNo string
|
||||
Keyword string
|
||||
AdminID uint64
|
||||
StartDate string // YYYY-MM-DD(北京时间,闭区间)
|
||||
EndDate string // YYYY-MM-DD(北京时间,闭区间)
|
||||
Page int
|
||||
PageSize int
|
||||
EntryNo string
|
||||
EntryGroup string
|
||||
Keyword string
|
||||
AdminID uint64
|
||||
StartDate string // YYYY-MM-DD(北京时间,闭区间)
|
||||
EndDate string // YYYY-MM-DD(北京时间,闭区间)
|
||||
Page int
|
||||
PageSize int
|
||||
}
|
||||
|
||||
// PaginatedResult 分页结果。
|
||||
@@ -56,12 +66,14 @@ type PaginatedResult struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// AgentDayStatsDTO 某客服某日录单统计。
|
||||
// AgentDayStatsDTO 某客服某日录单统计(按组分列)。
|
||||
type AgentDayStatsDTO struct {
|
||||
Date string `json:"date"` // YYYY-MM-DD(北京时间)
|
||||
AdminID uint64 `json:"admin_id"`
|
||||
AdminName string `json:"admin_name"`
|
||||
Count int64 `json:"count"`
|
||||
Date string `json:"date"` // YYYY-MM-DD(北京时间)
|
||||
AdminID uint64 `json:"admin_id"`
|
||||
AdminName string `json:"admin_name"`
|
||||
Count int64 `json:"count"` // 总录单量
|
||||
CollectCount int64 `json:"collect_count"` // 收号录单量
|
||||
SellCount int64 `json:"sell_count"` // 出号录单量
|
||||
}
|
||||
|
||||
// CreateResult 录单结果。
|
||||
@@ -74,6 +86,7 @@ type OptionDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
GroupTag string `json:"group_tag"` // 操作人组别标记:collect/sell/空
|
||||
SortOrder int `json:"sort_order"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
@@ -86,11 +99,23 @@ type OptionListDTO struct {
|
||||
|
||||
// CreateOptionRequest 新增平台 / 操作人选项。
|
||||
type CreateOptionRequest struct {
|
||||
Type string `json:"type" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type string `json:"type" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
GroupTag string `json:"group_tag"` // 仅操作人类型可用,collect/sell/空
|
||||
}
|
||||
|
||||
// UpdateOptionRequest 重命名平台 / 操作人选项。
|
||||
// UpdateOptionRequest 重命名平台 / 操作人选项(可同时更新组别标记)。
|
||||
type UpdateOptionRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
GroupTag string `json:"group_tag"` // 仅操作人类型可用,collect/sell/空
|
||||
}
|
||||
|
||||
// IsValidEntryGroup 判断组别取值是否合法。
|
||||
func IsValidEntryGroup(group string) bool {
|
||||
return group == EntryGroupCollect || group == EntryGroupSell
|
||||
}
|
||||
|
||||
// IsValidGroupTag 判断选项组别标记是否合法(允许为空表示未分组)。
|
||||
func IsValidGroupTag(tag string) bool {
|
||||
return tag == "" || IsValidEntryGroup(tag)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user