京东商城和京西的订单结算修改

This commit is contained in:
苏尹岚
2020-08-10 18:01:52 +08:00
parent 60a850ecca
commit dbc87bd0d7
2 changed files with 26 additions and 26 deletions

View File

@@ -199,25 +199,25 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
waybill, _ := c.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
store, _ := c.LoadStoreDetail(jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
if waybill == nil {
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100)
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage/2) / int64(100)
}
// if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
// if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage)/int64(100) {
// order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage) / int64(100)
// }
// } else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != order.TotalShopMoney*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = order.TotalShopMoney * int64(100-store.PayPercentage/2) / int64(100)
}
// }
} else {
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100)
}
} else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage/2) / int64(100)
}
// if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
// if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage)/int64(100) {
// order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage) / int64(100)
// }
// } else {
if order.NewEarningPrice == 0 || order.NewEarningPrice != (order.TotalShopMoney-waybill.DesiredFee)*int64(100-store.PayPercentage/2)/int64(100) {
order.NewEarningPrice = (order.TotalShopMoney - waybill.DesiredFee) * int64(100-store.PayPercentage/2) / int64(100)
}
// }
}
dao.UpdateEntity(db, order, "NewEarningPrice")
}

View File

@@ -590,11 +590,11 @@ func RefreshOrderSkuRelated(order *model.GoodsOrder) *model.GoodsOrder {
func RefreshOrderEarningPrice2(order *model.GoodsOrder, payPercentage int) *model.GoodsOrder {
if order.EarningType == model.EarningTypePoints {
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage)) / 100
} else {
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)) / 100
// } else {
order.NewEarningPrice = order.TotalShopMoney * int64((100 - payPercentage/2)) / 100
// }
} else {
order.NewEarningPrice = order.EarningPrice
}
@@ -603,11 +603,11 @@ func RefreshOrderEarningPrice2(order *model.GoodsOrder, payPercentage int) *mode
func RefreshOrderEarningPrice3(order *model.GoodsOrder, payPercentage int, bill *model.Waybill) *model.GoodsOrder {
if order.EarningType == model.EarningTypePoints {
if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - payPercentage)) / 100
} else {
order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - payPercentage/2)) / 100
}
// if order.VendorID == model.VendorIDJDShop || order.VendorID == model.VendorIDJX {
// order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - payPercentage)) / 100
// } else {
order.NewEarningPrice = (order.TotalShopMoney - bill.DesiredFee) * int64((100 - payPercentage/2)) / 100
// }
} else {
order.NewEarningPrice = order.EarningPrice
}