刷新京东商城订单
This commit is contained in:
@@ -1803,14 +1803,28 @@ func GenOrderNo(ctx *jxcontext.Context) (orderNo int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string) (err error) {
|
func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string) (err error) {
|
||||||
var (
|
|
||||||
// db = dao.GetDB()
|
|
||||||
)
|
|
||||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDJDShop)
|
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDJDShop)
|
||||||
waybill, err := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
waybill, err := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
|
||||||
if waybill != nil {
|
if waybill != nil {
|
||||||
return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!")
|
return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!")
|
||||||
}
|
}
|
||||||
|
jdsOrder, err := jdshop.GetJdsOrder(order.VendorOrderID2)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if jdsOrder == nil {
|
||||||
|
return fmt.Errorf("未查询到对应的京东商城订单!")
|
||||||
|
}
|
||||||
|
order.ConsigneeAddress = jdshop.Decrypt(jdsOrder.ConsigneeInfo.FullAddress)
|
||||||
|
order.ConsigneeName = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Fullname)
|
||||||
|
order.ConsigneeMobile = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Mobile)
|
||||||
|
order.ConsigneeMobile2 = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Telephone)
|
||||||
|
order.BuyerComment = jdsOrder.OrderRemark
|
||||||
|
if order.ConsigneeAddress != "" {
|
||||||
|
lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
|
||||||
|
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
|
||||||
|
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
|
||||||
|
}
|
||||||
|
partner.CurOrderManager.UpdateOrderFields(order, []string{"ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeMobile2", "BuyerComment", "ConsigneeLng", "ConsigneeLat"})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func init() {
|
|||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetActStoreSkuInfo",
|
Method: "GetActStoreSkuInfo",
|
||||||
Router: `/GetActStoreSkuInfo`,
|
Router: `/GetActStoreSkuInfo`,
|
||||||
AllowHTTPMethods: []string{"get"},
|
AllowHTTPMethods: []string{"get","post"},
|
||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
@@ -1278,6 +1278,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "RefreshJdsOrderConsigneeInfo",
|
||||||
|
Router: `/RefreshJdsOrderConsigneeInfo`,
|
||||||
|
AllowHTTPMethods: []string{"put"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "RefreshOrderFinancial",
|
Method: "RefreshOrderFinancial",
|
||||||
|
|||||||
Reference in New Issue
Block a user