39 lines
1.3 KiB
Go
39 lines
1.3 KiB
Go
package partner
|
|
|
|
import (
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
|
)
|
|
|
|
const (
|
|
//账户收入类型
|
|
StoreAcctTypeIncomePay = 1 //主动充值
|
|
|
|
//账户支出类型
|
|
StoreAcctTypeExpendCreateWaybillEx = 2 //手动发单扣除的临时运费
|
|
)
|
|
|
|
const (
|
|
MinCreateWaybillBalance = 1000 //余额小于这个值直接不能发
|
|
)
|
|
|
|
var (
|
|
CurStoreAcctManager IStoreAcctManager
|
|
)
|
|
|
|
func InitStoreAcctManager(curStoreManager IStoreAcctManager) {
|
|
CurStoreAcctManager = curStoreManager
|
|
}
|
|
|
|
type IStoreAcctManager interface {
|
|
//增加一条收入流水
|
|
InsertStoreAcctIncome(ctx *jxcontext.Context, db *dao.DaoDB, storeID, price, acctType int, vendorOrderID string) (err error)
|
|
//增加一条支出流水
|
|
InsertStoreAcctExpend(ctx *jxcontext.Context, db *dao.DaoDB, storeID, price, acctType int, vendorOrderID string) (err error)
|
|
//更新门店账户
|
|
UpdateStoreAcctBalance(ctx *jxcontext.Context, storeID, price int, isIncome bool) (err error)
|
|
InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx *jxcontext.Context, storeID, price, acctType int, vendorOrderID string) (err error)
|
|
InsertStoreAcctIncomeAndUpdateStoreAcctBalance(ctx *jxcontext.Context, storeID, price, acctType int, vendorOrderID string) (err error)
|
|
CheckStoreAcctExpendExist(storeID, acctType int, vendorOrderID string) (result bool, err error)
|
|
}
|