aa
This commit is contained in:
@@ -15,7 +15,7 @@ func TestQueryOassBussMoney(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCheckAfsBill(t *testing.T) {
|
||||
bussResult, bussErr := api.CheckAfsBill("2104611382000451")
|
||||
bussResult, bussErr := api.CheckAfsBill("2114753262000162")
|
||||
if bussErr != nil {
|
||||
t.Error(bussErr.Error())
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ type OrderInfo struct {
|
||||
}
|
||||
|
||||
type OrderQueryParam struct {
|
||||
PageNo int `json:"pageNo,omitempty"` // 当前页数,默认:1
|
||||
PageNo int `json:"pageNo,omitempty"` // 当前页数,默认:1
|
||||
PageSize int `json:"pageSize,omitempty"` // 每页条数,默认:20,最大值100
|
||||
OrderID int64 `json:"orderId,omitempty"`
|
||||
|
||||
@@ -746,3 +746,19 @@ func (a *API) CheckSelfPickCode(selfPickCode, orderID, operPin string) (err erro
|
||||
_, err = a.AccessAPINoPage("ocs/checkSelfPickCode", jdParams, nil, nil, nullResultParser)
|
||||
return err
|
||||
}
|
||||
|
||||
type RefDiffAdjustSkuList struct {
|
||||
SkuId string `json:"skuId"`
|
||||
SkuActualWeight int `json:"skuActualWeight"`
|
||||
}
|
||||
|
||||
// 生成退差价逆向单接口
|
||||
//http://opendj.jd.com/staticnew/widgets/resources.html?groupid=169&apiid=74ed627f2d2c45dbb804c900159e4c6a
|
||||
func (a *API) GenerateReverseOrder(orderID string, skuList []*RefDiffAdjustSkuList) (err error) {
|
||||
jdParams := map[string]interface{}{
|
||||
"orderId": orderID,
|
||||
"refDiffAdjustSkuList": skuList,
|
||||
}
|
||||
_, err = a.AccessAPINoPage("reverse/generateReverseOrder", jdParams, nil, nil, nullResultParser)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func TestDeliveryEndOrder(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAfsService(t *testing.T) {
|
||||
result, err := api.GetAfsService("33927317")
|
||||
result, err := api.GetAfsService("34081924")
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func TestGetAfsService2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrderShoudSettlementService2(t *testing.T) {
|
||||
result, err := api.OrderShoudSettlementService2("2114317310000151")
|
||||
result, err := api.OrderShoudSettlementService2("2114464478000161")
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
@@ -185,3 +185,15 @@ func TestCancelAndRefund(t *testing.T) {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateReverseOrder(t *testing.T) {
|
||||
err := api.GenerateReverseOrder("2114820876000231", []*RefDiffAdjustSkuList{
|
||||
&RefDiffAdjustSkuList{
|
||||
SkuId: "2036475569",
|
||||
SkuActualWeight: 230,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,3 +191,14 @@ func (a *API) FindStoreInfoByExtStoreId(storeID int) (queryEntityStoreResult *Qu
|
||||
|
||||
return queryEntityStoreResult, err
|
||||
}
|
||||
|
||||
//更新门店状态
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=351&apiId=6418&apiName=jingdong.updateStoreStatus
|
||||
// 停启状态 1.启用,2.停用
|
||||
func (a *API) UpdateStoreStatusAPI(storeID, status int) (err error) {
|
||||
_, err = a.AccessAPI("jingdong.updateStoreStatus", prodURL, map[string]interface{}{
|
||||
"storeStatus": status,
|
||||
"id": storeID,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package jdshopapi
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -111,38 +110,10 @@ func TestFindStoreInfoByExtStoreId(t *testing.T) {
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestWIREHL(t *testing.T) {
|
||||
fmt.Println(largeGroupPositions("abcdddeeeeaabbbcd"))
|
||||
}
|
||||
|
||||
func largeGroupPositions(s string) (result [][]int) {
|
||||
var (
|
||||
l = 0
|
||||
r = 1
|
||||
count int
|
||||
)
|
||||
fmt.Println(len(s))
|
||||
for {
|
||||
fmt.Println(l, r, count)
|
||||
if r == len(s) {
|
||||
if count > 1 {
|
||||
result = append(result, []int{l, r - 1})
|
||||
count = 0
|
||||
}
|
||||
break
|
||||
}
|
||||
if s[l] != s[r] {
|
||||
if count > 1 {
|
||||
result = append(result, []int{l, r - 1})
|
||||
count = 0
|
||||
}
|
||||
l = r
|
||||
r++
|
||||
count = 0
|
||||
} else {
|
||||
count++
|
||||
r++
|
||||
}
|
||||
func TestUpdateStoreStatusAPI(t *testing.T) {
|
||||
err := api.UpdateStoreStatusAPI(69353633443, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return result
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
@@ -96,9 +96,11 @@ const (
|
||||
)
|
||||
|
||||
type RefundSku struct {
|
||||
AppFoodCode string `json:"app_food_code"`
|
||||
SkuID string `json:"sku_id,omitempty"`
|
||||
Count int `json:"count"`
|
||||
AppFoodCode string `json:"app_food_code"`
|
||||
SkuID string `json:"sku_id,omitempty"`
|
||||
Count int `json:"count"`
|
||||
ItemID string `json:"item_id,omitempty"`
|
||||
ActualWeight float64 `json:"actual_weight,omitempty"`
|
||||
}
|
||||
|
||||
type RefundSkuDetail struct {
|
||||
|
||||
@@ -97,7 +97,7 @@ func TestOrderGetRiderInfoPhoneNumber(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetOrderRefundDetail(t *testing.T) {
|
||||
result, err := api.GetOrderRefundDetail(115082650031169457, 0)
|
||||
result, err := api.GetOrderRefundDetail(70263190513673732, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user