This commit is contained in:
邹宗楠
2024-10-31 15:55:06 +08:00
parent c98e01e834
commit c7ff910fe7
2 changed files with 15 additions and 26 deletions

View File

@@ -338,9 +338,6 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
}
orders, totalCount, err := dao.GetOrders(db, nil, false, isIncludeFake, fromDateStr, toDateStr, isDateFinish, skuIDs, isJxFirst, "", params, offset, pageSize)
if orders[0].VendorOrderID == "4033500150064003740" {
globals.SugarLogger.Debugf("--------orders := %s", utils.Format4Output(orders, false))
}
if err == nil {
pagedInfo = &model.PagedInfo{
TotalCount: totalCount,
@@ -375,14 +372,6 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
if afsOrder.AfsTotalShopMoney != 0 && afsOrder.AfsTotalShopMoney != order.TotalShopMoney {
//报价,要减去商品的京西价
if order.EarningType == model.EarningTypeQuote {
if orders[0].VendorOrderID == "4033500150064003740" {
globals.SugarLogger.Debugf("--------orders := %s", utils.Format4Output(afsOrder, false))
globals.SugarLogger.Debugf("--------afsOrder.AfsTotalShopMoney := %s", utils.Format4Output(afsOrder.AfsTotalShopMoney, false))
globals.SugarLogger.Debugf("--------afsOrder.EarningPrice := %s", utils.Format4Output(order.EarningPrice, false))
globals.SugarLogger.Debugf("--------afsOrder.DesiredFee := %s", utils.Format4Output(order.DesiredFee, false))
globals.SugarLogger.Debugf("--------afsOrder.ShopPrice := %s", utils.Format4Output(afsOrder.ShopPrice, false))
globals.SugarLogger.Debugf("--------order.OrderPayPercentage := %s", utils.Format4Output(order.OrderPayPercentage, false))
}
order.JxIncome = afsOrder.AfsTotalShopMoney - order.EarningPrice - order.DesiredFee + (afsOrder.ShopPrice * int64(order.OrderPayPercentage) / int64(100))
} else {
order.JxIncome = afsOrder.AfsTotalShopMoney * int64(order.OrderPayPercentage/2) / 100

View File

@@ -427,23 +427,23 @@ func orderSkus2AfsSkus(refundSkuList []*model.OrderSku) (removeSkuList []*ebaiap
}
func (c *PurchaseHandler) GetOrderAfsInfo(ctx *jxcontext.Context, vendorOrderID, afsOrderID string) (orderAfsInfo *partner.OrderAfsInfo, err error) {
orderAfsInfo = &partner.OrderAfsInfo{}
result, _, err := api.EbaiAPI.GetReverseOrder(vendorOrderID)
if err == nil {
orderAfsInfo.VendorOrderID = vendorOrderID
var afsTotalShopMoney int64 = 0
for _, v := range result {
v2 := v.(map[string]interface{})
afsTotalShopMoney += utils.MustInterface2Int64(v2["refund_user_amount"])
}
orderAfsInfo.AfsTotalShopMoney = afsTotalShopMoney
}
return orderAfsInfo, err
//orderAfsInfo = &partner.OrderAfsInfo{}
//if result, err := api.EbaiAPI.OrderPartRefundGet(vendorOrderID) ;err == nil {
//result, _, err := api.EbaiAPI.GetReverseOrder(vendorOrderID)
//if err == nil {
// orderAfsInfo.VendorOrderID = vendorOrderID
// orderAfsInfo.AfsTotalShopMoney = utils.MustInterface2Int64(result["shop_fee"])
// var afsTotalShopMoney int64 = 0
// for _, v := range result {
// v2 := v.(map[string]interface{})
// afsTotalShopMoney += utils.MustInterface2Int64(v2["refund_user_amount"])
// }
// orderAfsInfo.AfsTotalShopMoney = afsTotalShopMoney
//}
//return orderAfsInfo, err
orderAfsInfo = &partner.OrderAfsInfo{}
if result, err := api.EbaiAPI.OrderPartRefundGet(vendorOrderID); err == nil {
orderAfsInfo.VendorOrderID = vendorOrderID
orderAfsInfo.AfsTotalShopMoney = utils.MustInterface2Int64(result["merchant_income"])
}
return orderAfsInfo, err
}