This commit is contained in:
邹宗楠
2024-08-27 14:29:32 +08:00
parent 299c1e4974
commit 16561246fe

View File

@@ -1,6 +1,7 @@
package defsch package defsch
import ( import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils" "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/jxcontext"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter" "git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
@@ -23,6 +24,9 @@ var (
) )
func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err error) { func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err error) {
if order.VendorOrderID == "3301223263215186716" {
globals.SugarLogger.Debugf("-----------OnAfsOrderNew := %s", utils.Format4Output(order, false))
}
if order.Status == model.AfsOrderStatusWait4Approve { if order.Status == model.AfsOrderStatusWait4Approve {
if !isPending { if !isPending {
if isAutoRejectAfsOrder(order) { if isAutoRejectAfsOrder(order) {
@@ -45,7 +49,9 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
weixinmsg.NotifyAfsOrderStatus(order) weixinmsg.NotifyAfsOrderStatus(order)
push.NotifyAfsOrder(order) push.NotifyAfsOrder(order)
} }
}
}
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) store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
if err == nil && store.PrinterVendorID == model.VendorIDJxprint && store.IsPrintCancelOrder == model.YES { if err == nil && store.PrinterVendorID == model.VendorIDJxprint && store.IsPrintCancelOrder == model.YES {
@@ -57,8 +63,6 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, orderObj, model.PrintAfsOrder, order) netprinter.PrintOrderByOrder(jxcontext.AdminCtx, orderObj, model.PrintAfsOrder, order)
} }
} }
}
} }
return err return err
} }