Documentation
¶
Index ¶
- func AlertOverdueAftersales(job *work.Job) error
- func AlertToAudit(job *work.Job) error
- func AutoAudit(job *work.Job) error
- func AutoAward(job *work.Job) error
- func AutoCreateAftersale(job *work.Job) error
- func AutoDeliverOrders(job *work.Job) error
- func AutoFine(job *work.Job) error
- func AutoFinish(job *work.Job) error
- func AutoGenerateAftersales(job *work.Job) error
- func AutoInquire(job *work.Job) error
- func AutoProcess(job *work.Job) error
- func AutoSchedule(job *work.Job) error
- func AutoWithdraw(job *work.Job) error
- func Compile()
- func Evaluate()
- func EvaluateOrder(order orders.Order, knowledgeBase *model.KnowledgeBase, engine *engine.Grool)
- func ExpireAftersales(job *work.Job) error
- func ExportMobilePhones(job *work.Job) error
- func ExportOrderDetails(job *work.Job) error
- func ExportOrderFees(job *work.Job) error
- func ExportOrderFollowUps(job *work.Job) error
- func FreezeAftersales(job *work.Job) error
- func Log(job *work.Job, next work.NextMiddlewareFunc) error
- func RandomString(n int) string
- func SendWechatTemplateMsg(job *work.Job) error
- func StartFaktoryWorker()
- func StartHealthCheck()
- func StartWebhookd()
- func StartWorkWebUI()
- func StartWorkerPool()
- func UnclutterOldNotifications(job *work.Job) error
- func UnfreezeAftersales(job *work.Job) error
- func UpdateBalance(job *work.Job) error
- func UpdateBalances(job *work.Job) error
- func UpdateOrderItems(job *work.Job) error
- type Context
- type Helper
- func (h *Helper) Contains(s1 string, s2 string) bool
- func (h *Helper) ContainsAll(s1 string, s2 []string) bool
- func (h *Helper) ContainsAny(s1 string, s2 string) bool
- func (h *Helper) GetCategory(s1 string) string
- func (h *Helper) NotContains(s1 string, s2 string) bool
- func (h *Helper) RandomRuleName() string
- type Item
- type OrderPayload
- type TemplateMsgResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertOverdueAftersales ¶
AlertOverdueAftersales 超时告警
func AutoCreateAftersale ¶
AutoCreateAftersale 创建order_items之后自动创建一个售后订单
func AutoDeliverOrders ¶
AutoDeliverOrders 自动妥投配送时间小于当前时间的订单
func AutoGenerateAftersales ¶
AutoGenerateAftersales demo模式下自动创建服务单
func EvaluateOrder ¶
func ExpireAftersales ¶
ExpireAftersales 任务指派后 after_sale的状态为scheduled, 如果师傅20分钟之内没有响应,自动变为overdue状态
func ExportMobilePhones ¶
ExportMobilePhones 定时导出昨日电话号码
func ExportOrderFollowUps ¶
ExportOrderFollowUps 定时导出订单回访
func RandomString ¶
func SendWechatTemplateMsg ¶
SendWechatTemplateMsg 发送微信模版消息(当任务指派给师傅或者订单解冻了,需要给师傅推送一条微信模板消息)
func StartFaktoryWorker ¶
func StartFaktoryWorker()
StartFaktoryWorker start faktory worker just run `go StartFaktoryWorker()` in main.go
func StartHealthCheck ¶
func StartHealthCheck()
StartHealthCheck start health check just run go StartHealthCheck() in main.go
func StartWebhookd ¶
func StartWebhookd()
StartWebhookd start webhookd just run `go StartWebhookd()` in main.go
func StartWorkWebUI ¶
func StartWorkWebUI()
StartWorkWebUI serves gocraft/work UI https://github.com/gocraft/work/blob/master/cmd/workwebui/main.go
func StartWorkerPool ¶
func StartWorkerPool()
StartWorkerPool start gocraft/work worker pool just run `go StartWorkerPool()` in main.go run workwebui -redis="redis:6379" -ns="qor" -listen=":5040" open localhost:5040 to view jobs ui https://crontab.guru/ https://crontab.guru/examples.html
func UnclutterOldNotifications ¶
UnclutterOldNotifications 干掉太久的已读通知
func UnfreezeAftersales ¶
UnfreezeAftersales 解冻超过7天的,自动结算,金额算到师傅名下
func UpdateBalances ¶
UpdateBalances 统计每个师傅的冻结金额和可结算金额并更新到Balances表
func UpdateOrderItems ¶
UpdateOrderItems 更新ordre_items 的 order_id
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context For gocraft/work
type OrderPayload ¶
type OrderPayload struct { UUID string `json:"uuid"` Order struct { OrderNo string `json:"order_no"` CustomerAddress string `json:"customer_address"` CustomerName string `json:"customer_name"` CustomerPhone string `json:"customer_phone"` ReservedDeliveryTime string `json:"reserved_delivery_time"` ReservedSetupTime string `json:"reserved_setup_time"` IsDeliveryAndSetup string `json:"is_delivery_and_setup"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Receivables json.Number `json:"receivables"` OrderItems []struct { OrderNo string `json:"order_no"` ProductNo string `json:"product_no"` ProductName string `json:"product_name"` Quantity json.Number `json:"quantity"` Install string `json:"install"` Volume json.Number `json:"volume"` Weight json.Number `json:"weight"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } `json:"order_items"` } `json:"order"` }
OrderPayload 函数用来接收并发送消息到Pubsub的结构体
type TemplateMsgResp ¶
type TemplateMsgResp struct { ErrCode int `json:"errcode"` ErrMsg string `json:"errmsg"` MsgID int64 `json:"msgid"` }
TemplateMsgResp 发送模板消息返回结果