1
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -34,6 +35,7 @@ func (c *PrinterHandler) GetVendorID() int {
|
|||||||
func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, printSn, orderSeq, msgTitle, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
|
func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, printSn, orderSeq, msgTitle, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
|
||||||
globals.SugarLogger.Debugf("PrintMsg id1:%s", printSn)
|
globals.SugarLogger.Debugf("PrintMsg id1:%s", printSn)
|
||||||
if printSn != "" && globals.EnableStoreWrite {
|
if printSn != "" && globals.EnableStoreWrite {
|
||||||
|
printSn = strings.Split(printSn, "_")[0]
|
||||||
if _, err := api.JxPrintAPI.DoPrint(printSn, msgContent, utils.Str2Int(orderSeq)); err == nil {
|
if _, err := api.JxPrintAPI.DoPrint(printSn, msgContent, utils.Str2Int(orderSeq)); err == nil {
|
||||||
return c.GetPrinterStatus(ctx, printSn, "")
|
return c.GetPrinterStatus(ctx, printSn, "")
|
||||||
}
|
}
|
||||||
@@ -268,7 +270,8 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.PrintMsg(ctx, store.PrinterSN, order.VendorOrderID, "", string(orderPrint))
|
orderSel := utils.Int2Str(order.VendorID) + utils.Int2Str(order.OrderSeq)
|
||||||
|
return c.PrintMsg(ctx, store.PrinterSN, orderSel, "", string(orderPrint))
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrintStore 打印门店
|
// PrintStore 打印门店
|
||||||
@@ -282,7 +285,7 @@ func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.PrintMsg(ctx, store.PrinterSN, "", "", string(orderPrint))
|
return c.PrintMsg(ctx, store.PrinterSN, "99999", "", string(orderPrint))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
func (c *PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user