1
This commit is contained in:
@@ -115,7 +115,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
|||||||
|
|
||||||
// 打印门第离线消息
|
// 打印门第离线消息
|
||||||
if storeStatus < model.StoreStatusOpened && storeDetail.PrinterVendorID == model.VendorIDJxprint {
|
if storeStatus < model.StoreStatusOpened && storeDetail.PrinterVendorID == model.VendorIDJxprint {
|
||||||
netprinter.PrintStoreStatus(jxcontext.AdminCtx, storeDetail, vendorID)
|
netprinter.PrintStoreStatus(jxcontext.AdminCtx, storeDetail, vendorID, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func PrintOrderByOrder4Store(ctx *jxcontext.Context, order *model.GoodsOrder, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PrintStoreStatus 打印门店信息
|
// PrintStoreStatus 打印门店信息
|
||||||
func PrintStoreStatus(ctx *jxcontext.Context, storeDetail *dao.StoreDetail, vendorId int) (printResult *partner.PrinterStatus, err error) {
|
func PrintStoreStatus(ctx *jxcontext.Context, storeDetail *dao.StoreDetail, vendorId, storeStatus int) (printResult *partner.PrinterStatus, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
store, err := getStore4Print(db, storeDetail.ID)
|
store, err := getStore4Print(db, storeDetail.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -118,7 +118,9 @@ func PrintStoreStatus(ctx *jxcontext.Context, storeDetail *dao.StoreDetail, vend
|
|||||||
PrintResult: partner.PrintResultNoPrinter,
|
PrintResult: partner.PrintResultNoPrinter,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
if storeStatus != 0 { // 失去授权
|
||||||
|
storeDetail.Status = -9
|
||||||
|
}
|
||||||
printResult, err = handler.PrintStore(ctx, store, storeDetail, vendorId)
|
printResult, err = handler.PrintStore(ctx, store, storeDetail, vendorId)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dao.SetOrderPrintFlag(db, ctx.GetUserName(), "store print", vendorId, true)
|
dao.SetOrderPrintFlag(db, ctx.GetUserName(), "store print", vendorId, true)
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ package mtwm
|
|||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 美团回调接口
|
// 美团回调接口
|
||||||
@@ -14,6 +17,10 @@ func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse
|
|||||||
} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
|
} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
|
||||||
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
response = CurPurchaseHandler.onNumberDowngrade(msg)
|
||||||
} else if msg.Cmd == mtwmapi.MsgTypeStoreBind {
|
} else if msg.Cmd == mtwmapi.MsgTypeStoreBind {
|
||||||
|
// 门店授权发生变化 17,失去授权
|
||||||
|
vendorStoreID := msg.FormData.Get("app_poi_code")
|
||||||
|
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDMTWM, "")
|
||||||
|
netprinter.PrintStoreStatus(jxcontext.AdminCtx, storeDetail, model.VendorIDMTWM, -9)
|
||||||
} else {
|
} else {
|
||||||
if orderID := GetOrderIDFromMsg(msg); orderID != "" {
|
if orderID := GetOrderIDFromMsg(msg); orderID != "" {
|
||||||
jxutils.CallMsgHandler(func() {
|
jxutils.CallMsgHandler(func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user