This commit is contained in:
richboo111
2023-03-17 16:59:33 +08:00
parent bb99abcd0d
commit 8e152a44f6

View File

@@ -102,6 +102,7 @@ func (c *PrinterHandler) RebindPrinter(ctx *jxcontext.Context, lastBindResult *p
}
func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder, printType string, asfOrder *model.AfsOrder) (printerStatus *partner.PrinterStatus, err error) {
globals.SugarLogger.Debugf("打印order参数%s", utils.Format4Output(order, false))
if len(order.Skus) == 0 {
globals.SugarLogger.Debugf("order.sku为空")
return
@@ -174,21 +175,22 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
}
orderFmt += `
` + xpyunapi.StrRepeat("-", 32) + `
<BR><L>下单时间: %s</BR>
<BR><L>预计送达: %s</BR>
<BR><L>客户姓名: %s</BR>
<BR><L>客户电话: %s</BR>
<BR><HB>订单编号: %s</HB></BR>
<IMG></IMG><BR><C><B>%s: #%d</B></BR></C>
<BR><L>下单时间: %s
<BR><L>预计送达: %s
<BR><L>客户姓名: %s
<BR><L>客户电话: %s
<BR><HB>订单编号: %s</HB>
<IMG></IMG><BR><C><B>%s: #%d</B></C>
<C><QRCODE s=6 e=L l=center>%s</QRCODE></C>"
` + getCode + `
` + xpyunapi.StrRepeat("-", 32) + `
<HB>客户地址: %s</HB><BR>
<HB>客户地址: %s</HB>
` + xpyunapi.StrRepeat("-", 32) + `
<BR>客户备注: %s<BR>
<BR>客户备注: %s
` + xpyunapi.StrRepeat("-", 32) + `
<BR>商品列表<BR>
商品名` + xpyunapi.StrRepeat(" ", 2) + `数量` + xpyunapi.StrRepeat(" ", 3) + `单价` + xpyunapi.StrRepeat(" ", 5) + `小计<BR>
` + xpyunapi.StrRepeat("-", 32) + `
<BR>商品列表 ` + xpyunapi.StrRepeat("-", 6) + `<BR>
商品名` + xpyunapi.StrRepeat("-", 2) + `数量` + xpyunapi.StrRepeat("-", 3) + `单价` + xpyunapi.StrRepeat("-", 5) + `小计<BR>"
`
orderParams = append(orderParams,
utils.Time2Str(order.OrderCreatedAt),
@@ -209,9 +211,9 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
orderFmt += `
<L>共%d种%d件商品<BR></L>
<L>实际支付: %s元<BR></L>
` + xpyunapi.StrRepeat("-", 2) + `
`
orderFmt += `<BR><BR>`
orderFmt += xpyunapi.StrRepeat("-", 14) + "#23完" + xpyunapi.StrRepeat("-", 14)
orderParams = append(orderParams, order.SkuCount, order.GoodsCount, jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice))
return fmt.Sprintf(orderFmt, orderParams...)
}