diff --git a/platformapi/jdeclpapi/jdeclpapi.go b/platformapi/jdeclpapi/jdeclpapi.go index b5f44541..01777346 100644 --- a/platformapi/jdeclpapi/jdeclpapi.go +++ b/platformapi/jdeclpapi/jdeclpapi.go @@ -165,7 +165,7 @@ type WaybillReceiveParam struct { // ThrOrderID string `json:"thrOrderId"` //否 无 销售平台订单号(例如京东订单号或天猫订单号等等。总长度不要超过100。如果有多个单号,用英文,间隔。例如:7898675,7898676) SenderName string `json:"senderName"` //是 无 寄件人姓名,说明:不能为生僻字 SenderAddress string `json:"senderAddress"` //是 无 寄件人地址,说明:不能为生僻字 - // SenderTel string `json:"senderTel"` //否 无 寄件人电话 + SenderTel string `json:"senderTel"` //否 无 寄件人电话 // SenderMobile string `json:"senderMobile"` //否 无 寄件人手机(寄件人电话、手机至少有一个不为空) // SenderPostcode string `json:"senderPostcode"` //否 100000 寄件人邮编,长度:6位 ReceiveName string `json:"receiveName"` //是 无 收件人名称,说明:不能为生僻字 @@ -181,8 +181,8 @@ type WaybillReceiveParam struct { // SiteType int `json:"siteType"` //否 无 站点类型 // SiteID int `json:"siteId"` //否 无 站点编码 // SiteName string `json:"siteName"` //否 无 站点名称 - ReceiveTel string `json:"receiveTel"` //否 无 收件人电话 - ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空) + ReceiveTel string `json:"receiveTel"` //否 无 收件人电话 + // ReceiveMobile string `json:"receiveMobile"` //否 无 收件人手机号(收件人电话、手机至少有一个不为空) // Postcode string `json:"postcode"` //否 100000 收件人邮编,长度:6 PackageCount int `json:"packageCount"` //是 无 包裹数(大于0,小于1000) Weight int `json:"weight"` //是 2.5 重量(单位:kg,保留小数点后两位) diff --git a/platformapi/jdeclpapi/jdeclpapi_test.go b/platformapi/jdeclpapi/jdeclpapi_test.go index dcd3bb00..9083944d 100644 --- a/platformapi/jdeclpapi/jdeclpapi_test.go +++ b/platformapi/jdeclpapi/jdeclpapi_test.go @@ -78,7 +78,7 @@ func TestGetTrackMessagePlusByOrder(t *testing.T) { t.Log(utils.Format4Output(result, false)) } func TestSearchShopStock(t *testing.T) { - result, err := api.SearchShopStock("") + result, err := api.SearchShopStock("EMG4418113943423") if err != nil { t.Fatal(err) } @@ -86,7 +86,7 @@ func TestSearchShopStock(t *testing.T) { } func TestQueryStock(t *testing.T) { - result, err := api.QueryStock("") + result, err := api.QueryStock("EMG4418113943423") if err != nil { t.Fatal(err) } diff --git a/platformapi/jdshopapi/jdshopapi.go b/platformapi/jdshopapi/jdshopapi.go index 24188b0b..c52196b4 100644 --- a/platformapi/jdshopapi/jdshopapi.go +++ b/platformapi/jdshopapi/jdshopapi.go @@ -32,11 +32,13 @@ const ( CreateCatType = "3" UpdateCatType = "1" - VenderID = 10374877 - TransportID = 2158480 - JxBrandId = 559853 - JdShopMaxStock = 9999 - JdsPromiseID = 13725637 + VenderID = 10374877 + TransportID = 2158480 + JxBrandId = 559853 + JdShopMaxStock = 9999 + JdsPromiseID = 13725637 + JdsDeliveryCompany3rd = "1274" + JdsDeliveryCompanyJD = "773574" JdsSkuStatus1 = 1 //从未上架 JdsSkuStatus2 = 2 //自主下架 diff --git a/platformapi/jdshopapi/order.go b/platformapi/jdshopapi/order.go index 2c7f591c..f253b20c 100644 --- a/platformapi/jdshopapi/order.go +++ b/platformapi/jdshopapi/order.go @@ -1,6 +1,9 @@ package jdshopapi -import "fmt" +import ( + "encoding/json" + "fmt" +) //订单出库 //https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=1948&apiName=jingdong.pop.order.shipment @@ -17,3 +20,19 @@ func (a *API) OrderShipment(orderID int64, logiCoprId, logiNo string) (err error } return err } + +//获取商家物流公司 +//https://open.jd.com/home/home#/doc/api?apiCateId=75&apiId=582&apiName=360buy.get.vender.all.delivery.company +func (a *API) GetDeliveryCompany() (result interface{}, err error) { + var params = map[string]interface{}{ + "fields": "id,name", + } + data, _ := json.Marshal(params) + result, err = a.AccessAPI("360buy.get.vender.all.delivery.company", prodURL, map[string]interface{}{ + "360buy_param_json": string(data), + }) + if err == nil { + + } + return result, err +} diff --git a/platformapi/jdshopapi/order_test.go b/platformapi/jdshopapi/order_test.go index 6d586eb2..f1a73569 100644 --- a/platformapi/jdshopapi/order_test.go +++ b/platformapi/jdshopapi/order_test.go @@ -2,6 +2,8 @@ package jdshopapi import ( "testing" + + "git.rosy.net.cn/baseapi/utils" ) func TestEnGet(t *testing.T) { @@ -11,3 +13,11 @@ func TestEnGet(t *testing.T) { } // t.Log(utils.Format4Output(result, false)) } + +func TestGetDeliveryCompany(t *testing.T) { + result, err := api.GetDeliveryCompany() + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(result, false)) +} diff --git a/platformapi/jdshopapi/sku_test.go b/platformapi/jdshopapi/sku_test.go index dbfc107c..128f2271 100644 --- a/platformapi/jdshopapi/sku_test.go +++ b/platformapi/jdshopapi/sku_test.go @@ -423,9 +423,7 @@ func TestFindWareById(t *testing.T) { } func TestTransparentImageAdd(t *testing.T) { - // err := api.TransparentImageAdd(wareId, imageUrl) - // if err != nil { - // t.Fatal(err) - // } - // t.Log(utils.Format4Output(result, false)) + str := "12300548611401" + // suffix := str[12:len(str)] + fmt.Println(str[:12]) } diff --git a/platformapi/jdshopapi/store_test.go b/platformapi/jdshopapi/store_test.go index 9f592c6b..769146b9 100644 --- a/platformapi/jdshopapi/store_test.go +++ b/platformapi/jdshopapi/store_test.go @@ -47,7 +47,7 @@ func TestGetProvince(t *testing.T) { } func TestGetCity(t *testing.T) { - result, err := api.GetCity(2) + result, err := api.GetCity(12) if err != nil { t.Fatal(err) } @@ -55,7 +55,7 @@ func TestGetCity(t *testing.T) { } func TestGetCounty(t *testing.T) { - result, err := api.GetCounty(2815) + result, err := api.GetCounty(988) if err != nil { t.Fatal(err) }