This commit is contained in:
邹宗楠
2022-08-25 18:08:33 +08:00
parent 6f1301fa24
commit 9b79260f74
5 changed files with 21 additions and 10 deletions

View File

@@ -501,7 +501,10 @@ func (s *DefScheduler) OnOrderStatusChanged(order *model.GoodsOrder, status *mod
}
// 京西云打印机打印数据-如果门店使用京西打印机才使用如下代码块
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order, model.PrintTypeOrder)
store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
if err == nil && store.PrinterVendorID == model.VendorIDJxprint {
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order, model.PrintTypeOrder)
}
}
}
return err

View File

@@ -3,9 +3,11 @@ package defsch
import (
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
push "git.rosy.net.cn/jx-callback/business/jxutils/unipush"
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/msghub"
"git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals"
@@ -34,12 +36,18 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
weixinmsg.NotifyAfsOrderStatus(order)
push.NotifyAfsOrder(order)
// 打印通知
//if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
// if orderObj, err2 := handler.GetOrder(order.VendorOrgCode, order.VendorOrderID, ""); err2 == nil && order != nil {
// netprinter.PrintOrderByOrder(jxcontext.AdminCtx, orderObj, model.PrintTypeOrder)
// }
//}
// 京西云打印机打印数据-如果门店使用京西打印机才使用如下代码块
store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
if err == nil && store.PrinterVendorID == model.VendorIDJxprint {
if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
orderObj, err2 := handler.GetOrder(order.VendorOrgCode, order.VendorOrderID, "")
if err2 != nil {
return err
}
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, orderObj, model.PrintTypeOrder)
}
}
}
}
return err

View File

@@ -109,7 +109,7 @@ func ManagerOrderPrint(order *model.GoodsOrder, storeTel string, storeDetail *da
printOrder[SkuList] = string(skuListByte)
printOrder[AllSkuTypeCount] = utils.Int2Str(order.SkuCount)
printOrder[AllSkuCount] = utils.Int2Str(order.GoodsCount)
printOrder[UserPayMoney] = utils.Int64ToStr(order.ActualPayPrice)
printOrder[UserPayMoney] = jxutils.IntPrice2StandardCurrencyString(order.ActualPayPrice)
printOrder[StoreName] = order.StoreName
printOrder[StoreTel] = storeTel
printOrder[OfficialName] = globals.StoreName

View File

@@ -36,7 +36,7 @@ func TestPrintMsg(t *testing.T) {
}
func TestRegisterPrinter(t *testing.T) {
newID1, newID2, err := CurPrinterHandler.RegisterPrinter(jxcontext.AdminCtx, "7JizmSyiXNzkggaqU", "", "title")
newID1, newID2, err := CurPrinterHandler.RegisterPrinter(jxcontext.AdminCtx, "7JizmSyiXNzkggaqU", "", "title", 0)
t.Log(newID1 + "," + newID2)
if err != nil {
t.Fatal(err)

View File

@@ -41,7 +41,7 @@ func TestPrintMsg(t *testing.T) {
}
func TestRegisterPrinter(t *testing.T) {
newID1, newID2, err := CurPrinterHandler.RegisterPrinter(jxcontext.AdminCtx, "4004600675", "fem2ukwvduik", "title")
newID1, newID2, err := CurPrinterHandler.RegisterPrinter(jxcontext.AdminCtx, "4004600675", "fem2ukwvduik", "title", 0)
t.Log(newID1 + "," + newID2)
if err != nil {
t.Fatal(err)