得到状态修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package jdshop
|
package jdshop
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -50,7 +51,9 @@ func (p *PurchaseHandler) GetOrderStatus(vendorOrgCode, vendorOrderID string) (s
|
|||||||
params["orderID"] = vendorOrderID
|
params["orderID"] = vendorOrderID
|
||||||
params["token"] = "JxCaIsHiGetJsdOrderTmpToken_20200731"
|
params["token"] = "JxCaIsHiGetJsdOrderTmpToken_20200731"
|
||||||
result, err := apiToYd("order/GetJdsOrder", params)
|
result, err := apiToYd("order/GetJdsOrder", params)
|
||||||
return status2Jxstatus(result["orderState"].(string)), err
|
jdsOrder := &jdshopapi.GetOrderResult{}
|
||||||
|
json.Unmarshal([]byte(strings.ReplaceAll(result["data"].(string), "\\", "")), &jdsOrder)
|
||||||
|
return status2Jxstatus(jdsOrder.OrderState), err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error) {
|
func (p *PurchaseHandler) AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error) {
|
||||||
@@ -193,10 +196,12 @@ func apiToYd(url string, params map[string]interface{}) (retVal map[string]inter
|
|||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if jsonResult1["code"] != nil {
|
if jsonResult1["code"] != nil {
|
||||||
|
if utils.Interface2Int64WithDefault(jsonResult1["code"], 0) != 0 {
|
||||||
errLevel = platformapi.ErrLevelGeneralFail
|
errLevel = platformapi.ErrLevelGeneralFail
|
||||||
err = utils.NewErrorCode(jsonResult1["desc"].(string), jsonResult1["code"].(string))
|
err = utils.NewErrorCode(jsonResult1["desc"].(string), jsonResult1["code"].(string))
|
||||||
baseapi.SugarLogger.Debugf("yd AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
baseapi.SugarLogger.Debugf("yd AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
retVal = jsonResult1
|
retVal = jsonResult1
|
||||||
}
|
}
|
||||||
return errLevel, err
|
return errLevel, err
|
||||||
|
|||||||
Reference in New Issue
Block a user