- handle possible missing jd order produceStationName.

This commit is contained in:
gazebo
2018-12-07 12:46:24 +08:00
parent bf5d9ed219
commit 6e91ada15a

View File

@@ -59,15 +59,15 @@ func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
}
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)
// globals.SugarLogger.Info(result)
if err == nil {
order = &model.GoodsOrder{
VendorOrderID: orderID,
VendorID: model.VendorIDJD,
VendorStoreID: result["produceStationNo"].(string),
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
StoreName: result["produceStationName"].(string),
StoreName: utils.Interface2String(result["produceStationName"]),
ConsigneeName: result["buyerFullName"].(string),
ConsigneeMobile: result["buyerMobile"].(string),
ConsigneeAddress: result["buyerFullAddress"].(string),