gg
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
package jdshop
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/putils"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPurchaseHandler_GetJdsOrders(t *testing.T) {
|
||||
type fields struct {
|
||||
BasePurchasePlatform partner.BasePurchasePlatform
|
||||
DefSingleStorePlatform putils.DefSingleStorePlatform
|
||||
}
|
||||
type args struct {
|
||||
ctx *jxcontext.Context
|
||||
orderCreatedStart string
|
||||
orderCreatedEnd string
|
||||
current int
|
||||
pageSize int
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
args args
|
||||
wantOrderResult *jdshopapi.AllOrdersResult
|
||||
wantErr bool
|
||||
}{
|
||||
// TODO: Add test cases.
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
p := &PurchaseHandler{
|
||||
BasePurchasePlatform: tt.fields.BasePurchasePlatform,
|
||||
DefSingleStorePlatform: tt.fields.DefSingleStorePlatform,
|
||||
}
|
||||
gotOrderResult, err := p.GetJdsOrders(tt.args.ctx, tt.args.orderCreatedStart, tt.args.orderCreatedEnd, tt.args.current, tt.args.pageSize)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("GetJdsOrders() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(gotOrderResult, tt.wantOrderResult) {
|
||||
t.Errorf("GetJdsOrders() gotOrderResult = %v, want %v", gotOrderResult, tt.wantOrderResult)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -778,7 +778,8 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
||||
result2, _ := api.JdEclpAPI.QueryStock(storeSkuBind.EclpID)
|
||||
if len(result2) > 0 {
|
||||
if result2[0].UsableNum < v.Count {
|
||||
// return nil, nil, fmt.Errorf("此商品库存不足无法购买,请联系管理员!skuID:[%v]", v.SkuID)
|
||||
return
|
||||
// return nil, nil, fmt.Errorf("此商品库存不足无法购买,请联系管理员!skuID:[%v]", v.SkuID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user