aftersales

package
v0.0.0-...-8be382e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 17 Imported by: 0

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

func TimeIn

func TimeIn(t time.Time, name string) (time.Time, error)

TimeIn returns the time in UTC if the name is "" or "UTC". It returns the local time if the name is "Local". Otherwise, the name is taken to be a location name in the IANA Time Zone database, such as "Africa/Lagos".

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

func (item *Aftersale) BeforeCreate(scope *gorm.Scope) error

BeforeCreate 初始状态

func (*Aftersale) BeforeSave

func (item *Aftersale) BeforeSave(scope *gorm.Scope) error

BeforeSave 验证费用

type AftersaleImage

type AftersaleImage struct {
	gorm.Model
	Aftersale   Aftersale
	AftersaleID uint
	Image       oss.OSS `sql:"size:4294967295;" media_library:"url:/backend/{{class}}/{{primary_key}}/{{column}}.{{extension}};path:./private"`
}

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

func UpdateBalanceFor(userID string) *Balance

UpdateBalanceFor 更新账户余额 罚款和奖励都是立即生效的(立即变为free状态的) update balance by user_id

func (*Balance) BeforeSave

func (item *Balance) BeforeSave(scope *gorm.Scope) error

type Manufacturer

type Manufacturer struct {
	gorm.Model

	// 客户信息, 从京东后台导入或者扫描枪扫入的
	ManufacturerName string
	URL              string
}

Manufacturer Aftersale 售后厂家管理

type ModelForAudit

type ModelForAudit struct {
	OpenID string
	ID     string
	URL    string
	Now    string
}

type ModelForSchedule

type ModelForSchedule struct {
	OpenID string
	ID     string
	URL    string
	Now    string
}

type Result

type Result struct {
	State     string
	Direction string
	Total     float32
}

Result 临时结果表

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

type Token

type Token struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL