diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index 6fce93ee6..731b31539 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -13,7 +13,6 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" - "git.rosy.net.cn/jx-callback/globals" "math/rand" "strings" ) @@ -81,21 +80,19 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao }, Columns: []freightTemplate_create_request.ColumnsItem{ { - RuleAddress: fmt.Sprintf(`{"%s":{"%s":{"%s":[0]}}}`, utils.Int2Str(storeDetail.ProvinceCode), utils.Int2Str(storeDetail.CityCode)[:2], utils.Int2Str(storeDetail.DistrictCode)[:2]), + RuleAddress: fmt.Sprintf(`{"%s":{"%s":{"%s":nil}}}`, utils.Int2Str(storeDetail.ProvinceCode)[0:2], utils.Int2Str(storeDetail.CityCode), utils.Int2Str(storeDetail.DistrictCode)), IsOverFree: true, OverAmount: int64(storeDetail.DeliveryFeeDeductionSill), ProvinceInfos: []freightTemplate_create_request.ProvinceInfosItem{ { - Id: int64(storeDetail.ProvinceCode), + Id: utils.Str2Int64(utils.Int2Str(storeDetail.ProvinceCode)[0:2]), Children: []freightTemplate_create_request.ChildrenItem_4{ { Id: int64(storeDetail.CityCode), Children: []freightTemplate_create_request.ChildrenItem_5{ { - Id: int64(storeDetail.DistrictCode), - Children: []freightTemplate_create_request.ChildrenItem{ - {Id: 0}, - }, + Id: int64(storeDetail.DistrictCode), + Children: nil, }, }, }, @@ -105,18 +102,15 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao }, } temp, err := api.FreightTemplateCreate(tempDetail) - globals.SugarLogger.Debugf("=========tempId:%s", utils.Format4Output(temp, false)) - globals.SugarLogger.Debugf("=========tempDetail:%s", utils.Format4Output(tempDetail, false)) - globals.SugarLogger.Debugf("=========err:%s", err) if err != nil { return 0, err } + // 绑定门店运费模板 - err = api.BindFreightTemplate(&shop_bindStoreFreight_request.ShopBindStoreFreightParam{ + if err = api.BindFreightTemplate(&shop_bindStoreFreight_request.ShopBindStoreFreightParam{ StoreId: utils.Str2Int64(vendorStoreID), FreightId: temp.TemplateId, - }) - if err != nil { + }); err != nil { return 0, err } freightId = temp.TemplateId