This commit is contained in:
邹宗楠
2026-03-25 11:47:11 +08:00
parent 653c903408
commit 49b0d91400

View File

@@ -904,8 +904,8 @@ func CopyMtToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail, i
VendorCategoryIDMap[v.Code] = parentID VendorCategoryIDMap[v.Code] = parentID
} }
if v.Children != nil && len(v.Children) != 0 { if v.Children != nil && len(v.Children) != 0 {
for _, c := range v.Children { for k2, c := range v.Children {
childrenCateId, err := ebaiApi.ShopCategoryCreate(utils.Int2Str(toStore.ID), parentID, c.Name, len(v.Children)-k) childrenCateId, err := ebaiApi.ShopCategoryCreate(utils.Int2Str(toStore.ID), parentID, c.Name, len(v.Children)-k2)
if err != nil { if err != nil {
globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", err) globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", err)
continue continue
@@ -975,12 +975,15 @@ func BatchInitSkuMtwm2EBai(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, t
params["weight"] = storeSku.SkuList[0].Weight params["weight"] = storeSku.SkuList[0].Weight
params["upc"] = storeSku.SkuList[0].Upc params["upc"] = storeSku.SkuList[0].Upc
params["name"] = storeSku.Name params["name"] = storeSku.Name
//params["cat3_id"] = storeSku.CateId if storeSku.CategoryName != "" {
if storeSku.CategoryCode != "" { params["category_name"] = storeSku.CategoryName
params["category_id"] = VendorCategoryIDMap[storeSku.CategoryCode]
} else {
params["category_id"] = VendorCategoryIDMap[storeSku.Name]
} }
//params["cat3_id"] = storeSku.CateId
//if storeSku.CategoryCode != "" {
// params["category_id"] = VendorCategoryIDMap[storeSku.CategoryCode]
//} else {
// params["category_id"] = VendorCategoryIDMap[storeSku.CategoryName]
//}
if storeSku.PictureContents != "" { if storeSku.PictureContents != "" {
params["desc"] = storeSku.PictureContents params["desc"] = storeSku.PictureContents
} }
@@ -998,8 +1001,13 @@ func BatchInitSkuMtwm2EBai(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, t
//if len(storeSku.SkuProperty) != model.NO { //if len(storeSku.SkuProperty) != model.NO {
// params["sku_property"] = storeSku.SkuProperty // params["sku_property"] = storeSku.SkuProperty
//} //}
customSkuID := int64(storeSku.Ctime + k) var customSkuID string = ""
_, err := toApi.SkuCreate(ctx.GetTrackInfo(), storeID, customSkuID, params) if storeSku.AppFoodCode != "" {
customSkuID = storeSku.AppFoodCode
} else {
customSkuID = fmt.Sprintf("%d_%d", storeSku.Ctime, k)
}
_, err := toApi.SkuCreate2(ctx.GetTrackInfo(), storeID, customSkuID, params)
globals.SugarLogger.Debugf("-------erbaierr := %v", err) globals.SugarLogger.Debugf("-------erbaierr := %v", err)
if err != nil { if err != nil {
errList = append(errList, err) errList = append(errList, err)