This commit is contained in:
邹宗楠
2026-02-09 16:57:13 +08:00
parent 6ee6222377
commit 70465e283e
2 changed files with 11 additions and 8 deletions

View File

@@ -1,10 +1,7 @@
package defsch
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
"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"
@@ -51,15 +48,24 @@ func (s *DefScheduler) OnAfsOrderNew(order *model.AfsOrder, isPending bool) (err
}
}
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(order.StoreID, order.VendorID)
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(order.JxStoreID, order.VendorID)
if err == nil {
if storeDetail.IsPrintRefundOrder == model.YES { // 打印退款订单
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "打印售后订单/取消订单", fmt.Sprintf("storeID:%d,orderID :%s", storeDetail.ID, order.VendorOrderID))
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
}