123
This commit is contained in:
@@ -176,7 +176,7 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
||||
storebalance, err := cms.GetStoreAcctBalance(ctx, order.JxStoreID)
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
|
||||
if handlerInfo != nil && handlerInfo.Use4CreateWaybill {
|
||||
if model.DeliveryBrandMarkMap[platformVendorID]&storeDetail.BrandIsOpen != 0 && (balance >= model.BrandBalanceLimit || storebalance.AccountBalance >= 1000) {
|
||||
if model.DeliveryBrandMarkMap[platformVendorID]&storeDetail.BrandIsOpen != 0 && (balance >= model.BrandBalanceLimit || storebalance.AccountBalance >= 1000) { //判断品牌余额或者商店余额,有一个大于10就可以开始创建
|
||||
if c.IsReallyCallPlatformAPI {
|
||||
bill, err = handlerInfo.Handler.CreateWaybill(order, maxDeliveryFee)
|
||||
if err != nil {
|
||||
|
||||
@@ -154,13 +154,13 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
||||
}
|
||||
expend, lastFee, _ := partner.CurStoreAcctManager.GetStoreAcctExpendLastCreateWayBillFee(order.VendorOrderID)
|
||||
if int(newPrice) > lastFee {
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(newPrice)-lastFee, partner.StoreAcctTypeExpendCreateWaybill2ndMore, order.VendorOrderID, expend.ID)
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(model.Waybill{}.DesiredFee), partner.StoreAcctTypeExpendCreateWaybill2ndMore, order.VendorOrderID, expend.ID) //int(newPrice)-lastFee
|
||||
}
|
||||
} else {
|
||||
if len(courierVendorIDs) == 1 {
|
||||
courierVendorID := courierVendorIDs[0]
|
||||
if _, ok := deliveryFeeMap[courierVendorID]; ok {
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(deliveryFeeMap[courierVendorID].DeliveryFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, 0)
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(model.Waybill{}.DesiredFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, 0) //int(deliveryFeeMap[courierVendorID].DeliveryFee
|
||||
}
|
||||
} else if len(courierVendorIDs) == 0 {
|
||||
var maxFee int64
|
||||
@@ -169,7 +169,7 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
||||
v.DeliveryFee = maxFee
|
||||
}
|
||||
}
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(maxFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, 0)
|
||||
partner.CurStoreAcctManager.InsertStoreAcctExpendAndUpdateStoreAcctBalance(ctx, jxutils.GetSaleStoreIDFromOrder(order), int(model.Waybill{}.DesiredFee), partner.StoreAcctTypeExpendCreateWaybillEx, order.VendorOrderID, 0) //int(maxFee)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user