刷新京东商城订单
This commit is contained in:
@@ -1801,3 +1801,16 @@ func GenOrderNo(ctx *jxcontext.Context) (orderNo int64) {
|
|||||||
orderNo += int64(math.Pow10(int(math.Log10(float64(orderNo)))+1)) * prefix
|
orderNo += int64(math.Pow10(int(math.Log10(float64(orderNo)))+1)) * prefix
|
||||||
return orderNo
|
return orderNo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string) (err error) {
|
||||||
|
var (
|
||||||
|
db = dao.GetDB()
|
||||||
|
)
|
||||||
|
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDJDShop)
|
||||||
|
waybill, err := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
||||||
|
if waybill != nil {
|
||||||
|
return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!")
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,12 +49,7 @@ func (p *PurchaseHandler) GetOrder(vendorOrgCode, vendorOrderID string) (order *
|
|||||||
return p.Map2Order(utils.Struct2FlatMap(resultOrders)), err
|
return p.Map2Order(utils.Struct2FlatMap(resultOrders)), err
|
||||||
}
|
}
|
||||||
func (p *PurchaseHandler) GetOrderStatus(vendorOrgCode, vendorOrderID string) (status int, err error) {
|
func (p *PurchaseHandler) GetOrderStatus(vendorOrgCode, vendorOrderID string) (status int, err error) {
|
||||||
params := make(map[string]interface{})
|
jdsOrder, err := GetJdsOrder(vendorOrderID)
|
||||||
params["orderID"] = vendorOrderID
|
|
||||||
params["token"] = "JxCaIsHiGetJsdOrderTmpToken_20200731"
|
|
||||||
result, err := apiToYd("order/GetJdsOrder", params)
|
|
||||||
jdsOrder := &jdshopapi.GetOrderResult{}
|
|
||||||
json.Unmarshal([]byte(strings.ReplaceAll(result["data"].(string), "\\", "")), &jdsOrder)
|
|
||||||
return status2Jxstatus(jdsOrder.OrderState), err
|
return status2Jxstatus(jdsOrder.OrderState), err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,3 +231,13 @@ func apiToYd(url string, params map[string]interface{}) (retVal map[string]inter
|
|||||||
})
|
})
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetJdsOrder(vendorOrderID string) (jdsOrder *jdshopapi.GetOrderResult, err error) {
|
||||||
|
params := make(map[string]interface{})
|
||||||
|
params["orderID"] = vendorOrderID
|
||||||
|
params["token"] = jdshopapi.JdsYdToken
|
||||||
|
result, err := apiToYd("order/GetJdsOrder", params)
|
||||||
|
jdsOrder = &jdshopapi.GetOrderResult{}
|
||||||
|
json.Unmarshal([]byte(strings.ReplaceAll(result["data"].(string), "\\", "")), &jdsOrder)
|
||||||
|
return jdsOrder, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ func (c *ActController) CancelAct() {
|
|||||||
// @Param pageSize query int false "表页大小(缺省全部)"
|
// @Param pageSize query int false "表页大小(缺省全部)"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /GetActStoreSkuInfo [get]
|
// @router /GetActStoreSkuInfo [get,post]
|
||||||
func (c *ActController) GetActStoreSkuInfo() {
|
func (c *ActController) GetActStoreSkuInfo() {
|
||||||
c.callGetActStoreSkuInfo(func(params *tActGetActStoreSkuInfoParams) (retVal interface{}, errCode string, err error) {
|
c.callGetActStoreSkuInfo(func(params *tActGetActStoreSkuInfoParams) (retVal interface{}, errCode string, err error) {
|
||||||
var vendorIDs []int
|
var vendorIDs []int
|
||||||
|
|||||||
@@ -1168,3 +1168,17 @@ func (c *OrderController) AcceptOrRefuseOrder() {
|
|||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 刷新京东商城订单收货人信息
|
||||||
|
// @Description 刷新京东商城订单收货人信息
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /RefreshJdsOrderConsigneeInfo [put]
|
||||||
|
func (c *OrderController) RefreshJdsOrderConsigneeInfo() {
|
||||||
|
c.callRefreshJdsOrderConsigneeInfo(func(params *tOrderRefreshJdsOrderConsigneeInfoParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
err = orderman.RefreshJdsOrderConsigneeInfo(params.Ctx, params.VendorOrderID)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user