降级号处理

This commit is contained in:
renyutian
2019-04-28 16:04:27 +08:00
parent a12d6f04f1
commit 9000937294
2 changed files with 13 additions and 11 deletions

View File

@@ -36,6 +36,7 @@ type OrderFinancial struct {
JxSubsidyMoney int64 `json:"jxSubsidyMoney"` // 京西总补贴
JxSkuSubsidyMoney int64 `json:"jxSkuSubsidyMoney"` // 京西补贴给单条sku的金额
JxShopMoney int64 `json:"jxShopMoney"` // 店铺应结金额-京西结算给店铺的金额M
DownFlag int64 `json:"downFlag"` // 0--正常单, 1--降级单
Skus []*OrderSkuFinancial `orm:"-" json:"skus"` // 正向订单购买商品列表
Discounts []*OrderDiscountFinancial `orm:"-" json:"discounts"` // 正向订单享受优惠列表
}

View File

@@ -161,20 +161,20 @@ func (p *PurchaseHandler) AfsOrderDetail2Financial(orderData map[string]interfac
// 存储饿百正向订单结账信息
func (p *PurchaseHandler) OnOrderDetail(result map[string]interface{}, operation string) (err error) {
err = partner.CurOrderManager.SaveOrderFinancialInfo(p.OrderDetail2Financial(p.GetTrueEbaiOrder(result)), operation)
err = partner.CurOrderManager.SaveOrderFinancialInfo(p.OrderDetail2Financial(result), operation)
return err
}
func (p *PurchaseHandler) GetTrueEbaiOrder(result1 map[string]interface{}) (result2 map[string]interface{}) {
order := result1["order"].(map[string]interface{})
if utils.MustInterface2Int64(order["down_flag"]) == 1 {
result, err := api.EbaiAPI.OrderGet(utils.Interface2String(order["order_id"]))
if err == nil {
return p.GetTrueEbaiOrder(result)
}
}
return result1
}
// func (p *PurchaseHandler) GetTrueEbaiOrder(result1 map[string]interface{}) (result2 map[string]interface{}) {
// order := result1["order"].(map[string]interface{})
// if utils.MustInterface2Int64(order["down_flag"]) == 1 {
// result, err := api.EbaiAPI.OrderGet(utils.Interface2String(order["order_id"]))
// if err == nil {
// return p.GetTrueEbaiOrder(result)
// }
// }
// return result1
// }
func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) (orderFinancial *model.OrderFinancial) {
orderFinancial = &model.OrderFinancial{
@@ -186,6 +186,7 @@ func (p *PurchaseHandler) OrderDetail2Financial(result map[string]interface{}) (
// orderFinancial.DeliveryConfirmTime = getTimeFromInterface(order1["finished_time"])
orderFinancial.TotalDiscountMoney = utils.MustInterface2Int64(order1["discount_fee"])
orderFinancial.ReceivableFreight = utils.MustInterface2Int64(order1["send_fee"])
orderFinancial.DownFlag = utils.MustInterface2Int64(order1["down_flag"])
if int(getInt64FromInterface(order1["delivery_party"])) == ebaiapi.SendImmediatelySelf {
orderFinancial.SelfDeliveryDiscountMoney = orderFinancial.ReceivableFreight