diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index ab4be842b..fca8bea4b 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -1177,6 +1177,12 @@ func (s *DefScheduler) updateOrderByBill(order *model.GoodsOrder, bill *model.Wa } else { order.WaybillVendorID = bill.WaybillVendorID order.VendorWaybillID = bill.VendorWaybillID + if bill.Status == model.WaybillStatusDelivered { + stores, _ := dao.GetStoreList(dao.GetDB(), []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "") + if len(stores) > 0 { + jxutils.RefreshOrderEarningPrice2(order, stores[0].PayPercentage) + } + } } if revertStatus { order.Status = model.OrderStatusFinishedPickup diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index c12e1cfac..41d5e9604 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -590,7 +590,11 @@ func RefreshOrderSkuRelated(order *model.GoodsOrder) *model.GoodsOrder { func RefreshOrderEarningPrice2(order *model.GoodsOrder, payPercentage int) *model.GoodsOrder { if payPercentage <= 50 { - order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage/2)) / 100 + if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX { + order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage/2)) / 100 + } else { + order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage)) / 100 + } } else { order.NewEarningPrice = order.EarningPrice } diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index 6d5fa4f3d..e74e245af 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -162,18 +162,13 @@ func updateOrderBySettleMent(order *model.GoodsOrder, orderSettlement *jdapi.Ord order2, _ := dao.GetSimpleOrder(dao.GetDB(), order.VendorOrderID) stores, _ := dao.GetStoreList(dao.GetDB(), []int{jxutils.GetSaleStoreIDFromOrder(order2)}, nil, nil, nil, "") if len(stores) > 0 { - if stores[0].PayPercentage <= 50 { - order.NewEarningPrice = orderSettlement.SettlementAmount * int64((100 - stores[0].PayPercentage/2)) / 100 - } else { - order.NewEarningPrice = order.EarningPrice - } + jxutils.RefreshOrderEarningPrice2(order, stores[0].PayPercentage) } else { globals.SugarLogger.Warnf("updateOrderBySettleMent,%v,%v,%v", order.VendorOrderID, orderSettlement.SettlementAmount) } } else { order.NewEarningPrice = order.EarningPrice } - globals.SugarLogger.Debugf("updateOrderBySettleMent,%v,%v,%v", order.VendorOrderID, order.NewEarningPrice, jxutils.GetSaleStoreIDFromOrder(order)) } }