Merge branch 'master' of https://e.coding.net/rosydev/baseapi
This commit is contained in:
@@ -253,6 +253,7 @@ func (a *API) GetStoreBindTemp(storeId int64) (freightId int64, err error) {
|
||||
if result.Data == nil || len(result.Data.StoreFreights) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
for _, v := range result.Data.StoreFreights {
|
||||
if v.StoreId == storeId {
|
||||
return v.FreightId, nil
|
||||
|
||||
@@ -13,6 +13,8 @@ import (
|
||||
warehouse_createBatch_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createBatch/request"
|
||||
warehouse_createFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/request"
|
||||
warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -51,9 +53,10 @@ func TestStoreTemp(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAPI_CreateTradeLimitTemplate(t *testing.T) {
|
||||
parmam := 1
|
||||
tempDetail := &freightTemplate_create_request.FreightTemplateCreateParam{
|
||||
Template: &freightTemplate_create_request.Template{
|
||||
TemplateName: "盐田蔬菜11号_208452_系统模板",
|
||||
TemplateName: "盐田蔬菜11号_208452_",
|
||||
ProductProvince: 44,
|
||||
ProductCity: 440300,
|
||||
CalculateType: 2,
|
||||
@@ -61,35 +64,39 @@ func TestAPI_CreateTradeLimitTemplate(t *testing.T) {
|
||||
RuleType: 1, // 模板类型-0:阶梯计价 1:固定运费 2:卖家包邮 3:货到付款
|
||||
FixedAmount: 500,
|
||||
},
|
||||
Columns: []freightTemplate_create_request.ColumnsItem{
|
||||
{
|
||||
//FirstWeight: 0.0,
|
||||
//FirstWeightPrice: 0.0,
|
||||
//FirstNum: 1,
|
||||
//FirstNumPrice: 1,
|
||||
//AddNum: 1,
|
||||
//AddNumPrice: 0.01,
|
||||
RuleAddress: "{\"44\":{\"440300\":{\"440306\":nil}}}",
|
||||
IsOverFree: true,
|
||||
OverAmount: 5000,
|
||||
ProvinceInfos: []freightTemplate_create_request.ProvinceInfosItem{
|
||||
{
|
||||
Id: 44,
|
||||
Children: []freightTemplate_create_request.ChildrenItem_4{
|
||||
{
|
||||
Id: 440300,
|
||||
Children: []freightTemplate_create_request.ChildrenItem_5{
|
||||
{
|
||||
Id: 440306,
|
||||
Children: nil,
|
||||
},
|
||||
Columns: nil,
|
||||
}
|
||||
rule := []freightTemplate_create_request.ColumnsItem{
|
||||
{
|
||||
RuleAddress: "{\"44\":{\"440300\":{\"440306\":nil}}}",
|
||||
IsOverFree: true,
|
||||
OverAmount: 5000,
|
||||
ProvinceInfos: []freightTemplate_create_request.ProvinceInfosItem{
|
||||
{
|
||||
Id: 44,
|
||||
Children: []freightTemplate_create_request.ChildrenItem_4{
|
||||
{
|
||||
Id: 440300,
|
||||
Children: []freightTemplate_create_request.ChildrenItem_5{
|
||||
{
|
||||
Id: 440306,
|
||||
Children: nil,
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
}
|
||||
if parmam != 0 {
|
||||
tempDetail.Template.TemplateName += "满减模板"
|
||||
tempDetail.Columns = rule // 满减
|
||||
} else {
|
||||
// 固定运费
|
||||
tempDetail.Template.TemplateName += "固定运费模板"
|
||||
}
|
||||
|
||||
globals.SugarLogger.Debugf("%s", utils.Format4Output(tempDetail, false))
|
||||
a.FreightTemplateCreate(tempDetail)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user