aa
This commit is contained in:
@@ -15,7 +15,7 @@ func TestQueryOassBussMoney(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCheckAfsBill(t *testing.T) {
|
func TestCheckAfsBill(t *testing.T) {
|
||||||
bussResult, bussErr := api.CheckAfsBill("2104611382000451")
|
bussResult, bussErr := api.CheckAfsBill("2114753262000162")
|
||||||
if bussErr != nil {
|
if bussErr != nil {
|
||||||
t.Error(bussErr.Error())
|
t.Error(bussErr.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -746,3 +746,19 @@ func (a *API) CheckSelfPickCode(selfPickCode, orderID, operPin string) (err erro
|
|||||||
_, err = a.AccessAPINoPage("ocs/checkSelfPickCode", jdParams, nil, nil, nullResultParser)
|
_, err = a.AccessAPINoPage("ocs/checkSelfPickCode", jdParams, nil, nil, nullResultParser)
|
||||||
return err
|
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) {
|
func TestGetAfsService(t *testing.T) {
|
||||||
result, err := api.GetAfsService("33927317")
|
result, err := api.GetAfsService("34081924")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Error())
|
t.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ func TestGetAfsService2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOrderShoudSettlementService2(t *testing.T) {
|
func TestOrderShoudSettlementService2(t *testing.T) {
|
||||||
result, err := api.OrderShoudSettlementService2("2114317310000151")
|
result, err := api.OrderShoudSettlementService2("2114464478000161")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Error())
|
t.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
@@ -185,3 +185,15 @@ func TestCancelAndRefund(t *testing.T) {
|
|||||||
t.Fatal(err.Error())
|
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
|
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 (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
@@ -111,38 +110,10 @@ func TestFindStoreInfoByExtStoreId(t *testing.T) {
|
|||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWIREHL(t *testing.T) {
|
func TestUpdateStoreStatusAPI(t *testing.T) {
|
||||||
fmt.Println(largeGroupPositions("abcdddeeeeaabbbcd"))
|
err := api.UpdateStoreStatusAPI(69353633443, 0)
|
||||||
}
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
func largeGroupPositions(s string) (result [][]int) {
|
}
|
||||||
var (
|
// t.Log(utils.Format4Output(result, false))
|
||||||
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++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ type RefundSku struct {
|
|||||||
AppFoodCode string `json:"app_food_code"`
|
AppFoodCode string `json:"app_food_code"`
|
||||||
SkuID string `json:"sku_id,omitempty"`
|
SkuID string `json:"sku_id,omitempty"`
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
|
ItemID string `json:"item_id,omitempty"`
|
||||||
|
ActualWeight float64 `json:"actual_weight,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RefundSkuDetail struct {
|
type RefundSkuDetail struct {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ func TestOrderGetRiderInfoPhoneNumber(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetOrderRefundDetail(t *testing.T) {
|
func TestGetOrderRefundDetail(t *testing.T) {
|
||||||
result, err := api.GetOrderRefundDetail(115082650031169457, 0)
|
result, err := api.GetOrderRefundDetail(70263190513673732, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user