取消订单退费

This commit is contained in:
邹宗楠
2022-07-13 17:40:22 +08:00
parent 529ab2f0fa
commit b4b3d2f27d
4 changed files with 21 additions and 6 deletions

View File

@@ -813,9 +813,11 @@ func (s *DefScheduler) cancelWaybillNotInStoreOpentime(savedOrderInfo *WatchOrde
time4 := jxutils.JxOperationTime2TimeByDate(storeDetail.CloseTime2, time.Now())
if time.Now().Sub(time3) < 0 || time.Now().Sub(time4.Add(time.Minute*30)) > 0 {
s.CancelWaybill(bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonNotInStoreOpenTime)
s.reverseBrandAccount(storeDetail, bill)
}
} else {
s.CancelWaybill(bill, partner.CancelWaybillReasonNotAcceptIntime, partner.CancelWaybillReasonNotInStoreOpenTime)
s.reverseBrandAccount(storeDetail, bill)
}
}
}
@@ -1450,6 +1452,7 @@ func (s *DefScheduler) updateBrandAccount(store *dao.StoreDetail, bill *model.Wa
}
}
// 取消退费
func (s *DefScheduler) reverseBrandAccount(store *dao.StoreDetail, bill *model.Waybill) {
globals.SugarLogger.Debugf("reverseBrandAccount bill: %v", utils.Format4Output(bill, true))
brandBills, _ := dao.GetBrandBill(dao.GetDB(), store.BrandID, bill.VendorOrderID, model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery)
@@ -1633,6 +1636,7 @@ func (s *DefScheduler) ProxyCancelWaybill(order *model.GoodsOrder, bill *model.W
if cancelReasonID != partner.CancelWaybillReasonNotAcceptIntime {
if storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), jxutils.GetSaleStoreIDFromOrder(order), order.VendorID, order.VendorOrgCode); storeDetail != nil {
s.reverseBrandAccount(storeDetail, bill)
//orderman.ResetCreateWaybillFee(dao.GetDB(), order)
}
}
}