2026-07-27 00:18:42 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
2026-07-30 18:04:34 +08:00
|
|
|
|
import (
|
|
|
|
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
"time"
|
|
|
|
|
|
)
|
2026-07-27 00:18:42 +08:00
|
|
|
|
|
|
|
|
|
|
// CsTicket 对应 cs_ticket,保存客服工单。
|
|
|
|
|
|
type CsTicket struct {
|
2026-07-30 18:04:34 +08:00
|
|
|
|
Entity // 公共实体字段
|
|
|
|
|
|
TicketStatus int `gorm:"column:ticket_status;not null;default:32;index" json:"ticket_status"` // 工单业务状态
|
|
|
|
|
|
TicketNo string `gorm:"column:ticket_no;type:varchar(64);not null;uniqueIndex" json:"ticket_no"` // ticket_no 业务字段
|
|
|
|
|
|
RequestNo string `gorm:"column:request_no;type:varchar(128);not null;default:'';uniqueIndex:,where:request_no <> ''" json:"request_no"` // 创建幂等号
|
|
|
|
|
|
UserAccountID uint64 `gorm:"column:user_account_id;not null;index" json:"user_account_id"` // user_account_id 业务字段
|
|
|
|
|
|
StaffAccountID uint64 `gorm:"column:staff_account_id;not null;default:0;index" json:"staff_account_id"` // 分派工作人员内部主键
|
|
|
|
|
|
GasBasicID uint64 `gorm:"column:gas_basic_id;not null;default:0;index" json:"gas_basic_id"` // 服务气站内部主键
|
|
|
|
|
|
DeliveryBasicID uint64 `gorm:"column:delivery_basic_id;not null;default:0;index" json:"delivery_basic_id"` // 关联配送点内部主键
|
|
|
|
|
|
Category string `gorm:"column:category;type:varchar(64);not null" json:"category"` // category 业务字段
|
|
|
|
|
|
Priority string `gorm:"column:priority;type:varchar(16);not null;default:'normal'" json:"priority"` // priority 业务字段
|
|
|
|
|
|
Description string `gorm:"column:description;type:text;not null;default:''" json:"description"` // 用户问题描述
|
|
|
|
|
|
Address string `gorm:"column:address;type:varchar(255);not null;default:''" json:"address"` // 上门地址快照
|
|
|
|
|
|
AppointmentAt *time.Time `gorm:"column:appointment_at;type:timestamptz;index" json:"appointment_at"` // 预约服务时间
|
|
|
|
|
|
StartedAt *time.Time `gorm:"column:started_at;type:timestamptz" json:"started_at"` // 开始处理时间
|
|
|
|
|
|
CompletedAt *time.Time `gorm:"column:completed_at;type:timestamptz" json:"completed_at"` // 用户确认完成时间
|
|
|
|
|
|
Result string `gorm:"column:result;type:text;not null;default:''" json:"result"` // 工作人员处理结果
|
|
|
|
|
|
OperatorIdentity string `gorm:"column:operator_identity;type:varchar(36);not null;default:'';index" json:"operator_identity"` // 最近操作人业务标识
|
2026-07-27 00:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() { database.AppendMigrate(&CsTicket{}) }
|
|
|
|
|
|
func (table *CsTicket) TableName() string { return "cs_ticket" }
|