This commit is contained in:
邹宗楠
2023-05-15 15:42:44 +08:00
parent 82caa218f2
commit b8626bbb82
2 changed files with 5 additions and 1 deletions

View File

@@ -266,7 +266,7 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
}
} else {
err = fmt.Errorf("CreateWaybill failed brand is close orderID: %s, isOpen: %d or store/brand money is enought ", order.VendorOrderID, storeDetail.BrandIsOpen)
err = fmt.Errorf("创建运单是门店余额不足十元,无法创建运单")
}
} else {
err = scheduler.ErrDeliverProviderWrong

View File

@@ -184,12 +184,15 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
}
deliveryFeeMap, _ := s.QueryOrderWaybillFeeInfoEx(ctx, order.VendorOrderID, order.VendorID)
globals.SugarLogger.Debugf("=========deliveryFeeMap= := %s", utils.Format4Output(deliveryFeeMap, false))
// 不管是门店发单还是品牌发单都要扣钱,门店发单扣门店,品牌发单扣品牌
if order.CreateDeliveryType == model.YES {
// 获取平台配送费
isEqual, isZero, _ := partner.CurStoreAcctManager.CheckStoreAcctExpendExist(order.VendorOrderID) // 当前订单的支出记录
expend, lastFee, _ := partner.CurStoreAcctManager.GetStoreAcctExpendLastCreateWayBillFee(order.VendorOrderID) // 最后一个运单支出记录
// 收最贵的一个订单配送费(配送费发送变化,收取最贵的价格)
globals.SugarLogger.Debugf("==========iszero,isequal := %s,%s", utils.Format4Output(isZero, false), utils.Format4Output(isZero, false))
globals.SugarLogger.Debugf("==========expend,lastFee := %s,%s", utils.Format4Output(expend, false), utils.Format4Output(lastFee, false))
if !isZero && !isEqual { // 满足此条件是,门店发单已经存在此订单的发单记录
var newPrice int64
if len(courierVendorIDs) == 1 {
@@ -206,6 +209,7 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
}
newPrice = maxFee
}
globals.SugarLogger.Debugf("==========newPrice := %d", newPrice)
// 门店支出运费,门店发单
if order.CreateDeliveryType == model.YES {
if storeAcct.AccountBalance > int(newPrice) {