123
This commit is contained in:
@@ -258,5 +258,3 @@ func (c *OrderManager) UpdataOrderFinancialInfo(orderFinancial *model.OrderFinan
|
|||||||
// orderFinancial 和 OrderSkuFinancial 数据计算完毕,准备进行更新
|
// orderFinancial 和 OrderSkuFinancial 数据计算完毕,准备进行更新
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ func (c *BaseScheduler) CreateWaybill(platformVendorID int, order *model.GoodsOr
|
|||||||
storebalance, err := cms.GetStoreAcctBalance(ctx, order.JxStoreID)
|
storebalance, err := cms.GetStoreAcctBalance(ctx, order.JxStoreID)
|
||||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
|
handlerInfo := partner.GetDeliveryPlatformFromVendorID(platformVendorID)
|
||||||
if handlerInfo != nil && handlerInfo.Use4CreateWaybill {
|
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 {
|
if c.IsReallyCallPlatformAPI {
|
||||||
bill, err = handlerInfo.Handler.CreateWaybill(order, maxDeliveryFee)
|
bill, err = handlerInfo.Handler.CreateWaybill(order, maxDeliveryFee)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -154,13 +154,13 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
|||||||
}
|
}
|
||||||
expend, lastFee, _ := partner.CurStoreAcctManager.GetStoreAcctExpendLastCreateWayBillFee(order.VendorOrderID)
|
expend, lastFee, _ := partner.CurStoreAcctManager.GetStoreAcctExpendLastCreateWayBillFee(order.VendorOrderID)
|
||||||
if int(newPrice) > lastFee {
|
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 {
|
} else {
|
||||||
if len(courierVendorIDs) == 1 {
|
if len(courierVendorIDs) == 1 {
|
||||||
courierVendorID := courierVendorIDs[0]
|
courierVendorID := courierVendorIDs[0]
|
||||||
if _, ok := deliveryFeeMap[courierVendorID]; ok {
|
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 {
|
} else if len(courierVendorIDs) == 0 {
|
||||||
var maxFee int64
|
var maxFee int64
|
||||||
@@ -169,7 +169,7 @@ func (s *DefScheduler) CreateWaybillOnProviders4SavedOrder(ctx *jxcontext.Contex
|
|||||||
v.DeliveryFee = maxFee
|
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