美团正向账单bug优化 skuid-->vendorskuid

This commit is contained in:
renyutian
2019-04-12 13:48:22 +08:00
parent ca8d0b362b
commit b342af3e7e
4 changed files with 25 additions and 7 deletions

View File

@@ -137,6 +137,7 @@ func (p *PurchaseHandler) AfsOrderDetail2Financial(orderData url.Values) (afsOrd
// 存储美团正向订单结账信息
func (p *PurchaseHandler) OnOrderDetail(result map[string]interface{}, operation string) (err error) {
globals.SugarLogger.Debug(utils.Int64ToStr(utils.MustInterface2Int64(result["order_id"])))
err = partner.CurOrderManager.SaveOrderFinancialInfo(p.OrderDetail2Financial(result), operation)
return err
}
@@ -177,13 +178,13 @@ func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) (
StoreID: 0,
JxStoreID: jxStoreID,
VendorSkuID: utils.Interface2String(x["sku_id"]),
SkuID: int(utils.Str2Int64(utils.Interface2String(x["sku_id"]))),
Name: utils.Interface2String(x["food_name"]),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(x["price"])),
Count: int(utils.MustInterface2Int64(x["quantity"])),
SkuBoxMoney: jxutils.StandardPrice2Int(utils.MustInterface2Float64(x["box_price"])) * utils.MustInterface2Int64(x["box_num"]),
IsAfsOrder: 0,
}
orderFinancial.Skus = append(orderFinancial.Skus, orderSkuFinancial)
orderFinancial.SalePriceMoney += orderSkuFinancial.SalePrice * int64(orderSkuFinancial.Count)
orderFinancial.SkuBoxMoney += orderSkuFinancial.SkuBoxMoney
@@ -247,5 +248,6 @@ func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) (
orderFinancial.DonationMoney = PublicWelfareDonation
// 不应该对第三方结账金额做更改,就算有异常,也要保留异常,知道问题出在哪里
// orderFinancial.ShopMoney -= PublicWelfareDonation
globals.SugarLogger.Debug(orderFinancial.VendorOrderID)
return orderFinancial
}