This commit is contained in:
邹宗楠
2023-10-12 14:29:56 +08:00
parent 6572f7b5ad
commit f984b980fd

View File

@@ -52,24 +52,24 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
fromCategoryList, _ := fromApi.RetailCatList(utils.Int2Str(fromVendorStoreId)) fromCategoryList, _ := fromApi.RetailCatList(utils.Int2Str(fromVendorStoreId))
for _, v := range fromCategoryList { for _, v := range fromCategoryList {
err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{ categoryErr := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
CategoryCode: v.Code, CategoryCode: v.Code,
Sequence: v.Sequence, Sequence: v.Sequence,
}) })
if err != nil { if categoryErr != nil {
globals.SugarLogger.Debugf("err := RetailCatUpdate : %s", utils.Format4Output(err, false)) globals.SugarLogger.Debugf("err := RetailCatUpdate : %v", categoryErr)
} }
if v.Children != nil && len(v.Children) != 0 { if v.Children != nil && len(v.Children) != 0 {
for _, c := range v.Children { for _, c := range v.Children {
if err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{ if err3 := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
CategoryNameOrigin: v.Name, CategoryNameOrigin: v.Name,
//CategoryCodeOrigin: v.Code, //CategoryCodeOrigin: v.Code,
//CategoryCode: v.Code, //CategoryCode: v.Code,
SecondaryCategoryCode: c.Code, SecondaryCategoryCode: c.Code,
SecondaryCategoryName: c.Name, SecondaryCategoryName: c.Name,
Sequence: c.Sequence, Sequence: c.Sequence,
}); err != nil { }); err3 != nil {
globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %s", utils.Format4Output(c, false)) globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", err3)
} }
} }
} }