This commit is contained in:
苏尹岚
2020-12-02 09:41:41 +08:00
parent 542a6b1ecc
commit 9404bb53b7
2 changed files with 5 additions and 4 deletions

View File

@@ -1639,7 +1639,7 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
} }
order.Status = model.OrderStatusNew order.Status = model.OrderStatusNew
if order.ActualPayPrice == 0 { if order.ActualPayPrice == 0 {
msg, err := jdshop.GetJdsOrder(order.VendorOrderID2) msg, err := jdshop.GetJdsOrder(order.VendorOrderID2, order.VendorOrgCode)
if err == nil { if err == nil {
if jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)) == 0 { if jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)) == 0 {
order.ActualPayPrice = jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderTotalPrice) + utils.Str2Float64(msg.FreightPrice) - utils.Str2Float64(msg.SellerDiscount)) order.ActualPayPrice = jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderTotalPrice) + utils.Str2Float64(msg.FreightPrice) - utils.Str2Float64(msg.SellerDiscount))
@@ -1886,7 +1886,7 @@ func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string)
if waybill != nil { if waybill != nil {
return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!") return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!")
} }
jdsOrder, err := jdshop.GetJdsOrder(order.VendorOrderID2) jdsOrder, err := jdshop.GetJdsOrder(order.VendorOrderID2, order.VendorOrgCode)
if err != nil { if err != nil {
return err return err
} }

View File

@@ -48,7 +48,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) {
jdsOrder, err := GetJdsOrder(vendorOrderID) jdsOrder, err := GetJdsOrder(vendorOrderID, vendorOrgCode)
return status2Jxstatus(jdsOrder.OrderState), err return status2Jxstatus(jdsOrder.OrderState), err
} }
@@ -243,10 +243,11 @@ 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) { func GetJdsOrder(vendorOrderID, vendorOrgCode string) (jdsOrder *jdshopapi.GetOrderResult, err error) {
params := make(map[string]interface{}) params := make(map[string]interface{})
params["orderID"] = vendorOrderID params["orderID"] = vendorOrderID
params["token"] = jdshopapi.JdsYdToken params["token"] = jdshopapi.JdsYdToken
params["vendorOrgCode"] = vendorOrgCode
result, err := apiToYd("order/GetJdsOrder", params) result, err := apiToYd("order/GetJdsOrder", params)
jdsOrder2 := &jdshopapi.GetOrderResult{} jdsOrder2 := &jdshopapi.GetOrderResult{}
err = utils.UnmarshalUseNumber([]byte(strings.ReplaceAll(result["data"].(string), "\\", "")), &jdsOrder2) err = utils.UnmarshalUseNumber([]byte(strings.ReplaceAll(result["data"].(string), "\\", "")), &jdsOrder2)