diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 865d7b4c5..78e786bf3 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -1945,7 +1945,7 @@ func UpdateJdsOrdersStatus(ctx *jxcontext.Context, orderCreatedStart, orderCreat func SaveJdsOrders(ctx *jxcontext.Context, orderCreatedStart, orderCreatedEnd time.Time) (err error) { var ( - pageSize = 20 + pageSize = 10 ) orderResult, err := jdshop.CurPurchaseHandler.GetJdsOrders(ctx, utils.Time2Str(orderCreatedStart), utils.Time2Str(orderCreatedEnd), 1, pageSize) if err != nil { diff --git a/business/jxcallback/orderman/order_test.go b/business/jxcallback/orderman/order_test.go new file mode 100644 index 000000000..25e8b8b53 --- /dev/null +++ b/business/jxcallback/orderman/order_test.go @@ -0,0 +1,29 @@ +package orderman + +import ( + "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + "testing" + "time" +) + +func TestSaveJdsOrders(t *testing.T) { + type args struct { + ctx *jxcontext.Context + orderCreatedStart time.Time + orderCreatedEnd time.Time + } + tests := []struct { + name string + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := SaveJdsOrders(tt.args.ctx, tt.args.orderCreatedStart, tt.args.orderCreatedEnd); (err != nil) != tt.wantErr { + t.Errorf("SaveJdsOrders() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/business/partner/purchase/jdshop/callback_test.go b/business/partner/purchase/jdshop/callback_test.go new file mode 100644 index 000000000..3cd5cc06b --- /dev/null +++ b/business/partner/purchase/jdshop/callback_test.go @@ -0,0 +1,26 @@ +package jdshop + +import ( + "git.rosy.net.cn/baseapi/platformapi/jdshopapi" + "testing" +) + +func TestSaveJdsOrders(t *testing.T) { + type args struct { + msg *jdshopapi.CallBackResult + } + tests := []struct { + name string + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := SaveJdsOrders(tt.args.msg); (err != nil) != tt.wantErr { + t.Errorf("SaveJdsOrders() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/business/partner/purchase/jdshop/order.go b/business/partner/purchase/jdshop/order.go index dc5aeda31..5f6c262b7 100644 --- a/business/partner/purchase/jdshop/order.go +++ b/business/partner/purchase/jdshop/order.go @@ -2,6 +2,7 @@ package jdshop import ( "fmt" + "git.rosy.net.cn/jx-callback/globals" "net/http" "strings" "time" @@ -171,7 +172,9 @@ func (p *PurchaseHandler) AdjustOrder(ctx *jxcontext.Context, order *model.Goods } func (p *PurchaseHandler) GetJdsOrders(ctx *jxcontext.Context, orderCreatedStart, orderCreatedEnd string, current, pageSize int) (orderResult *jdshopapi.AllOrdersResult, err error) { - orderResult, err = getAPI("2").AllOrders(&jdshopapi.AllOrdersParam{ + jdsapi := getAPI("2") + globals.SugarLogger.Debugf("此时的cookie , %d", jdsapi.GetCookieCount()) + orderResult, err = jdsapi.AllOrders(&jdshopapi.AllOrdersParam{ Current: current, PageSize: pageSize, OrderCreateDateRange: []string{orderCreatedStart, orderCreatedEnd},