修改打印机
This commit is contained in:
@@ -27,7 +27,7 @@ func TestPrintMsg(t *testing.T) {
|
||||
}
|
||||
|
||||
// context := CurPrinterHandler.getOrderContent(order, "13412345678")
|
||||
context := CurPrinterHandler.getOrderContentBig(order, "13412345678")
|
||||
context := CurPrinterHandler.getOrderContentBig(order, "13412345678", nil)
|
||||
status, err := CurPrinterHandler.PrintMsg(jxcontext.AdminCtx, "7JizmSyiXNzkggaqU", "177f213277dd842ba2b53f6c926a48ea", "test", context)
|
||||
t.Log(utils.Format4Output(status, false))
|
||||
if err != nil {
|
||||
|
||||
@@ -184,9 +184,9 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
||||
)
|
||||
|
||||
for _, sku := range order.Skus {
|
||||
orderFmt += `<FS><FB>%s\n\n</FB></FS>`
|
||||
orderFmt += `<FS><FB>%s\n</FB></FS>`
|
||||
//orderFmt += `<FS2>%s %s %s\n\n</FS2>`
|
||||
orderFmt += `<FS>%20s<FB>%8s</FB>\n</FS>`
|
||||
orderFmt += `<FS>%15s<FB>%8s</FB>\n</FS>`
|
||||
//orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
|
||||
orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count)))
|
||||
//标品需要打印条形码
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package yilianyun
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -17,20 +19,24 @@ func init() {
|
||||
}
|
||||
|
||||
func TestPrintMsg(t *testing.T) {
|
||||
//orderID := "910838879000442"
|
||||
//vendorID := 0
|
||||
//order, err := partner.CurOrderManager.LoadOrder(orderID, vendorID)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//
|
||||
//// context := CurPrinterHandler.getOrderContent(order, "13412345678")
|
||||
//context := CurPrinterHandler.getOrderContentBig(order, "13412345678")
|
||||
//status, err := CurPrinterHandler.PrintMsg(jxcontext.AdminCtx, "4004600675", "fem2ukwvduik", "test", context)
|
||||
//t.Log(utils.Format4Output(status, false))
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
orderID := "88387051001754"
|
||||
vendorID := 0
|
||||
order, err := partner.CurOrderManager.LoadOrder(orderID, vendorID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(667278, 9)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// context := CurPrinterHandler.getOrderContent(order, "13412345678")
|
||||
context := CurPrinterHandler.getOrderContentBig(order, "18981810340", storeDetail)
|
||||
status, err := CurPrinterHandler.PrintMsg(jxcontext.AdminCtx, "4004806902", "755845185619", "test", context)
|
||||
t.Log(utils.Format4Output(status, false))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegisterPrinter(t *testing.T) {
|
||||
|
||||
@@ -14,7 +14,7 @@ func init() {
|
||||
testinit.Init()
|
||||
}
|
||||
|
||||
func TestPrintMsg(t *testing.T) {
|
||||
func Msg(t *testing.T) {
|
||||
//orderID := "910838879000442"
|
||||
//vendorID := 0
|
||||
//order, err := partner.CurOrderManager.LoadOrder(orderID, vendorID)
|
||||
|
||||
Reference in New Issue
Block a user