1
This commit is contained in:
@@ -266,7 +266,7 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
err = scheduler.ErrDeliverProviderWrong
|
err = scheduler.ErrDeliverProviderWrong
|
||||||
|
|||||||
@@ -184,12 +184,15 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
|||||||
}
|
}
|
||||||
|
|
||||||
deliveryFeeMap, _ := s.QueryOrderWaybillFeeInfoEx(ctx, order.VendorOrderID, order.VendorID)
|
deliveryFeeMap, _ := s.QueryOrderWaybillFeeInfoEx(ctx, order.VendorOrderID, order.VendorID)
|
||||||
|
globals.SugarLogger.Debugf("=========deliveryFeeMap= := %s", utils.Format4Output(deliveryFeeMap, false))
|
||||||
// 不管是门店发单还是品牌发单都要扣钱,门店发单扣门店,品牌发单扣品牌
|
// 不管是门店发单还是品牌发单都要扣钱,门店发单扣门店,品牌发单扣品牌
|
||||||
if order.CreateDeliveryType == model.YES {
|
if order.CreateDeliveryType == model.YES {
|
||||||
// 获取平台配送费
|
// 获取平台配送费
|
||||||
isEqual, isZero, _ := partner.CurStoreAcctManager.CheckStoreAcctExpendExist(order.VendorOrderID) // 当前订单的支出记录
|
isEqual, isZero, _ := partner.CurStoreAcctManager.CheckStoreAcctExpendExist(order.VendorOrderID) // 当前订单的支出记录
|
||||||
expend, lastFee, _ := partner.CurStoreAcctManager.GetStoreAcctExpendLastCreateWayBillFee(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 { // 满足此条件是,门店发单已经存在此订单的发单记录
|
if !isZero && !isEqual { // 满足此条件是,门店发单已经存在此订单的发单记录
|
||||||
var newPrice int64
|
var newPrice int64
|
||||||
if len(courierVendorIDs) == 1 {
|
if len(courierVendorIDs) == 1 {
|
||||||
@@ -206,6 +209,7 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
|||||||
}
|
}
|
||||||
newPrice = maxFee
|
newPrice = maxFee
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("==========newPrice := %d", newPrice)
|
||||||
// 门店支出运费,门店发单
|
// 门店支出运费,门店发单
|
||||||
if order.CreateDeliveryType == model.YES {
|
if order.CreateDeliveryType == model.YES {
|
||||||
if storeAcct.AccountBalance > int(newPrice) {
|
if storeAcct.AccountBalance > int(newPrice) {
|
||||||
|
|||||||
Reference in New Issue
Block a user