添加退款订单打印以及退单打印
This commit is contained in:
@@ -70,6 +70,7 @@ func getStore4Print(db *dao.DaoDB, storeID int) (store *model.Store, err error)
|
||||
return store, err
|
||||
}
|
||||
|
||||
// PrintOrderByOrder4Store 打印订单信息
|
||||
func PrintOrderByOrder4Store(ctx *jxcontext.Context, order *model.GoodsOrder, storeID int) (printResult *partner.PrinterStatus, err error) {
|
||||
globals.SugarLogger.Debugf("PrintOrderByOrder4Store orderID:%s", order.VendorOrderID)
|
||||
db := dao.GetDB()
|
||||
@@ -99,6 +100,29 @@ func PrintOrderByOrder4Store(ctx *jxcontext.Context, order *model.GoodsOrder, st
|
||||
return printResult, err
|
||||
}
|
||||
|
||||
// PrintRefundOrCancelOrder 打印退单或取消订单信息
|
||||
func PrintRefundOrCancelOrder(ctx *jxcontext.Context, printType int, order *model.GoodsOrder, storeID int) (printResult *partner.PrinterStatus, err error) {
|
||||
db := dao.GetDB()
|
||||
store, err := getStore4Print(db, storeID)
|
||||
if err == nil {
|
||||
handler, err := GetHandlerFromStore(store)
|
||||
if err != nil {
|
||||
return &partner.PrinterStatus{
|
||||
PrintResult: partner.PrintResultNoPrinter,
|
||||
}, nil
|
||||
}
|
||||
storeDetail, _ := dao.GetStoreDetail(db, storeID, order.VendorID, order.VendorOrgCode)
|
||||
printResult, err = handler.PrintCancelOrRefundOrder(ctx, printType, store, storeDetail, order)
|
||||
if err == nil {
|
||||
dao.SetOrderPrintFlag(db, ctx.GetUserName(), order.VendorOrderID, order.VendorID, true)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
globals.SugarLogger.Infof("PrintRefundOrCancelOrder orderID:%s failed with error:%v", order.VendorOrderID, err)
|
||||
}
|
||||
return printResult, err
|
||||
}
|
||||
|
||||
func GetNetPrinterStatus(ctx *jxcontext.Context, storeID int) (printResult *partner.PrinterStatus, err error) {
|
||||
store := &model.Store{}
|
||||
store.ID = storeID
|
||||
|
||||
Reference in New Issue
Block a user