diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6707652c4..3101c12b2 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -56,6 +56,8 @@ const ( CopyStoreSkuModeFresh = "fresh" // 全新复制 CopyStoreSkuModeUpdate = "update" // 增量复制 CopyStoreSkuModeUpdatePrice = "updatePrice" // 增量复制价格 + + upcSpecName1 = "(新老包装随机发货)" ) //通用写入Excel @@ -4367,7 +4369,15 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product } if len(skuNames) == 0 { if productInfo.Name == "" { - productInfo.Name = productInfo.OriginalName + var originName string + if strings.Contains(productInfo.OriginalName, upcSpecName1) { + originName = strings.ReplaceAll(productInfo.OriginalName, upcSpecName1, "") + } + _, name, _, specUnit, unit, specQuality := jxutils.SplitSkuName(originName) + productInfo.Name = name + productInfo.SpecQuality = specQuality + productInfo.Unit = unit + productInfo.SpecUnit = specUnit } skuNames2, err := dao.GetSkuNames(db, nil, nil, productInfo.Name, false) if err != nil {