添加退款订单打印以及退单打印

This commit is contained in:
邹宗楠
2022-06-14 15:23:02 +08:00
parent caa0b76302
commit 140d07bb92
14 changed files with 285 additions and 47 deletions

View File

@@ -2,6 +2,7 @@ package basesch
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
"strings"
"time"
@@ -206,6 +207,7 @@ func (c *BaseScheduler) CancelWaybillByID(ctx *jxcontext.Context, vendorWaybillI
}
func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID string, vendorID, approveType int, reason string) (err error) {
skus := make([]*model.OrderFinancialSkuExt, 0, 0)
afsOrder, err := partner.CurOrderManager.LoadAfsOrder(afsOrderID, vendorID)
if err == nil {
if c.IsReallyCallPlatformAPI {
@@ -228,7 +230,7 @@ func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID s
var (
afsCount, orderCount int
)
skus, _ := dao.GetAfsOrderSkuInfo(db, order.VendorOrderID, afsOrderID, order.VendorID, false)
skus, _ = dao.GetAfsOrderSkuInfo(db, order.VendorOrderID, afsOrderID, order.VendorID, false)
for _, v := range skus {
afsCount += v.Count
}
@@ -274,6 +276,19 @@ func (c *BaseScheduler) AgreeOrRefuseRefund(ctx *jxcontext.Context, afsOrderID s
dao.SetAfsOrderFlag(dao.GetDB(), ctx.GetUserName(), afsOrderID, vendorID, flag)
}
}
if approveType != partner.AfsApproveTypeRefused {
storeDetail, err := partner.CurOrderManager.LoadStoreDetail(afsOrder.StoreID, afsOrder.VendorID)
if err != nil {
globals.SugarLogger.Debug("Get store detail Err : ", err)
return err
}
if storeDetail.IsPrintRefundOrder == model.YES { // 打印退款订单
order2, _ := partner.CurOrderManager.LoadOrder(afsOrder.VendorOrderID, afsOrder.VendorID)
_, err = netprinter.PrintRefundOrCancelOrder(jxcontext.AdminCtx, model.NO, order2, afsOrder.StoreID)
}
}
return err
}

View File

@@ -628,6 +628,12 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
if bill.Status == model.WaybillStatusAccepted && order.NotifyType == 0 {
smsmsg.NotifyPickOrder(order)
}
// 订单在三方配送中,转自送
if order.Status >= model.OrderStatusDelivering && order.DeliveryType == model.OrderDeliveryTypeStoreSelf {
s.swtich2SelfDeliverWithRetry(savedOrderInfo, bill, switch2SelfDeliverRetryCount, switch2SelfDeliverRetryGap)
}
// 订单处于配送状态来的新分配骑手运单
if order.Status >= model.OrderStatusDelivering && order.Status < model.OrderStatusEndBegin && bill.Status < model.OrderStatusDelivering {
if order.DeliveryType == model.OrderDeliveryTypeStoreSelf {
@@ -636,6 +642,7 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)
}
}
//订单已经是结束状态之后来的运单143945553920000001
if order.Status > model.OrderStatusEndBegin {
s.ProxyCancelWaybill(order, bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonStrNotAcceptIntime)