diff --git a/business/partner/printer/jxprint/jxprint.go b/business/partner/printer/jxprint/jxprint.go index 720d8427f..2ff535df3 100644 --- a/business/partner/printer/jxprint/jxprint.go +++ b/business/partner/printer/jxprint/jxprint.go @@ -12,6 +12,7 @@ import ( "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" "regexp" + "strings" ) 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) { globals.SugarLogger.Debugf("PrintMsg id1:%s", printSn) if printSn != "" && globals.EnableStoreWrite { + printSn = strings.Split(printSn, "_")[0] if _, err := api.JxPrintAPI.DoPrint(printSn, msgContent, utils.Str2Int(orderSeq)); err == nil { return c.GetPrinterStatus(ctx, printSn, "") } @@ -268,7 +270,8 @@ func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, 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 打印门店 @@ -282,7 +285,7 @@ func (c *PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, 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) {