This commit is contained in:
suyl
2021-09-01 17:26:58 +08:00
parent e1dcce0fdf
commit 1e9f0660b0
2 changed files with 8 additions and 5 deletions

View File

@@ -603,7 +603,9 @@ func (s *DefScheduler) OnWaybillStatusChanged(bill *model.Waybill, isPending boo
if storeDetail.CreateDeliveryType == model.YES {
s.updateStoreAccount(order, bill)
}
s.updateBrandAccount(storeDetail, bill)
if !model.IsWaybillPlatformOwn(bill) {
s.updateBrandAccount(storeDetail, bill)
}
}
//针对快送的订单(订单接单后会立马召唤骑手,不会到自动拣货完成)
//如果骑手已接单,没有通知过的门店,需要发送通知
@@ -1369,10 +1371,7 @@ func (s *DefScheduler) updateStoreAccount(order *model.GoodsOrder, bill *model.W
}
func (s *DefScheduler) updateBrandAccount(store *dao.StoreDetail, bill *model.Waybill) {
realDesiredFee := bill.DesiredFee
if balance, err := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID); err == nil {
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, balance-int(realDesiredFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, bill.VendorOrderID)
}
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, store.BrandID, int(bill.DesiredFee), model.BrandBillTypeExpend, model.BrandBillFeeTypeDelivery, bill.VendorOrderID)
}
func (s *DefScheduler) updateBillsInfo(savedOrderInfo *WatchOrderInfo, bill *model.Waybill) (isBillExist bool) {

View File

@@ -191,6 +191,10 @@ func (s *StoreAcctManager) InsertBrandBill(ctx *jxcontext.Context, brandID, pric
var (
db = dao.GetDB()
)
if price == 0 {
globals.SugarLogger.Debugf("InsertBrandBill failed price is 0, brandID: %d, vendorOrderID: %s", brandID, vendorOrderID)
return
}
brandBill := &model.BrandBill{
BrandID: brandID,
Price: price,