打印机日志

This commit is contained in:
邹宗楠
2026-02-09 16:05:41 +08:00
parent 67dc8be686
commit 1b700c9dda
3 changed files with 13 additions and 19 deletions

View File

@@ -1,7 +1,10 @@
package defsch
import (
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
"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"
@@ -46,26 +49,17 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
push.NotifyAfsOrder(order)
}
}
}
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(order.StoreID, order.VendorID)
if err == nil {
if storeDetail.IsPrintRefundOrder == model.YES { // 打印退款订单
order2, _ := partner.CurOrderManager.LoadOrder(order.VendorOrderID, order.VendorID)
_, err = netprinter.PrintRefundOrCancelOrder(jxcontext.AdminCtx, model.NO, order2, order2.JxStoreID)
}
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(order.StoreID, order.VendorID)
if err == nil {
if storeDetail.IsPrintRefundOrder == model.YES { // 打印退款订单
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "打印售后订单/取消订单", utils.Format4Output(storeDetail.ID, false))
order2, _ := partner.CurOrderManager.LoadOrder(order.VendorOrderID, order.VendorID)
_, err = netprinter.PrintRefundOrCancelOrder(jxcontext.AdminCtx, model.NO, order2, order2.JxStoreID)
}
}
//if order.Status == model.AfsOrderStatusWait4Approve || order.Status == model.AfsOrderStatusFinished || order.Status == model.AfsOrderStatusNew {
// // 京西云打印机打印数据-如果门店使用京西打印机才使用如下代码块
// store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
// if err == nil && store.PrinterVendorID == model.VendorIDJxprint && store.IsPrintCancelOrder == model.YES {
// orderObj, _ := partner.CurOrderManager.LoadOrder(order.VendorOrderID, order.VendorID)
// if orderObj != nil {
// netprinter.PrintOrderByOrder(jxcontext.AdminCtx, orderObj, model.PrintAfsOrder, order)
// }
// }
//}
return err
}