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