This commit is contained in:
richboo111
2023-02-21 18:02:45 +08:00
parent 16a4b7e41e
commit fd36e2a6b3
3 changed files with 25 additions and 3 deletions

View File

@@ -1,6 +1,9 @@
package jdshopapi
import "git.rosy.net.cn/baseapi/utils"
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
)
//Creat by hang At 2022-03-28
//用于处理获得消息后对于订单的Api调用 jdsOrderApi和jdsOrder2Api分别对应shop_jxcs2021和shop——jxcs2022两个订单 由于api分为两个店铺 因此对一个OrderId查询需要同时引入两个aou
@@ -48,6 +51,24 @@ func (a *API) GetOrderById(orderID int64, isStatus bool) (getOrderResult *GetEnO
}
result, err := a.AccessAPI("jingdong.pop.order.enGet", prodURL2, params)
globals.SugarLogger.Debugf("===result :%s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("===err :%v", err)
if err == nil {
utils.Map2StructByJson(result["jingdong_pop_order_enGet_responce"].(map[string]interface{})["orderDetailInfo"].(map[string]interface{})["orderInfo"], &getOrderResult, false)
}
return getOrderResult, err
}
func (a *API) GetOrderById2(orderID int64, isStatus bool) (getOrderResult *GetEnOrderResult, err error) {
params := make(map[string]interface{})
params["order_id"] = orderID
params["code_type"] = `0`
if isStatus {
params["order_state"] = "WAIT_SELLER_STOCK_OUT,TRADE_CANCELED,PAUSE,WAIT_GOODS_RECEIVE_CONFIRM,FINISHED_L"
}
result, err := a.AccessAPI("jingdong.pop.oto.locorderinfo.enget", prodURL2, params)
globals.SugarLogger.Debugf("===result :%s", utils.Format4Output(result, false))
if err == nil {
utils.Map2StructByJson(result["jingdong_pop_order_enGet_responce"].(map[string]interface{})["orderDetailInfo"].(map[string]interface{})["orderInfo"], &getOrderResult, false)
}