- 接收门店状态消息,本地同步状态,京东暂时无效

This commit is contained in:
gazebo
2019-04-12 16:22:22 +08:00
parent ca8d0b362b
commit 77c5a16c08
14 changed files with 233 additions and 53 deletions

View File

@@ -90,6 +90,7 @@ var (
var (
CurOrderManager IOrderManager
CurStoreManager IStoreManager
PurchasePlatformHandlers map[int]IPurchasePlatformHandler
DeliveryPlatformHandlers map[int]*DeliveryPlatformHandlerInfo
@@ -123,6 +124,10 @@ type IOrderManager interface {
SaveAfsOrderFinancialInfo(afsOrder *model.AfsOrder) (err error)
}
type IStoreManager interface {
OnStoreStatusChanged(vendorStoreID string, vendorID int, storeStatus int) (err error)
}
// purchase handler中
// 所有SyncRefresh开头的函数都必须自己清理sync_status标记
// 所有非以SyncRefresh开头的函数不用自己清理sync_status标记VendorSync统一处理
@@ -151,7 +156,7 @@ type IPurchasePlatformHandler interface {
////////
// Store
ReadStore(vendorStoreID string) (store *model.Store, err error)
UpdateStore(db *dao.DaoDB, storeID int, userName string) error
UpdateStore(db *dao.DaoDB, storeID int, userName string) (err error)
// EnableAutoAcceptOrder(vendorStoreID string, isEnabled bool) error
// OpenStore(vendorStoreID string, userName string) error
// CloseStore(vendorStoreID, closeNotice, userName string) error
@@ -167,6 +172,7 @@ type IPurchasePlatformHandler interface {
ReplyOrderComment(ctx *jxcontext.Context, orderComment *model.OrderComment, replyComment string) (err error)
UploadImg(ctx *jxcontext.Context, imgURL string, imgData []byte, imgName string) (imgHint string, err error)
GetStoreStatus(ctx *jxcontext.Context, vendorStoreID string) (storeStatus int, err error)
}
// db *dao.DaoDB,
@@ -233,10 +239,14 @@ func init() {
PrinterPlatformHandlers = make(map[int]IPrinterHandler)
}
func Init(curOrderManager IOrderManager) {
func InitOrderManager(curOrderManager IOrderManager) {
CurOrderManager = curOrderManager
}
func InitStoreManager(curStoreManager IStoreManager) {
CurStoreManager = curStoreManager
}
func RegisterPurchasePlatform(handler IPurchasePlatformHandler) {
vendorID := handler.GetVendorID()
if !(model.IsPurchaseVendorExist(vendorID)) {