- handle possible missing jd order produceStationName.
This commit is contained in:
@@ -59,15 +59,15 @@ func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err error) {
|
func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err error) {
|
||||||
|
globals.SugarLogger.Debugf("jd GetOrder orderID:%s", orderID)
|
||||||
result, err := api.JdAPI.QuerySingleOrder(orderID)
|
result, err := api.JdAPI.QuerySingleOrder(orderID)
|
||||||
// globals.SugarLogger.Info(result)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
order = &model.GoodsOrder{
|
order = &model.GoodsOrder{
|
||||||
VendorOrderID: orderID,
|
VendorOrderID: orderID,
|
||||||
VendorID: model.VendorIDJD,
|
VendorID: model.VendorIDJD,
|
||||||
VendorStoreID: result["produceStationNo"].(string),
|
VendorStoreID: result["produceStationNo"].(string),
|
||||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
|
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
|
||||||
StoreName: result["produceStationName"].(string),
|
StoreName: utils.Interface2String(result["produceStationName"]),
|
||||||
ConsigneeName: result["buyerFullName"].(string),
|
ConsigneeName: result["buyerFullName"].(string),
|
||||||
ConsigneeMobile: result["buyerMobile"].(string),
|
ConsigneeMobile: result["buyerMobile"].(string),
|
||||||
ConsigneeAddress: result["buyerFullAddress"].(string),
|
ConsigneeAddress: result["buyerFullAddress"].(string),
|
||||||
|
|||||||
Reference in New Issue
Block a user