From 9b79260f7485dc31f40286780225df81e65917c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 25 Aug 2022 18:08:33 +0800 Subject: [PATCH] 1 --- .../jxcallback/scheduler/defsch/defsch.go | 5 ++++- .../jxcallback/scheduler/defsch/defsch_afs.go | 20 +++++++++++++------ .../partner/printer/jxprint/jxprint_const.go | 2 +- .../partner/printer/xiaowm/xiaowm_test.go | 2 +- .../printer/yilianyun/yilianyun_test.go | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index efd14dd22..bfc1868cf 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -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 diff --git a/business/jxcallback/scheduler/defsch/defsch_afs.go b/business/jxcallback/scheduler/defsch/defsch_afs.go index 6db0d3357..c0ca7a3b0 100644 --- a/business/jxcallback/scheduler/defsch/defsch_afs.go +++ b/business/jxcallback/scheduler/defsch/defsch_afs.go @@ -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 diff --git a/business/partner/printer/jxprint/jxprint_const.go b/business/partner/printer/jxprint/jxprint_const.go index 7fad4e35b..211735e0e 100644 --- a/business/partner/printer/jxprint/jxprint_const.go +++ b/business/partner/printer/jxprint/jxprint_const.go @@ -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 diff --git a/business/partner/printer/xiaowm/xiaowm_test.go b/business/partner/printer/xiaowm/xiaowm_test.go index ee26b4595..01a036721 100644 --- a/business/partner/printer/xiaowm/xiaowm_test.go +++ b/business/partner/printer/xiaowm/xiaowm_test.go @@ -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) diff --git a/business/partner/printer/yilianyun/yilianyun_test.go b/business/partner/printer/yilianyun/yilianyun_test.go index 137c0b9a4..6fbdd9166 100644 --- a/business/partner/printer/yilianyun/yilianyun_test.go +++ b/business/partner/printer/yilianyun/yilianyun_test.go @@ -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)