Documentation ¶
Index ¶
Constants ¶
View Source
const AUDIT_FAILED_TPL = `` /* 584-byte string literal not displayed */
AUDIT_FAILED_TPL 审核不通过通知模板
View Source
const AUDIT_OK_TPL = `` /* 679-byte string literal not displayed */
AUDIT_OK_TPL 审核成功通知模板
View Source
const SCHEDULE_TPL = `` /* 744-byte string literal not displayed */
SCHEDULE_TPL 指派了师傅之后推送模板消息给师傅
View Source
const UNFREEZE_TPL = `` /* 589-byte string literal not displayed */
UNFREEZE_TPL 解冻通知
Variables ¶
View Source
var ( // OrderStateMachine order's state machine OrderStateMachine = transition.New(&Aftersale{}) // SettlementStateMachine 结算状态机 SettlementStateMachine = transition.New(&Settlement{}) )
View Source
var STATES = []string{
"created",
"inquired",
"scheduled",
"overdue",
"processing",
"processed",
"audited",
"audit_failed",
"frozen",
"completed",
}
STATES Dashboard for Operators 待预约 1 (aftersales.state == "created") 待指派 1 (aftersales.state == "inquired") 超时任务单 1 (aftersales.预约时间== "空" 需要重新指派) 待审核 1 (aftersales.state == "to_be_audited")
Functions ¶
Types ¶
type Aftersale ¶
type Aftersale struct { gorm.Model // 客户信息, 从京东后台导入或者扫描枪扫入的 CustomerName string CustomerPhone string CustomerAddress string // -- ORDER_TYPE starts with Q 退货的取件单 ServiceType string ServiceContent string // 预约安装时间 ReservedServiceTime string Source string // 品牌 Brand string Fee float32 ItemName string `json:"item_name"` Quantity uint `json:"quantity"` PricePerUnit float32 `json:"price_per_unit"` FromOrderNo string `json:"from_order_no"` // 备注 Remark string UserID uint User users.User Images []AftersaleImage transition.Transition audited.AuditedModel }
Aftersale 售后管理
func (*Aftersale) BeforeCreate ¶
BeforeCreate 初始状态
type AftersaleImage ¶
type Balance ¶
type Balance struct { gorm.Model UserID uint User users.User // 总冻结金额 FrozenAmount float32 // 总可提现金额 FreeAmount float32 // 奖励金 AwardAmount float32 // 罚款 FineAmount float32 // 历史总收入 TotalAmount float32 // 历史总提现金额 WithdrawAmount float32 }
Balance 用户余额统计
func UpdateBalanceFor ¶
UpdateBalanceFor 更新账户余额 罚款和奖励都是立即生效的(立即变为free状态的) update balance by user_id
type Manufacturer ¶
Manufacturer Aftersale 售后厂家管理
type ModelForSchedule ¶
type Settlement ¶
type Settlement struct { gorm.Model UserID uint User users.User Direction string Amount float32 AftersaleID uint Aftersale Aftersale transition.Transition audited.AuditedModel }
Settlement Aftersale 售后厂家管理
func (*Settlement) AfterSave ¶
func (item *Settlement) AfterSave(scope *gorm.Scope) error
AfterSave AfterSave Callback
func (*Settlement) BeforeCreate ¶
func (item *Settlement) BeforeCreate(scope *gorm.Scope) error
BeforeCreate 初始状态
func (*Settlement) BeforeSave ¶
func (item *Settlement) BeforeSave(scope *gorm.Scope) error
BeforeSave BeforeSave Callback
Click to show internal directories.
Click to hide internal directories.