From a92b7635fbfbe3d4d70b0fadd6c6201d8528b4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Sun, 9 Oct 2022 20:20:20 +0800 Subject: [PATCH] | --- business/partner/purchase/tiktok_store/store_sku2.go | 4 ++-- .../partner/purchase/tiktok_store/store_sku2_utils.go | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/business/partner/purchase/tiktok_store/store_sku2.go b/business/partner/purchase/tiktok_store/store_sku2.go index e7db1d747..c1b3237fa 100644 --- a/business/partner/purchase/tiktok_store/store_sku2.go +++ b/business/partner/purchase/tiktok_store/store_sku2.go @@ -338,7 +338,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } // spec_prices - param.SpecPrices = GetSpecPrices(param.Specs, storeSku) + param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, storeSku) // ProductFormatNew productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) globals.SugarLogger.Debug("创建=============productFormatNew", productFormatNew) @@ -412,7 +412,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } // spec_prices - param.SpecPrices = GetSpecPrices(param.Specs, storeSku) + param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, storeSku) // ProductFormatNew productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) globals.SugarLogger.Debug("更新=============productFormatNew", productFormatNew) diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index 472dd8efe..73938862f 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -68,7 +68,7 @@ func GetTiktokImgList(storeId, appOrgCode string, img ...string) (string, error) } // GetSpecPrices 解析属性和规格参数 -func GetSpecPrices(specs string, localSku *dao.StoreSkuSyncInfo) string { +func GetSpecPrices(specs, storeId string, localSku *dao.StoreSkuSyncInfo) string { skuSize := make([]*tiktokShop.SpecDetailList, 0, 0) detail1 := strings.Split(specs, "^") if len(detail1) > 3 { @@ -89,6 +89,8 @@ func GetSpecPrices(specs string, localSku *dao.StoreSkuSyncInfo) string { DeliveryInfos: []*tiktokShop.DeliveryInfos{ {InfoType: "weight", InfoUnit: localSku.SpecUnit, InfoValue: fmt.Sprintf("%f", localSku.SpecQuality)}, }, + SkuType: 1, + StockNumMap: map[string]int64{storeId: 999999}, } skuSize = append(skuSize, sku) } @@ -109,6 +111,8 @@ func GetSpecPrices(specs string, localSku *dao.StoreSkuSyncInfo) string { DeliveryInfos: []*tiktokShop.DeliveryInfos{ {InfoType: "weight", InfoUnit: localSku.SpecUnit, InfoValue: fmt.Sprintf("%f", localSku.SpecQuality)}, }, + SkuType: 1, + StockNumMap: map[string]int64{storeId: 999999}, } skuSize = append(skuSize, sku) } @@ -133,6 +137,8 @@ func GetSpecPrices(specs string, localSku *dao.StoreSkuSyncInfo) string { DeliveryInfos: []*tiktokShop.DeliveryInfos{ {InfoType: "weight", InfoUnit: localSku.SpecUnit, InfoValue: fmt.Sprintf("%f", localSku.SpecQuality)}, }, + SkuType: 1, + StockNumMap: map[string]int64{storeId: 999999}, // 最大库存数 } skuSize = append(skuSize, sku) }