This commit is contained in:
邹宗楠
2022-10-09 20:20:20 +08:00
parent ed794eeed9
commit a92b7635fb
2 changed files with 9 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)
}